Home Coding, Scripting, Shaders

[Maxscript] Reset Pose All

polycounter lvl 7
Offline / Send Message
dg3duy polycounter lvl 7
I need help, Someone can clarify the question of how to reset the transformations of all objects that have applied attribute holder with just 1 click?
I have very little knowledge about maxscript, so any help is welcome.

clearlistener() b = $ m = EmptyModifier name:"Reset Pose" ca = attributes BrowsCtrls ( rollout rol "Reset Pose" ( button rstsel "Reset Selected" width:120 button rstall "Reset All" width:120 height: 35 on rstsel pressed do ( with undo on try ( for u in 1 to 3 do (selection[1].pos.controller[u].controller.value=0.0 selection[1].rotation.controller[u].controller.value=0.0 ) ) catch(print "error") ) on rstall pressed do ( code here ) ) ) custattributes.add m ca addmodifier b m

Replies

  • rollin
    Offline / Send Message
    rollin polycounter
    just loop over your selection array and do the same you do when resetting only one object
  • dg3duy
    Offline / Send Message
    dg3duy polycounter lvl 7
    rollin said:
    just loop over your selection array and do the same you do when resetting only one object
    thanks !
  • monster
    Offline / Send Message
    monster polycounter
    @dg3duy
    If this is for an animation rig, just use Freeze Transforms command to define the base pose. Then you can use the Transform to Zero, Position to Zero, or Rotation to Zero commands to go back to the base pose.

    Alternatively use Set As Skin Pose, then you can use Assume Skin Pose to return to the base pose.

    I use both, they operate slightly differently. Transform to Zero set the controller value to 0, like your script. Assume Skin Pose sets the world space transform. So if your rotation is 345 degrees it'll set it to 360 because it's the same transform value as 0.
  • dg3duy
    Offline / Send Message
    dg3duy polycounter lvl 7
    monster said:
    @dg3duy
    If this is for an animation rig, just use Freeze Transforms command to define the base pose. Then you can use the Transform to Zero, Position to Zero, or Rotation to Zero commands to go back to the base pose.

    Alternatively use Set As Skin Pose, then you can use Assume Skin Pose to return to the base pose.

    I use both, they operate slightly differently. Transform to Zero set the controller value to 0, like your script. Assume Skin Pose sets the world space transform. So if your rotation is 345 degrees it'll set it to 360 because it's the same transform value as 0.
    Very good info, thanks for the help!
Sign In or Register to comment.