Notifications
Clear all

[Closed] LookAt_Constraint Selection

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

3 Replies

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

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

Glad that you liked it John.