CGTalk > Software > Autodesk Maya > Maya Character Setup
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-20-2006, 08:03 PM   #1
indestructibleman
New Member
will meyer
technical director
Yozux Studios
Los Angeles, USA
 
Join Date: Apr 2005
Posts: 24
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-20-2006 at 08:06 PM.
 
Old 02-20-2006, 09:46 PM   #2
john_homer
random guy
 
john_homer's Avatar
john homer
cloth monkey
wellington, New Zealand
 
Join Date: Oct 2002
Posts: 1,396
post a scene.

.j
__________________
Make something idiot proof and they'll just build a better idiot
 
Old 02-20-2006, 10:08 PM   #3
indestructibleman
New Member
will meyer
technical director
Yozux Studios
Los Angeles, USA
 
Join Date: Apr 2005
Posts: 24
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-20-2006, 10:17 PM   #4
indestructibleman
New Member
will meyer
technical director
Yozux Studios
Los Angeles, USA
 
Join Date: Apr 2005
Posts: 24
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-20-2006, 10:47 PM   #5
john_homer
random guy
 
john_homer's Avatar
john homer
cloth monkey
wellington, New Zealand
 
Join Date: Oct 2002
Posts: 1,396
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
Code:
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...
Code:
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-22-2006, 07:28 PM   #6
indestructibleman
New Member
will meyer
technical director
Yozux Studios
Los Angeles, USA
 
Join Date: Apr 2005
Posts: 24
Quote:
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.

Quote:
Originally Posted by john_homer
another tip..

snap 1 object to another with
Code:
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-22-2006, 11:13 PM   #7
john_homer
random guy
 
john_homer's Avatar
john homer
cloth monkey
wellington, New Zealand
 
Join Date: Oct 2002
Posts: 1,396
Quote:
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-22-2006, 11:13 PM   #8
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:48 AM.


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