View Full Version : Parent Constraint on hat - hat moves when switching
stoob 12-21-2009, 03:12 PM I'm following the Digital Tutors - Rigging Cartoon Characters tutorial and have setup a hat on my character which is parented under a control curve. I then group it, then select my head control curve, then the Worldnode curb (to switch it to the world positioning), then select the Hat group and parent constrain. When I switch the parent constraint to world, move the hat and then switch to the head constraint, the hat moves a bit on it's own. This also happens the other way.
The hat won't keep still when switching, is this a bug or could I be doing it wrong?
Cheers
|
|
Darksuit
12-21-2009, 03:48 PM
I have an example file of a working constraint in this thread...
http://forums.cgsociety.org/showthread.php?t=826960
You should be able to apply this mechnic to your hat. That said you may have to tweak your curves in the graph editor, if you are still seeing some slipping.
stoob
12-21-2009, 05:32 PM
Thanks, I'm still a bit confused as these constraints make the sphere move too, I took away the keyframes but they still move, how do you change the constraints without movement?
Darksuit
12-21-2009, 06:24 PM
The movement is caused by the contstaints.
So if you stack the Two positions on top of each other, the object won't move when switching between the two. Without seeing a scene screenshot or sample file there isn't a whole lot I can do.
What I can tell you to do is to look first at the location of your constraint when you do the switch, make sure that both target objects (the two that you are swapping between) are at the same X,Y,Z location. If your off by even a little bit you will see some shaking.
One way to make sure that you have both objects in exactly the same spot:
Using a CurveShape (EP or CV curve), locator or Polygon object as your constrain to object. Create two of these objects (A and B) Object A can be parented into the rig anywhere it pleases, lets say its parented to the head. so now its moving with the head.
Object B resides outside of the Heirarchy all by it's lonesome self. But we need to make sure that A and B are at the same postion, however becuase the have different Heirarchies it won't be as simple as just typing in 0 for the translation. Select Object B then press the "w" key to enactthe move tool. Then hold down the "v" key to snap to point this will allow you to snap object B to object A.
Q: But I want to be more precise than that...
A: ok, here is a little more complicated method. Still working with object A and B. This time Group Object B with itself. Center the pivot. Select the Controller (Object A) then the Controlled (The Group with Object B, really import to make sure its the group and not the object). Then constrain Point and Rotation with no Offsets. This will snap the Group to the same rotation axis and position of Object A. Then Unparent Object B and delete the group. This puts Object B at exactly the same spot as Object A. For at least one frame that is. =)
I would recommend ZV Parent Master. You can find it on highend3d.com Handles this type of stuff quite well actually. I use it daily.
stoob
12-21-2009, 08:07 PM
Thanks Dark and Remi, I'll have to do a bit of fiddlin' about with the setups.
Cheers :)
stoob
12-22-2009, 08:03 AM
Mmmm, still with all my tweaking I couldn't get the objects to stick, Remi that plug in is awesome! Highly recommended.
Hey glad that plugin is working for you. What DS has put up is also a good way of doing it actually, and if you follow what he's put up you should be at a good place to do space switching. ZV does the same thing with a lot less setup time, but it's not customizable, if that makes sense.
Darksuit
12-22-2009, 02:19 PM
Thanks Remi.
It is one of the things that I like the most about maya. Is that there is no "One" right way to do anything. Everyone has a different way to do something and it just becomes tools in the tool box to help you get a project completed.
@ Stoob
If your still having problems put the file up or send it in an email to me (pm me and I will get you my email addy) and I will have a look at it and see what I can do for you.
stoob
12-23-2009, 07:32 AM
Yes Remi, but it's so useful!
Thanks Dave, I have emailed you the file. Don't worry too much about this one too much, the ZV ParentConstraint plug-in is very good at this stuff.
S
Darksuit
12-23-2009, 12:48 PM
NM, I got the file, it was caught in the spam filter...
Darksuit
12-23-2009, 06:56 PM
So after looking at this. I think Pinning is more along the lines of what he is looking for..
So I wrote this expression. It may not be the best but it does work (I tested it).
$Hat_Par= (`listRelatives -p ctr_hat`);
string $HatNum = (`getAttr ctr_hat.HatFollow`);
string $s1=$Hat_Par[0];
string $s2="Head_GRP";
$compare = `strcmp $s1 $s2`;
$Hat_Par= (`listRelatives -p ctr_hat`);
string $HatNum = (`getAttr ctr_hat.HatFollow`);
string $s1=$Hat_Par[0];
string $s2="Head_GRP";
$compare = `strcmp $s1 $s2`;
if ($compare == 0)
switch ($HatNum)
{
case "0":
break;
case "1":
parent ctr_hat World_GRP;
break;
case "2":
parent ctr_hat Hand_GRP;
break;
}
string $s2="World_GRP";
$compare = `strcmp $s1 $s2`;
if ($compare == 0)
switch ($HatNum)
{
case "0":
parent ctr_hat Head_GRP;
break;
case "1":
break;
case "2":
parent ctr_hat Hand_GRP;
break;
}
string $s2="Hand_GRP";
$compare = `strcmp $s1 $s2`;
if ($compare == 0)
switch ($HatNum)
{
case "0":
parent ctr_hat Head_GRP;
break;
case "1":
parent ctr_hat World_GRP;
break;
case "2":
break;
}
CGTalk Moderation
12-23-2009, 06:56 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.