spline IK not following curve

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 02 February 2006   #1
spline IK not following curve

i've got a setup for an IK spine i've had good luck with previously. i have a spine and a curve with clusters that i've created.

the problem is, on this particular spine, whenever i create the IK, it just pulls the spine into a straight line. the first two clusters move the spine, but clusters three through five have no effect on the spine (they do move the curve).

this is the command i'm using. i've used this line on another rig that works fine.

ikHandle -n XXspineIK -sj XXspineaJNT -ee XXneckJNT -sol ikSplineSolver -ccv false -c XXspineCRV;

there are seven joints, including the end, and five clusters on the curve.

all of the joints have the X pointed towards the child joint and the Y pointing towards the front of the character.

any ideas?

Last edited by indestructibleman : 02 February 2006 at 08:06 PM.
 
Old 02 February 2006   #2
post a scene.

.j
__________________
Make something idiot proof and they'll just build a better idiot
 
Old 02 February 2006   #3
http://flavoroftheweak.com/stuff/problemskel01.ma

this is the skeleton with the curve.

i then do:
ikHandle -n XXspineIK -sj XXspineaJNT -ee XXneckJNT -sol ikSplineSolver -ccv false -c XXspineCRV;

and it pulls the spine straight.


this is the script i'm using to create the curve:

Quote: spaceLocator -n XXspineaCRVloc;
spaceLocator -n XXspinebCRVloc;
spaceLocator -n XXspinecCRVloc;
spaceLocator -n XXspinedCRVloc;
spaceLocator -n XXspineeCRVloc;


pointConstraint -n dummyCONST -offset 0 0 0 -weight 1 XXspineaJNT XXspineaCRVloc;
delete dummyCONST;

pointConstraint -n dummyCONST -offset 0 0 0 -weight 1 XXspinecRIG XXspinebCRVloc;

pointConstraint -n dummyCONST01 -offset 0 0 0 -weight 1 XXspinedRIG XXspinebCRVloc;
delete dummyCONST01;

pointConstraint -n dummyCONST -offset 0 0 0 -weight 1 XXspineeRIG XXspinecCRVloc;
delete dummyCONST;

pointConstraint -n dummyCONST -offset 0 0 0 -weight 1 XXspinefRIG XXspinedCRVloc;
delete dummyCONST;

pointConstraint -n dummyCONST -offset 0 0 0 -weight 1 XXneckJNT XXspineeCRVloc;
delete dummyCONST;

select -cl;

float $XXspineaCRV[]=`getAttr "XXspineaCRVloc.translate"`;
float $XXspinebCRV[]=`getAttr "XXspinebCRVloc.translate"`;
float $XXspinecCRV[]=`getAttr "XXspinecCRVloc.translate"`;
float $XXspinedCRV[]=`getAttr "XXspinedCRVloc.translate"`;
float $XXspineeCRV[]=`getAttr "XXspineeCRVloc.translate"`;

curve -n XXspineCRV -d 1 -p $XXspineaCRV[0] $XXspineaCRV[1] $XXspineaCRV[2] -p $XXspinebCRV[0] $XXspinebCRV[1] $XXspinebCRV[2] -p $XXspinecCRV[0] $XXspinecCRV[1] $XXspinecCRV[2]
-p $XXspinedCRV[0] $XXspinedCRV[1] $XXspinedCRV[2] -p $XXspineeCRV[0] $XXspineeCRV[1] $XXspineeCRV[2] -k 0 -k 1 -k 2 -k 3 -k 4 ;
//align CRV with spine//


select -r XXspineCRV.cv[0];
newCluster "-n XXspineaCLS -relative -envelope 1";
select -r XXspineCRV.cv[1];
newCluster "-n XXspinebCLS -relative -envelope 1";
select -r XXspineCRV.cv[2];
newCluster "-n XXspinecCLS -relative -envelope 1";
select -r XXspineCRV.cv[3];
newCluster "-n XXspinedCLS -relative -envelope 1";
select -r XXspineCRV.cv[4];
newCluster "-n XXspineeCLS -relative -envelope 1";
 
Old 02 February 2006   #4
infuriatingly, the problem is not consistent. i currently have two maya sessions open.

on one session it works, on the other it doesn't.

...


ok, if i set the units to centimeters, it works. if i set them to meters, it doesn't.

it seems consistent. i can open the same file twice. in one case, i switch to cm, in the other i remain in m. when i change to cm it works.

does this make any sense to anyone?
 
Old 02 February 2006   #5
try not using linear curves.

also you may want to look into optimizing your script with some loops etc..

ie (this is not actual code.. well most of it)

string $jointList[] = {"joint1", "joint2", "joint3"};

for ($aJoint in $jointList)
{
create a curve point at the location of the joint...
}


another tip..

snap 1 object to another with

delete `parentConstraint "master" "target"`;


rather than creating it, hoping maya gave it the name you specified then deleting it..

also to get the actual name of anything you have created, use...

string $result = `parentConstraint "master" "target"`;


then you can delete/whatever with...

delete $result;

.j
__________________
Make something idiot proof and they'll just build a better idiot
 
Old 02 February 2006   #6
Originally Posted by john_homer: try not using linear curves.


doesn't seem to help. fortunately, for what i'm doing, changing units to cm doesn't seem to hurt at all.

Originally Posted by john_homer: another tip..

snap 1 object to another with

   delete `parentConstraint "master" "target"`;


ooh, that's a good one, thanks. i'll be using that a lot. thanks for the string tip as well.

a lot of this is re-editing scripts that i wrote almost a year ago and i've got some really messy stuff in there.


-will
 
Old 02 February 2006   #7
Originally Posted by indestructibleman: doesn't seem to help.

-will


hmmm, worked when I did it to your scene.. I cant see any reason you would ever want to use a linear curve for a spline IK...

the m -> cm thing probably ties into maya having bugs with its tollerances...

.j
__________________
Make something idiot proof and they'll just build a better idiot
 
Old 02 February 2006   #8
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:44 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.