3D World

HOW Do i store Data in maya?

- Jacob Rosewood, Birmingham

Antony Ward replies

I was recently approached by a client who wanted me to create a bespoke tool for them in Maya. This was a unique and complex task, the type I love, and as the scope of its developmen­t grew so did the need for even more flexibilit­y.

The client wanted the ability to add and remove elements at will, save the file, strip it down and then also regenerate everything should the need arise. The solution was to find a way to store key data in the scene so that it could then be referenced later.

This is quite a common question. Storing data can aid in a variety of ways, ranging from simple user interface input to retaining a vast array of skin weights.

As with anything in Maya there are several ways to approach this type of problem. The most obvious would be to use a node that exists in the scene. This can then have attributes added that store the data and can be easily accessed later. The problem with this approach is that a node can be accidental­ly deleted if not hidden correctly. You can help to avoid this by using a non-dag object, like a network or unknown node that won’t show up in the outliner by default.

If you are looking to script a solution, the command I use most frequently is fileinfo. Rather than storing the data as a node which sits in the scene, this writes the data into the file header. Just like the node approach, this can then be easily accessed and used when needed. Unfortunat­ely the fileinfo command also has a drawback, and that is if the file is imported into Maya rather than loaded, then the data doesn’t come with it.

Another script-based approach is to use the optionvar command. This is more limited than using fileinfo but is ideally suited for retrieving data that has been input into a user interface.

These are just a few options available but are the most widely used. Experiment with them and see which suits your project the best.

 ??  ?? Storing data in a maya scene is a useful way to future-proof your tools. Here we look at just a few ways to achieve this
Storing data in a maya scene is a useful way to future-proof your tools. Here we look at just a few ways to achieve this
 ??  ??

Newspapers in English

Newspapers from Australia