PDA

View Full Version : LookAt_Constraint Selection


marvelatthedust
01-22-2009, 01:58 AM
again, i am here asking what i think is likely a really basic question, but i learned my scripting and whatnot in maya, so maxscript is still a bit beyond me.

I have a biped in max that has a LookAt_Constraint that i don't want there. what i need to know is how to use maxscript to select said constraint and delete it. i have 300+ files that need this constraint removed, and going into each one, pulling up the list box, selecting the node, and so forth for all 300 seems a bit excessive to me. i'm sure it can be done with a batch file, i just don't know how to select the rotten thing.

the constraint is on a node called TransRoot, so i think it may be something like:
TransRoot.controller.LookAt_Constraint
but that doesn't work, and i can't find anything is the help docs that could help.

anyone here who could offer some advice?

thanks!


-ian

ZeBoxx2
01-22-2009, 02:36 AM
if you open the maxscript Listener and enter just:
TransRoot.controller
does that already result in the Listener reporting the lookat constraint?
If so, you can replace that controller (don't think you can delete it - unless it's part of a list controller somehow) a la:
TransRoot.controller = Euler_XYZ()

if by 'node' you meant an object in the scene, and I'm correct in my assumption that the LookAt constraint is on the object's rotation, use:
$TransRoot.rotation.controller = Euler_XYZ()

next up - make a loop that loads your files, performs that command, and saves them (under a new filename, perhaps, just in case) so you can sit back and have a coffee instead of opening a file, pressing a script button, saving the file, moving on to the next :)

JohnSwafford
01-22-2009, 02:21 PM
If you're not determined to write the file opening/saving code yourself, Paul Neale created an excellent tool called "Batch It Max" which will run any script(s) you desire within multiple scene files and then save them. It has plenty of control over the process and was completely stable in my experience.

http://www.paulneale.com/scripts/batchItMax/batchItMax.htm

PEN
01-22-2009, 04:19 PM
Glad that you liked it John.

CGTalk Moderation
01-22-2009, 04:19 PM
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.