Home Animation Showcase & Critiques

Orientation of Rig Handles

recronin
null
Offline / Send Message
recronin null
Hi,
Sorry if I posted this in the wrong forum - please delete this if so. It's been many years since I've done any animations and I want to get back into it.

I've already gone through the process of rigging, skinning and orienting joints, but the question I have is if the rig handles actually need to be oriented in the same way as the joint it's controlling. If it does, could you explain how to do this? I haven't come across any solution.

Here is a screenshot of what I mean - the joint (where the rotation handle is) has the correct orientation, but the rig handle is based on the world and I'm unable to change this.



Thanks!

Replies

  • KielFiggins
    Offline / Send Message
    KielFiggins polycounter lvl 8
    -Group the control shape, name it ..._Adjust (the Adjust and Control should have the same pivot now)
    -parentConstraint the _Adjust to the joint without offset (this aligns the Adjust to the Joint)
    -delete the parent constraint (now you can put this in your rig hierarchy)
    -constrain the joint to the control shape (since the transforms and alignment is on the Adjust, the values will be zero)

    Good luck,
  • slipsius
    Yup, What Kiel said. I also have a script that does it. It's python. Just plug it into your script editor, then, create a  control, name it and orient it how you want it to be zero'd out. with the control selected, run the script

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
     maya.cmds as cmds<br> 
    #Creates a selection array with every object selected<br>selection = cmds.ls(sl=True)<br> 
     
    for object in selection:<br> 
    &nbsp;&nbsp;&nbsp;&nbsp;#creates an empty group (em=1) and names it (n=)<br>&nbsp;&nbsp;&nbsp;&nbsp;secondObj = cmds.group(em=1, n=("PvtGrp_" + object))<br> 
    &nbsp;&nbsp;&nbsp;&nbsp;#Copies selected objects translate and rotate&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;start_Pos = cmds.xform(object, q=True, ws=True, rp=True)<br>&nbsp;&nbsp;&nbsp;&nbsp;rotX = cmds.getAttr(object + ".rotateX")<br>&nbsp;&nbsp;&nbsp;&nbsp;rotY = cmds.getAttr(object + ".rotateY")<br>&nbsp;&nbsp;&nbsp;&nbsp;rotZ = cmds.getAttr(object + ".rotateZ")<br> 
    &nbsp;&nbsp;&nbsp;&nbsp;#Moves the group to the position of the control, and gives it the controls rotation<br>&nbsp;&nbsp;&nbsp;&nbsp;cmds.move(start_Pos[0], start_Pos[1], start_Pos[2], secondObj)<br>&nbsp;&nbsp;&nbsp;&nbsp;cmds.setAttr(secondObj + ".rotateX", rotX)<br>&nbsp;&nbsp;&nbsp;&nbsp;cmds.setAttr(secondObj + ".rotateY", rotY)<br>&nbsp;&nbsp;&nbsp;&nbsp;cmds.setAttr(secondObj + ".rotateZ", rotZ)<br> 
    &nbsp;&nbsp;&nbsp;&nbsp;#Parent the control under the new group<br>&nbsp;&nbsp;&nbsp;&nbsp;cmds.parent(object, secondObj)<br> 
    &nbsp;&nbsp;&nbsp;&nbsp;cmds.makeIdentity(object, apply=True)import
  • recronin
    Offline / Send Message
    recronin null
    Hi Kiel and Slipsius,
    Thank you very much for your help. This works beautifully.

    edit: removed an error I made
Sign In or Register to comment.