salwanbadra 18 November 2009 01:51 AM
maybe if you arranged it this way would be much better, what do you think?
Yeah if you want.
But it doesn’t resolve the problem of the main thread :
skinCluster -q -dt with long name?
Also the “longNameOf” function will only work if you create an objet in the same program you created an object and then query the full name.
BUT!
IF you have a scene with a model skinned on some bones.
AND there are bones with the same name your magical function is obsolete ^_^…
Then let have more fun :
Create a model and skin some bones on it.
In your bones hierarchy change the name of 2 bones by “A” only.
And then launch this little script :
string $skinnedObject[] = `ls -sl -l`;
string $boneList[] = `skinCluster -q -dt $skinnedObject[0]`;
string $fullnames[];
for ($i =0; $i< `size $boneList`; $i++)
{
$fullnames[$i] = `longNameOf $boneList[$i]`; } print "\n// ---- Short Name List ---//";
print $boneList;
print "\n// ---- Full Name List ---//";
print $fullnames;
On my side the print will give :
// ---- Short Name List ---//
bn_r_Elbow
bn_r_Shoulder
bn_l_Wrist
bn_l_Elbow
bn_l_Shoulder
bn_r_Wrist
bn_Head
bn_Neck
A
A
bn_r_Ankle
bn_r_Knee
bn_r_Hip
bn_l_Ankle
bn_l_Knee
bn_l_Hip
skinCluster1GroupParts
skinCluster1GroupId
// ---- Full Name List ---// |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|A|bn_Neck|bn_r_Shoulder|bn_r_Elbow |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|A|bn_Neck|bn_r_Shoulder |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|A|bn_Neck|bn_l_Shoulder|bn_l_Elbow|bn_l_Wrist |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|A|bn_Neck|bn_l_Shoulder|bn_l_Elbow |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|A|bn_Neck|bn_l_Shoulder |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|A|bn_Neck|bn_r_Shoulder|bn_r_Elbow|bn_r_Wrist |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|A|bn_Neck|bn_Head |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|A|bn_Neck
|CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|bn_r_Hip|bn_r_Knee|bn_r_Ankle |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|bn_r_Hip|bn_r_Knee |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|bn_r_Hip |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|bn_l_Hip|bn_l_Knee|bn_l_Ankle |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|bn_l_Hip|bn_l_Knee |CH_HalfMutant_ANode_01|grp_globalMove_01|grp_BONES_01|A|bn_l_Hip
skinCluster1GroupParts
skinCluster1GroupId
And if you give a look at the full name of the “A” bones, the `longNameOf will give nothing.
Yeah I accept it the fucntino is better than the “objectType function” and will not simply stop the script with no error and warning, just a blank nothing empty thing.
THEN!
for that reason It could be a good issue to add a -l or -f flag to the skincluster function to get the full name of the objects when we do a query! ^_^

|