PDA

View Full Version : how to batch change TCB to Euler??


zinzin
11-11-2005, 09:15 AM
I have a script to output and input animation data, but it only works with euler rotation and now all my character's bones are TCB, is there any way to change them by one clicking?

it supposed to be easy, just a for loop~ but I dont know max script so I can only ask for help here!~

thank you very much~

Zin

j-man
11-11-2005, 03:32 PM
hello,

Yes it is pretty straight forward. This should help you along your way:


sel=selection as array -- the current selection as an array of objects
cnt=(Euler_XYZ()) -- create a Euler controller
for s in sel do s.rotation.controller=(copy cnt) -- copy the controller onto each object in the array


zinzin
11-12-2005, 06:54 AM
thanks J_man

it's working, I forgot to mention that the translation actually should be changed as well,
it's bezier position~ and I have to convert it to position XYZ
so I mimic what you wrot:

sel=selection as array
cnt=(Euler_XYZ())
cnu=(Position_XYZ ())
for s in sel do s.rotation.controller=(copy cnt)
for s in sel do s.position.controller=(copy cnu)

it is a kind of working~ but when I run it, all objects jumped to 0 0 0 position, so there must be a flag I can use to keep them where they were, can you show me?

thank you very much~

galagast
11-12-2005, 10:52 AM
I would suggest adding a Position_List() first, then afterwards add in the Position_XYZ() like so:

sel=selection as array
cnt=(Euler_XYZ())
cnl=(Position_List())
cnu=(Position_XYZ ())
for s in sel do s.rotation.controller=(copy cnt)
for s in sel do s.position.controller=(copy cnl)
for s in sel do s.position.available.controller=(copy cnu)

this way, your original positions are maintained.
hope this helps :)

zinzin
11-12-2005, 08:13 PM
thanks galagast:
I tried the scripts, I don't know if you have tried it in max, somehow, it doesn't work for me...
the objects jumped back to zero position, and the position controller actually be changed to position list instead of position XYZ, and I tried to convert the controller just to position list, it's still will jump back to zero point~ it's weird or did I do something wrong?
I am using max7.0
thank you for ur replay~

PEN
11-12-2005, 11:19 PM
Alt + right click and in the upper left quad you will find Freeze Transforms. This will set a list controller with an euler in the rotation and a position XYZ in the position track.

galagast
11-14-2005, 01:56 AM
yup, sori, i just wrote it down from my faulty memory, hehe.

now i tried this one on my comp:
the problem with the first one is it was assigning new position controllers to the objects, which meant that it would be placed by default to [0,0,0]. Now, by directly assigning the controller to the object, max will do the convertion automatically, thus maintaining positions. (just the way the motion panel works)

from your previous problem:

it's working, I forgot to mention that the translation actually should be changed as well,
it's bezier position~ and I have to convert it to position XYZ


sel=selection as array
for s in sel do
(
s.rotation.controller=Euler_XYZ()
s.position.controller=Position_XYZ()
)


I suggested adding Lists because its a safe way of maintianing animated controllers. but the previous script i posted created a new position list -> by default @ [0,0,0]... im really sorry for the mistake..:)

the suggestions j_man made are also valid, these are useful in instances where you might want to copy a controller from an object, then distribute it to other objects without instancing them. So, say you have a sphere rotating as you want it:

sel=selection as array -- the current selection as an array of objects
cnt=$sphere.rotation.controller -- store the controller
for s in sel do s.rotation.controller=(copy cnt) -- copy the controller onto each object in the array, note that if you remove the "copy" from "(copy cnt)", instances will be made to each object..

zinzin
11-14-2005, 02:36 AM
Thanks guys, It's working now~ just forgot a "(" ")"
lol~
It seems I can't handle this job~

thanx a lot~~~

CGTalk Moderation
11-14-2005, 02:36 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.