Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / skinCluster -q -dt with long name?
  RSS 2.0 ATOM  

skinCluster -q -dt with long name?
Rate this thread
 
36254
 
Permlink of this thread   Subscribe to this thread
avatar
  • samavan
  • Posted: 02 November 2009 04:13 PM
  • Location: Mie-Ken Tsu-Shi
  • Total Posts: 45
  • Joined: 09 April 2008 12:51 PM

Currently using the following command :

skinCluster --dt

Is there a way to get the long name of each objects it wil return?

I’m using this function to get an oject list.

And then doing a test with if and the objectType function, the script will simply stop with no error and warning if I query the function with an object using the same name with another object in the current scene.

This is too bad, I found this error after 1h of tests.

Could someone add a -f flag like the listRelativesfunction to get the longname?
Or a -l flag like the ls
Also add a warning on the objectType function when it doesn’t understand what happened… =_=

warning objectType function doesn't understand what's happeningreport the bug on the Autodesk website. :)  ....

or like the nodeType function :

// Error: line 1: More than one object matches name: ToDelete //

Little deasapointing here…

Also no answer to the following thread?
http://area.autodesk.com/for...litaround-from-maya-2008/

Thanks by advance to the Autodesk Team.



Portfolio_small.png

Replies: 0
avatar

have you tried longNameOf procedure?



Replies: 0
avatar
  • samavan
  • Posted: 16 November 2009 02:51 PM

salwanbadra 16 November 2009 01:30 AM

have you tried longNameOf procedure?

This function is like a big joke I found in Maya… I don;’t understand why Autodesk teame is losting timefor that -__-…

Try that in your Maya and let have some fun :)

string $grpA = `group -em`;
string $grpB = `group -em`;

string $A[] = `polyCube -h 100 -w 100 -d 100 -n A`;
parent $A[0] $grpA;
string $B[] = `polyCube -h 100 -w 100 -d 100 -n A`;
parent $B[0] $grpB;

longNameOf "A";


Portfolio_small.png

Replies: 0
avatar

maybe if you arranged it this way would be much better, what do you think?

string $grpA = `group -em`;
string $grpB = `group -em`;

string $A[] = `polyCube -h 100 -w 100 -d 100 -n A`;
parent $A[0] $grpA;
$longA=`longNameOf "A"`;
 
string $B[] = `polyCube -h 100 -w 100 -d 100 -n A`;
$longB=`parent $B[0] $grpB`;
print 
($longA+"\n"+$longB[0])


Replies: 0
avatar
  • samavan
  • Posted: 18 November 2009 02:17 PM

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! ^_^



Portfolio_small.png

Replies: 0
avatar

humm yeah you are right if you are using the script to query data from existing nodes,not to create new nodes, if you are using it to create new nodes I think it work well, writting the longNameOf command after the creation command.
I’m writting now long script (2500 line) about blindshape gride, actually this command (longNameOf) saved me a lot of troubles, I know that it don’t work if you have more than one object in the scene so you have to used it before you have this name conflect thingy,
but anyway I found this nice way of getting the long name data of all objects with the same short name in the scene, try it

$theAs=`ls "A"`;

you will have string array of long names, their order is the creation order, so if you know the creation order you can query the array member that you want, does that work for you? it depend on what you script do, what you script do by the way? lol :D



Replies: 0
avatar
  • samavan
  • Posted: 28 November 2009 10:01 PM

To tell the truth I don’t remember exactly.... haha!

But as always I found another way to get my arrray anyway!

But Autodesk should fixe this kind of bug…



Portfolio_small.png

Replies: 0




   
  Settings Choose Theme color: