MakeJointCompression
 
 
 

MakeJointCompression

Introduced

v4.0

Description

Joint compression is a technique used to model two parts of a character pushing into each other, usually the arms or the legs. A bounding volume sphere is used on the LowerBone to do the pushing, and two nulls are used on the UpperBone to be pushed. For example, when the forearm comes into the bicep, the bicep deforms slightly as it is pushed by the forearm. The bounding volume is attached to the forearm and the nulls to the bicep to get a more realistic skin deformation.

Scripting Syntax

oJoint = MakeJointCompression( [Prefix], UpperBone, LowerBone, GuideObjectCollection, [RollDivisionCollection] );

Return Value

Returns a Joint JScript object.

Parameters

Parameter Type Description
Prefix String The name prefix for the newly created compression nulls.
UpperBone String The parent for the upper part of the joint assembly.
LowerBone String The parent for the lower part of the joint assembly.
GuideObjectCollection String A list of 4 objects: 1) the boxes defining a line on the upper joint, closest to the root; 2) the boxes defining a line on the upper joint, closest to the joint; 3) The box control in the middle of the radius curve on the lower joint; and 4) the small sphere that acts as a center point of the radius curve.
RollDivisionCollection String A collection of roll division objects so this assembly can bind to a roll division instead of a bone (optional).

Examples

JScript Example

/*
        This script makes a 2 bone arm
        and attaches joint compression nulls
        to the bicep.
*/
//
// Draw an arm-like two bone chain
//
var lPosStart = XSIMath.CreateVector3();
var lPosEnd = XSIMath.CreateVector3();
lPosStart.Set(0,0,0);
lPosEnd.Set(3,0,-1);
var HandChain = ActiveSceneRoot.Add2DChain(lPosStart, lPosEnd);
lPosEnd.Set(6,0,0);
HandChain.AddBone(lPosEnd, 2);
//
// Create guide objects and position them
//
var guidecoll = new ActiveXObject("XSI.Collection");
guidecoll.Add( GetPrim("Null", "RootGuide") ); 
guidecoll.Add( GetPrim("Null", "JointGuide") ); 
guidecoll.Add( GetPrim("Null", "SphereCenter") ); 
guidecoll.Add( GetPrim("Null", "RadiusControl") ); 
var Xfm = XSIMath.CreateTransform();
Xfm.SetTranslationFromValues(2,0,0.5);
guidecoll(0).Kinematics.Global.Transform = Xfm;
Xfm.SetTranslationFromValues(2.5,0,0.5);
guidecoll(1).Kinematics.Global.Transform = Xfm;
Xfm.SetTranslationFromValues(2,0,-1);
guidecoll(2).Kinematics.Global.Transform = Xfm;
Xfm.SetTranslationFromValues(4,0,-1);
guidecoll(3).Kinematics.Global.Transform = Xfm;
var JointCmp = MakeJointCompression("ABC_",HandChain.Bones(0),HandChain.Bones(1),guidecoll);
logmessage ("Data in the returned joint compression object:");
logmessage ("---------------------------------------------");
logmessage ("UpperJoint: " + JointCmp.UpperJoint);
logmessage ("LowerJoint: " + JointCmp.LowerJoint);
logmessage ("Volume    : " + JointCmp.Volume);
logmessage ("Envelope  : " + JointCmp.Envelope);
//results of running this script: 
//INFO : "Data in the returned joint compression object:"
//INFO : "---------------------------------------------"
//INFO : "UpperJoint: ABC_UpperJoint"
//INFO : "LowerJoint: ABC_LowerJoint"
//INFO : "Volume    : ABC_BendVolume"
//INFO : "Envelope  : ABC_UpperJoint,ABC_LowerJoint"

See Also

MakeArm MakeLeg