Home Technical Talk

Transform to zero 3DS Max with Maxscript

marcoslem
null
Hi

I made a script to freeze transform any rigging character controller to create a "zero position". So when I animate any controller, I want to reposition the controllers to "zero position".
I would like to know how to make a maxscript to TRANSFORM TO ZERO without the basic command
- macros.run "Animation Tools" "TransformToZero"

Thank you very much

Marcos

Replies

  • Swordslayer
    Offline / Send Message
    Swordslayer interpolator
    It means setting all the non-frozen controllers in the position/rotation/scale lists to their default values. There are many ways to skin a cat, for example:

    fn resetListCtrl ctrl =<br>&nbsp;&nbsp;&nbsp; for i = 1 to ctrl.numSubs where<br>&nbsp;&nbsp;&nbsp; (<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; local sub = ctrl[i]<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; isController sub.controller and<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; not matchPattern (getSubAnimName ctrl i asString:on) pattern:"Frozen*" and<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; (local ctrlClass = classOf sub.controller).creatable<br>&nbsp;&nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp; do<br>&nbsp;&nbsp;&nbsp; (<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; local newCtrl = ctrlClass()<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; clearControllerNewFlag newCtrl<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sub.controller = newCtrl<br>&nbsp;&nbsp;&nbsp; )<br><br>for obj in selection do<br>(<br>&nbsp;&nbsp;&nbsp; local ctrlTM = getTMController obj<br>&nbsp;&nbsp;&nbsp; setCommandPanelTaskMode #create<br><br>&nbsp;&nbsp;&nbsp; resetListCtrl (getPropertyController ctrlTM #position)<br>&nbsp;&nbsp;&nbsp; resetListCtrl (getPropertyController ctrlTM #rotation)<br>&nbsp;&nbsp;&nbsp; resetListCtrl (getPropertyController ctrlTM #scale)<br>)

Sign In or Register to comment.