|
|||||||||||||||||||||||||||||||||||||
CHAPTER 16
|
| |
![]() | TIP You can use showproperties obj.scale.controller to list the Noise Scale options. |
You can access the object properties as they appear in the Track View. To do so, you need to add [index] after the object name. obj[3] is the Transform track and obj[4] is the Node track (called the Object track in Track View). These properties are called subanims.
These are the subanims an object can have:
Index | Subanim | |
---|---|---|
1 | Visibility track | |
2 | Space warps | |
3 | Transform | |
4 | Node (Object) track | |
5 | Material | |
6 | Image Motion Blur Multiplier | |
7 | Object Motion Blur On Off |
Notice that some objects will not use all subanims, if the property in a subanim cannot be assigned to that objectfor instance, lights will not have materials assigned. However, even when a subanim is unused, the numbering stays the same.
To know how many subanims you have in a node, use the .numsubs property. To know the name of the subanims, you can use GETSUBANIMNAME and GETSUBANIMNAMES. GETSUBANIMNAME requires the index of the subanim. GETSUBANIMNAMES returns an array of all the properties, listing them in the Listener and making them available to searches such as FOR loops.
You can change the controller of any subanim, and any of its properties. You can also know if the subanim is or is not animated by using the .isanimated property.
The .value property will list the value of a subanim. If an object is animated, the .value property will show the subanim value at the current frame.
Figure 16.1 shows the Track View of a sample objecta sphere. To create the sphere and access its subanims, type:
obj = sphere() obj.numsubs getsubanimname obj 3 obj[3].numsubs getsubanimname obj[3] 1 obj[3][1].value
FIGURE
16.1 Track View of the subanims, and their syntax
in MAXScript
Notice that obj.numsubs returns 7, which is the number of subanims an object has. Then, getsubanimname obj 3 will list the name of the third subanim, in this case #transform.
Then we checked to see how many subanims Transform has, using obj[3].numsubs. It returns 3, which is expected since the sphere has a PRS Transform controller.
Finally, we asked for the name of the first subanim in Transform, and for its value. Notice we used [3][1], which means were accessing the first subanim of the third subanim. An XYZ Position controller also has 3 subanims, which means the Y axis is obj[3][1][2].
Previous | Table of Contents | Next |
© 2000, Frol (selection, edition, publication)
![]() |