PDA

View Full Version : How can i reorient a curve's local rotation axis?


maroond
08-26-2011, 04:38 AM
how can i match it to a joint? I have a control which offsets my orient constraint and this is really frustrating me. Could anyone please give me some advice?

lyco84
08-26-2011, 06:36 AM
You could do it manualy. Select the curve --> Display --> Transform display --> local rotation axis.
Then enter the component mode (F8), right click on the question mark and select Local Rotation Axis. Now you should be able to select the Local Rotation Axis of the curve and rotate it with the rotation tool.

maroond
08-27-2011, 11:28 PM
You could do it manualy. Select the curve --> Display --> Transform display --> local rotation axis.
Then enter the component mode (F8), right click on the question mark and select Local Rotation Axis. Now you should be able to select the Local Rotation Axis of the curve and rotate it with the rotation tool.

this is does not work. when i go back into object mode, the orientation returns to what it was before.

just fyi I thought i found a solution:

"Well, you want the control icons to have the same local rotation axis as the joints, right?
Since we can't change that directly we can do a work around.
This is what I do in maya, but I'm sure you can apply it to your app.

Create a group or a locator, I usually prefer group since it doesn't show in viewport. Now select the joint and then the group/locator and do an orient constrain with maintained offset turned "off" as we want the group to have the same rotation axis as the joint! Then delete the constraint, but whatever you do do not freeze the group/locators transformations. So now, all we need to do is parent(no constrain) the control icon to this group and freeze it transformations. Se how it changes it's local rotation axis to line up with the group's. And the groups has the same as the joint, meaning the joint and the group are both zeroed out in rotation and have exactly the same local rotations! Perfect, now you only need to orient constrain the joint to the control icon and that should be it!"

but this is the result i got. What the f maya lol....
http://i117.photobucket.com/albums/o71/of_montreal00/Screenshot2011-08-27at34403PM.png

TravisRamsdale
08-29-2011, 04:41 PM
Well this is what I do.

1. Parent constrain your control curve to the joint so everything is matching up.
2. Delete the parent constraint from the curve.
3. Group the control curve which will give it a parent.
4. Select your curve and zero out its rotation values in the channel box.(Do NOT freeze transforms!)
5. Select the parent group and then parent that underneath the joint.
6. Now zero out the parent groups rotations. (Again...Do NOT freeze transforms!)
7. Unparent the group from the joint.
8. Constrain the joint to the control curve. (The Curve itself...Not the Parent Group)

So basically at the end of this you should end up with your control curve sitting under a parent group. When you select the curve you'll notice that it's all zero'd out and matching the joint orientation. Voila!

I'd actually love to hear from anyone else with tips and tricks to do with this kind of thing. This works great for me but I'm always happy to hear if there's a better way to do things.

Hope it helps
Trav

mlefevre
08-30-2011, 10:01 AM
Parent curve to joint. Freeze rotations. Unparent.

TravisRamsdale
08-30-2011, 10:48 AM
That'll reorient the curves axis to the joint but the curve won't be zero'd out for animation.

mlefevre
08-30-2011, 12:50 PM
That'll reorient the curves axis to the joint but the curve won't be zero'd out for animation.

He didn't specify ;)

chovasie1
08-30-2011, 10:11 PM
Method that i use for this i really simple and i like it...

i make my nurbsCurve control in 0.0.0 in center of grid... than group it twice to itself... So you end with something like this:
group/group/control

top group i rename to something like:" name_off" because it will take all transformations and offsets so you have one more group with clean transformations for driven keys and your nurbsCurve control also...

after grouping you just parent top off group to target joint and zero out all translations and rotations... .your offset ( top ) group will snap and orient itself to joint and other SDK group and nurbsControl will go to ride as well...

than just unparent your offset group from joint and there you go!
now just parentConstraint joint to nurmbsCurve and youre done...

hope this helps...

here's my really old script ( first that ever wrote i think) from years ago...

just source this script below and call it with "CControl" command

/*
this script will orient your nurbs control curve to target joint
and make one SDK and offset group above nurbsControl

how to use it:

your target joint name must end with "_defJnt" for script to work

select nurbs control first than target joint,
than type CControl procedure name
*/


global proc CControl (){

string $selma []= `ls -sl`;
int $num = `size ($selma)`;


if ($num == 2){
string $selection []= `ls -sl`;
string $controlName = $selection[0];
string $controlTarget = $selection[1];

setAttr ($controlName+".translate") 0 0 0;
setAttr ($controlName+".rotate") 0 0 0;

string $sdkNames = `substitute "defJnt" $controlTarget "sdk"`;
string $offNames = `substitute "defJnt" $controlTarget "off"`;
string $ctrlNames = `substitute "defJnt" $controlTarget "ctrl"`;
rename $controlName $ctrlNames;
$controlName = $ctrlNames;
select $controlName;
group -n $sdkNames;
group -n $offNames;
parent $offNames $controlTarget;
setAttr ($offNames+".translate") 0 0 0;
setAttr ($offNames+".rotate") 0 0 0;
parent -w;
}

else
{
print "select nurbsControl than TARGET joint";
}

}


i know this is pretty bad script but it wokrs... and i still use it from time to time... i have newer version somwhere with some more features but i dont have it on this computer...

hope this helps

Chovasie

CGTalk Moderation
08-30-2011, 10:11 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.