PDA

View Full Version : ik solver plugin


Flip86
08-29-2010, 05:26 PM
hey...i am writing an ik solver node that includes a stretch attribute. in theory it should works good.

i want to scale my joints with scale.By-function in the MFnTransform Class. here my algorithm:

double stretch[3];
stretch[0] = lengthH / 10;
stretch[1] = 1;
stretch[2] = 1;

double noStretch[3];
noStretch[0] = 1;
noStretch[1] = 1;
noStretch[2] = 1;


if (lengthH >= 10) {
startTransformFn.scaleBy ( stretch );
midTransformFn.scaleBy (stretch);

}

startTransformFn.scaleBy ( noStretch );
midTransformFn.scaleBy (noStretch);


the plugin scales the joints but not in the right way. the value that the joints scales is to big. but if i create a stretchy rig with nodes in maya i have to use the same way for the calculation.: length of the handle / 10 (in my example). and it works. but not in my plugin code. but it is the same calculation.

can somebody help me with my problem?? i hope you know what i mean.


thx!!

Gravedigger
08-30-2010, 10:46 AM
hei philipp!

could it be some units problem? not sure about this but maybe the values you pass to the api call are interpreted to be in a specific unit and that in your case they dont match.

what scale values do you get in your joint nodes? do they match what you pass to the api call? try to ouput the stretch values with MGlobal::displayInfo() so you can compare those values. if theres a constant coefficient to match the values i'm pretty sure its a units problem

hope that helps and hit me up in skype later if you need help

CGTalk Moderation
08-30-2010, 10:46 AM
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.