Major
18-02-2009 05:55:43
Hi All,
I've having some great fun automating some of the more repetitive tasks we undertake using Ofusion Materials using MaxScript.
I was wondering if there is a reference somewhere that would allow me to tweak some values that relate to oFusion object settings (LOD, Animations Lists, etc)
Specifically I'd like to automatically create Animation List entries using some Maxscript.
Thanks!
Lioric
19-02-2009 17:15:02
For detailed information on the object animations see the "objectAnims.ms" file from the maxRoot/oFusion/scripts folder
You can use the "addObjectAnimation" maxscript function to add animations to objects, it usage is:
(int) addObjectAnimation object name start end loop external animSet inPlace absAnim type
The argument values are:
(obj) object: scene object where the animation will be added to
(string) name: animation name
(int) start and end: animation range (frames)
(bool) loop: loop state
(bool) external: animation external file creation state (only used in skeletal animations)
(int) animSet: index of the external animation group (only used if external is true)
(bool) inPlace: skeletal animation creation mode (see "Object Properties" page in the "User's Guide")
(bool) absAnim: type of inPlace animation, if true the animation will be created as Absolute animation (used only if inPlace is true)
(int) type: animation type, possible values are:
1 (All)
2 (Skeletal)
3 (Pose or Morph)
4 (Node)
5 (Material)
The method returns the index integer for the added animation
To add an animation (all types) from frame 0 to 100 named "anim01" to the object01 you can use:
addObjectAnimation object01 "anim01" 0 100 false false 0 false false 1
To add an animation from frame 0 to 100 named "anim01" to the object01 for only NODE animations, you can use:
addObjectAnimation object01 "anim01" 0 100 false false 0 false false 4
To remove an animation from an object you can use the "removeObjectAnimation" method, its usage and argument values are:
removeObjectAnimation object animationIndex
(obj) object: the scene object
(int) animationIndex: the index of the animation
To access the name list of animations you can use the "animList" object member (only if the object has any animations):
"object.animList.count" will get the number of animations this object has
"object.animList[1]" will get the name of the first object's animation