Beruflich Dokumente
Kultur Dokumente
if(L_ikfkSwitch.ikfk==1)
{
L_Ik_cltr|L_IkHandel.ikBlend=1;
L_Ik_cltr.visibility=1;
Chest_ctrl1|Left_Sholder.visibility=0;
L_PV.visibility=1;
}
else
{
L_Ik_cltr|L_IkHandel.ikBlend=0;
L_Ik_cltr.visibility=0;
Chest_ctrl1|Left_Sholder.visibility=1;
L_PV.visibility=0;
}
}
global proc stretchIK_Multiple (string $ikHandleName, string $prefix,
string $aimAxis) {
switch ($aimAxis) {
case "x": {
$aimAxis = ".tx";
break;
}
case "y": {
$aimAxis = ".ty";
break;
}
case "z": {
$aimAxis = ".tz";
break;
}
}
string $list[] = `ls -sl`;
string $theIkHandle = $ikHandleName;
string $jointList[] = `ikHandle -q -jl $theIkHandle`;
// Aadimos el ltimo joint que el comando ikHandle no aade
string $endEffector = `ikHandle -q -ee $theIkHandle`;
string $lastJoint[] = `pickWalk -d left $endEffector`;
$jointList[size($jointList)] = $lastJoint[0];
// Todos los joints menos el primero
string $stretchyJointList[];
for ($i=0;$i<size($jointList)-1;$i++) {
$stretchyJointList[$i] = $jointList[$i+1];
}
// MD nodes
// normalize MD
string $normalizeMD = `createNode multiplyDivide -n ($prefix +
"Normalize_MD")`;
// joints MD
for ($i=0;$i<size($stretchyJointList);$i++) {
createNode multiplyDivide -n ($prefix +
$stretchyJointList[$i] + "_MD");
}
// condition nodes
// main condition node
string $mainCondition = `createNode condition -n ($prefix +
"Main_CN")`;
// joints CN
for ($i=0;$i<size($stretchyJointList);$i++) {
createNode condition -n ($prefix + $stretchyJointList[$i] +
"_CN");
}
// creacin del distance node y sus locators
string $distanceNode = `createNode distanceBetween -n ($prefix +
"DistNode")`;
string $startLocator[] = `spaceLocator -p 0 0 0 -n ($prefix +
"startDist_loc")`;
string $startLocatorShape[] = `pickWalk -d down $startLocator[0]`;
string $endLocator[] = `spaceLocator -p 0 0 0 -n ($prefix +
"endDist_loc")`;
string $endLocatorShape[] = `pickWalk -d down $endLocator[0]`;
connectAttr -f ($startLocatorShape[0] + ".worldPosition")
($distanceNode + ".point1");
connectAttr -f ($endLocatorShape[0] + ".worldPosition")
($distanceNode + ".point2");
}
for ($i=0;$i<size($stretchyJointList);$i++) {
connectAttr -f ($mainCondition + ".outColor.outColorR")
($prefix + $stretchyJointList[$i] + "_CN" + ".firstTerm");
setAttr ($prefix + $stretchyJointList[$i] + "_CN" +
".secondTerm") 1;
$aimValue = `getAttr ($stretchyJointList[$i] + $aimAxis)`;
$aimValue = abs ($aimValue);
setAttr ($prefix + $stretchyJointList[$i] + "_CN" +
".colorIfFalseR") $aimValue;
connectAttr -f ($prefix + $stretchyJointList[$i] + "_MD" +
".outputX") ($prefix + $stretchyJointList[$i] + "_CN" + ".colorIfTrueR");
connectAttr -f ($prefix + $stretchyJointList[$i] + "_CN" +
".outColor.outColorR") ($stretchyJointList[$i] + $aimAxis);
}
// Creamos un atributo en el ikHandle para on/off la funcion de
stretch
addAttr -ln "ikStretch" -at double -min 0 -max 1 -dv 1
$theIkHandle;
setAttr -e-keyable true ($theIkHandle + ".ikStretch");
connectAttr -f ($theIkHandle + ".ikStretch") ($mainCondition +
".colorIfFalseR");
print ("// The attribute \"Ik Stretch\" has been created at " +
$theIkHandle + " to control stretch on/off\n");
select $theIkHandle;
}
global proc stretchIK_formProcess () {
string $theIkHandle = `textField -q -tx ikHandle_TF`;
string $thePrefix = `textField -q -tx prefix_TF`;
("nnStretchSpine()");
text -l" Parent the SpineGlobalScaleDummy null under Master Control to
work with Scaling";
text -l" Spine Strech" -bgc 1 1 1;
showWindow nnStretch;
////////////////////////////////////////////////////////////////////////////
/////////////////