PDA

View Full Version : Adding Joint's on Spline later


circassia
03-26-2012, 12:11 PM
Hi @ all,

after creating my joints and aligning them along a spline, i want to modify the spline afterwards, i want to add more joints. How can i append new joints to the last joint?

http://imageshack.us/photo/my-images/803/joint2spline.jpg/
http://img803.imageshack.us/img803/1548/joint2spline.jpg (http://imageshack.us/photo/my-images/803/joint2spline.jpg/)

thanks!

Nyro
03-26-2012, 04:59 PM
To add joints to a chain, enter the Joint tool and place your first click on the last joint in your existing chain. Then just place joints as usual.

circassia
03-27-2012, 03:56 AM
I don't know if you are aware, but i've posted this thread into scripting, that means, that i've created this spline + the joints in the Script Editor.

global proc createRoute(){
global string $jointData[];
global string $selectedCurves[];
string $selectedCurves[] = `ls -sl`;
if(size($selectedCurves) < 1){
print("No Curve Selected");
}
jointCreateChain();

}

global proc jointCreateChain(){
global string $selectedCurves[];
int $count = curveGetDistance($selectedCurves[0]);
global string $jointData[];
int $i;
for($i = 0; $i <= $count; $i++){
if($i != 0 && $i != $count)
joint -p $i 0 0;
if($i == 0)
$jointData[0] = `joint -p $i 0 0`;
if($i == $count)
$jointData[1] = `joint -p $i 0 0`;
}

print($jointData[0] + "das ist startname" + $jointData[1] + "das ist endname");

}

global proc float curveGetDistance(string $currentCurve){


float $maxU = `getAttr ($currentCurve + ".maxValue")`;
string $arcLD = `arcLengthDimension ($currentCurve + ".u[" + $maxU + "]")`;
float $arcLength = `getAttr($arcLD + ".arcLength")`;
return $arcLength;
}

global proc alignJoints(){
global string $selectedCurves[];
global string $jointData[];
select -add $selectedCurves[0];
select -add ($jointData[0] + ".rotatePivot");
select -add ($jointData[1] + ".rotatePivot");
ikhandle -sol iksplinesolver -ccv false -snc true;
}

Nyro
03-27-2012, 10:54 AM
I don't know if you are aware, but i've posted this thread into scripting, that means, that i've created this spline + the joints in the Script Editor.


Actually, no it means no such thing, by my experience ;)

But my answer is pretty much the same even for MEL:

To append joints in MEL, select the last joint in the chain before running the joint command. Since joints created by the joint command are automatically added to the active list, running in consecutively will create a chain/hierarchy.

CGTalk Moderation
03-27-2012, 10:54 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.