You need to make sure you process your list in the same way the hierarchie
is made.
If you move a child into the right place, and then the parent, the child
will get an offset.


2012/8/23 Florian Croquet <[email protected]>

> Hi,
>
> I keep working on this code, I want to create a sort of auto rig tool. I'm
> not sure that I'm doing it right but anyway I will learn with my mistakes
> :D
>
> So if you remembered, I get in my list all my gizmo item and I want to use
> them in order to replace my bones.
> So I created this "for xxx in xxxx"
>
>     def moveSkeletonProcess(self,*args):
>         lookingForGizmo = cmds.ls('Gizmo_*', g = True, ap = True)
>
>         print lookingForGizmo
>
>         for gizmo in lookingForGizmo:
>             #self.moveBonesToGizmo(gizmo)
>
>             gizmoName = gizmo.rpartition("Shape")[0]
>
>             boneName = gizmoName.rpartition("Gizmo_")[2]
>
>
>             wst = cmds.xform(gizmoName,q =True ,ws = True ,t = True)
>             move = cmds.xform(boneName, ws = True , t = wst)
>
> You can see the result here : http://www.youtube.com/watch?v=L4Js8ajGZFM 
> <http://www.youtube.com/watch?v=L4Js8ajGZFM>
>
> It works but I need to press the button 4 times if I want everything in
> place :(. I don't understand why my boucle doesn't work , could it be a
> problem with my bones' rotation axis ?    
> <http://www.youtube.com/watch?v=L4Js8ajGZFM>
>
> --
> view archives: http://groups.google.com/group/python_inside_maya
> change your subscription settings:
> http://groups.google.com/group/python_inside_maya/subscribe
>

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to