Spine

General

Stretchy Ik

-- not particular to spine, but filing under for now.

-node to get curve length is 'arcLengthDimension'

// Measure the arcLength of curve curveShape1 at u = 0.5

curve -d 3 -p -9.3 0 3.2 -p -4.2 0 5.0 -p 6.0 0 8.6 -p 2.1 0 -1.9 -k 0 -k 0 -k 0 -k 1 -k 2 -k 2;

arcLengthDimension curveShape1.u[0.5];

problem with arcLengthDimension, it will make WORLD/global scale difficult if you are piping the va. back into the scale.

OR 'curveInfo' node..

--------------

Hey Guys,

I'm looking into creating a custom Stretchy Spline IK setup that doesn't

pop (over & under extends in extreme situations).

But I seem to be unable to wrap my head around how to calculate

orientations on points on the curve.

Since the points on the curve don't have any orientation (well, they do

have tangents or something like that?) I have no clue on how to actually

start with this.

My main references of tools in Maya would be the Motion Path and the Spline

IK (with Advanced Twist controlled by a start and end object).

If anybody has any starting points for this it would be greatly appreciated!

Thanks in advance.

Regards,

Roy

Hey Roy,

I've done a sort of 'manual' setup like this by writing a 'pointAtArclen' node and then wiring the rest with existing nodes. In my case I used aim constraints for each joint, but you can do something similar within your solver- get the orientation by figuring out where each joint needs to be on the curve and what the vector would be if you were aiming each joint at the next.

-JP

Hey JP,

Actually I know how to get the point on the curve. Aiming at the next joint is also a relatively easy step.

On the other hand knowing/calculating the up vector for the aim is something I'm unaware of how to do it. How did you solve/calculate the up vector for the aim constraint?

I'm especially interested in allowing a twisting motion along the curve.

-Roy

John Patrick

I would think about it like this: for each point/joint along the curve,

you should have some sort of 'up vector'. You could get that a number of

ways - a start/end 'twist' amount, an array of 'up' target objects for each

joint, etc. The end result is that each point along the curve should have

a vector to some other target to help determine the twist.

Next, you'll need to know what your joint's aim-axis is. The built-in

spline ik node assumes an 'x' aim axis (which blows), but you could have an

input attr for the aim axis.

Zero out whichever axis is the aim-axis in your 'up vector', then convert

that vector into an MMatrix. Now you have a matrix you can multiply your

existing aimed-joint-matrix by to twist it.

I think it would be nice to have an array of world matrices for up-objects,

which you would plug the controls for the spline into. You could get the

closest point along the curve for each and treat a particular axis as the

'up vector' for that point along the curve, then interpolate between them.

Hey John,

Thanks for the quick replies. I'm not sure what you mean with the following:

*

*

*Zero out whichever axis is the aim-axis in your 'up vector', then convert

that vector into an MMatrix. Now you have a matrix you can multiply your

existing aimed-joint-matrix by to twist it.*

Why would that be helpful or what would those steps produce? If I zero out

the up vector and convert that into an MMatrix ain't I creating a zero

matrix? (Default matrix)

-Roy

John Patrick

That was a lot of shorthand on my part.

For instance, lets say you're using some sort of 'target' object for the

up-axis. And let's say the aim-axis of the joint is y, and the up-axis is

x. Pretend your joint is at position [0,3,0] and the 'target' object is at

[1,4,1], so the aim vector is [1,1,1]. If your target is perfectly on-plane

with your joint, ie it lies on the x-z plane of your joint, then you don't

need any work; but usually, a target object might be 'offset' from this

plane, as is the case here. You need to remove the 'y' part of this vector

so that you don't wobble the joint - so the aim vector becomes [1,0,1].

aimVec = OM.MVector(1,0,1)

basisVec = OM.MVector(1,0,0) #since the aim-axis is x

quat = basisVec.rotateTo(aimVec)

twistMatrix = quat.asMatrix()

newJointMatrix = aimMatrix * twistMatrix

There are other things you'll need to take into account - rotation orders,

parent matrices, inverse scale compensation, etc, to get the final euler

rotation values of each joint. Hopefully this gets you pointed in the

right direction. Good luck!

Muscle spline rigging tool (Autodesk help)

How to script Ik Handles properly?

around line 211, you mention something about the pole vectors and such flipping out. we actually used to have a module where we would have ik's built on every joint (it was like a super-offset arm), and when the ik's were built between every joint, we actually had to execute that backwards for maya to not freak out. so we would build the end ik's first and work our way up the chain. i don't believe we ever figured out the problem, but we don't really use those modules these days anyway.

Breathing Controls

automatic expression here

manual breath control

Spine Types

(from Character Rigging Best Practices- link dead)

IK/FK Hybrid

Good for: action animations, expressive perfomance, whip driven animations

Pros- "FK flexibility with IK smoothness"

Cons - complicated setup, fk limitations

SplineIK

try smoothCurve with history for smoother spine curve

Good for: performance animation, managing large # of bones, dynamic balance

Pros- smooth sinuous motion

Cons - popping, snapping, odd key scopes

say I make a joint chain

i'd like to make a curve on that joint chain with one cv / each joint

(KingFarrukh)

basically what you could do it get the world position of each joint and put that vector (x,y,z value) into the curve command.

example:

string $jnt[] = {"exampleJntA","exampleJntB","exampleJntC"}; // <-- there are better ways to get the jnt list but this is for the example

// this stores each jnts worldPosition

vector $storePositions[];

int $x = 0;

for ($i in $jnt)

{

$storePositions[$x] = `xform -query -worldSpace -translation $i`;

$x++;

}

//this creates the curve command

int $degree = 1; //<-- incase u want to change the degree type

string $buildCurve = ("curve -d " + $degree);

for ($each in $storePositions)

{

$buildCurve += (" -p " + $each);

}

eval $buildCurve;

(Sean Kealey)

Contraposto

ex. 'Ribbon', 'Awesome', 'Isner'-- separate control of hip and chest areas

Good for: Performance, action animation, movement cycles

Pros- intuitive posing, best weight shifts

Cons- control motion overlaps, no whip action

More Spinse

'Divine Spine' (Erick Miller)

TD Matt's spine

"The Isner Spine for XSI"

http://www.isner.com/isnerspine/spine_introduction.htm

Matt Berglund's "Awesome Spine" (i adapted for my rig..)