I' m fairly new to programming and lack the knowledge to solve the following task.
global proc assign()
{
select -hierarchy; //select all objects in hierarchy
string $jointsHirearchy[]=`ls -sl`; //save objects to array
for ($each in $jointsHirearchy) // check all objects in hierarchy
{
string $type =`nodeType $each`;// check the type of the object
if ($type != "joint") // if it's not a joint...
{
select -tgl $each; // ...deselect it
}
if ($type == "joint") // Problematic part: parent mesh to each joint and bind it's length to joint size
{
select $each;
polyCube;
ParentConstraint $each pCube1;
}
}
}
I need to assign a box to each joint so that the size of the box matches the length of the joint.