Maya change total cv number of the curve when creating ik spline

Maya change total cv number of the curve when creating ik spline

A_Lovi
Explorer Explorer
589 Views
3 Replies
Message 1 of 4

Maya change total cv number of the curve when creating ik spline

A_Lovi
Explorer
Explorer

Hi. I'm Alessandro and i'm building my first rigging reel after school.

I'm doing a script for making a spine rig, but i found this strange behaviour in maya and i want to understand why it works like that.

I create a chain with 7 joints, then a cv curve (cubic) with 7 cvs (one on every joint).

Then i do this:

//

ikHandle -sol ikSplineSolver -n "mario" -pcv false -ccv false -scv false -sj "joint1" -ee "joint7" -c "curve1" -fj true;

//

I use the -freeze joints flag in order to avoid joints rotations when creating the handle.

All is fine, except for the curve that now have 9 cv (the 2 new are created near the first and last ones).

I tried various things, and discovered that maya match the number of cv with the number of joints in the chain, and then add 2 more (i.e. 11 joins = 13 cv).

The -scv flag doesn't seem to work.

My question is: can i controll this?

And, why maya do this?

If i want to control the chain with a curve with only a few cv, do i have to avoid using the -fj flag?

I hope my english wasn't too bad.

Thanks in advance for your time.

0 Likes
590 Views
3 Replies
Replies (3)
Message 2 of 4

dinofiguera
Collaborator
Collaborator

Ciao Alessandro,

 

I checked your problem and you are right,
I have no idea why Maya does this, there is an easy workaround though, even though a bit annoying:
you duplicate your original curve before the IK handle command, 
let Maya build up the IK spline handle with the wrong curve and then
replace the wrong curve with your duplicate.
It is easy to do it via script because there is only a simple connection between the curve and the IK handle
(yourCurve.worldSpace --------> yourIKSplineHandle.inCurve).

Spero che ti sia di aiuto,
D

0 Likes
Message 3 of 4

dinofiguera
Collaborator
Collaborator

I´m sure it is the -freezejoint flag that operates something on the curve, changing the CV number.
Because it forces the curve to align with the joints to prevent unwanted rotations.
D

0 Likes
Message 4 of 4

A_Lovi
Explorer
Explorer

Thanks for the reply.

I tried swapping the curve on the ik node, but joints move on it, catching rotations.

I also tried rebuilding the curve, but it slightly move.

The -fj flag is quite handy, and i think i will use it like... forever :D.

Considering that it allways adds the same number of cv, it is quite predictable.

Anyway i'm still wondering why maya do this, because is so wierd to me.

0 Likes