Community
Maya Animation and Rigging
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya animation topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

parenting joints that are constrained changes their orientation

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Anonymous
2231 Views, 6 Replies

parenting joints that are constrained changes their orientation

Hi - okay, so the problem I have is this:

 

  • I have a skeleton and rig all set up and done
  • I now want to duplicate all relevant joints to create a clean export skeleton
  • I do this via a small python script that duplicates selected joints, parent constrains the duplicate to the original joint, deletes the parent constraint, freezes rotation, and then reapplies a parent constraint to the original joint.
  • The result of this is fine - I end up with a bunch of standalone export_joints that are controlled by the original joints
  • now I need to parent the export_joints together, to create the entire export skeleton
  • my issue is: when I try to parent my export joints together to create the entire exportable skeleton which will also be used for skinning, the local rotation axis of each joint changes (see attached image) 
  • IF I manually remove the parent constraint from each export joint, parent together the export skeleton and then manually reapply each parent constraint again (so that the export skeleton is again driven by the rig skeleton), everything works fine. But obviously this is a very tedious and time consuming process, when a script could just as easily do it

 

I have tried a test in Maya with just two joints - the same thing happens: I can create my export joints, but parenting them will result in LRA's changing.  So it looks like it is not an issue with my rig, but rather something in Maya I've setup incorrectly?

 

I hope it makes sense 😃

 

 

  

201628495_835029943775015_5326761655738805880_n.gifAbove: you can see the local rotation axes changing when I parent the joints (this should not be possible, since each export joint is parent constrained to the original rig joint so I dont understand what's going on) 🙂

Labels (3)
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

Here is a little test scene where I've tried troubleshooting things.. maybe it's easier to see here: the 3 separate joints are driven by the smaller joint chain.. parenting totally screws up their local rotation axis - once I unparent the joints, the LRA is back to how it should be

GIF 17-06-2021 12.52.59.gif

Message 3 of 7
mcw0
in reply to: Anonymous

I believe this is how Maya works.  Create a joint chain.  Notice that when you create the next joint, the orientation of the parent joint changes.  The joint orient values change based on the options you've set for the joint creation process.  It's dependent on the child joint.  If you notice in the script editor, there's an additional command that's run.

 

joint -e -zso -oj xyz -sao yup joint1;


So it would follow that parenting joints would have a similar effect...changing the orientation of the joint.  But the results would be a bit more "unexpected" since it wasn't created as a single chain to begin with.  And the above command isn't run.  So I guess the take away is if you want the result to be a joint chain, create it as such instead of parenting individual joints.


Message 4 of 7
Anonymous
in reply to: mcw0

Hi 😃 Thanks for your reply.

 

I may not have explained very well what I'm after. 

 

I have a "messy" skeleton which is used for the rig I'm doing. This skeleton contains all manner of stuff I don't want exported to the game engine (such as no-flip IK joints, duplicate FK/IK arm chains, superfluous joints, etc.)

 

Using a python script, I create a clean export skeleton which contains ONLY the joints that need to be skinned to my mesh. These are parent constrained to the "messy" joints, resulting in a bunch of standalone clean joints that can be exported to the engine with no clutter.

 

My issue comes when I try to parent the clean joints back together. That's when the orientation changes - which should not be possible, since they are parent constrained to the original messy joint. That's the core of my problem: I don't understand how this can happen, when the clean joint has a parent constraint from the messy joint.

 

Another note: if 1) I remove the parent constraints from the clean joints and then 2) parent the clean skeleton together, and then 3) reapply the parent constraints - everything works as it should. The messy skeleton drives the clean one, and it can be exported clean to the game engine.

 

Perhaps there is a bug in Maya 2018 relating to python? Or perhaps relating to parenting while a node is constrained?

 

Message 5 of 7
mcw0
in reply to: Anonymous

Joints are unlike transform nodes in that they have a "jointOrient" attribute.  This is what's causing the issues you are experiencing.  That's why it only works the way you described.  With constraints in place, the joint orientation is probably unable to be set correctly.

Message 6 of 7
Anonymous
in reply to: mcw0

hmm.. well - I tried using a point + orient constraint instead of a parent constraint. That worked fine - so it seems like it is something specific to the parent constraint - perhaps some flag in the python script that is missing, so the script is not behaving as it should (although I find that hard to believe given the person who gave to me knows his stuff) 🙂

 

I do have a test scene I could attach .. 

Message 7 of 7
Anonymous
in reply to: Anonymous

Okay.. so here's what I ended up doing. 

 

Instead of using a parent constraint when creating the export skeleton, I used a point constraint and an orient constraint. This works, and the joints don't change their orientation when I parent the skeleton back together.

 

One issue is, it does not take scale into account. To get around this, I went into the node editor and linked the scale of the main control to the scale of the export skeleton's root joint.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report