EightBit
04-28-2008, 07:01 PM
I have a quadruped rig and I'd like to write a script which will select the hierarchy below the selected joint and toggle ghosting.
Because ghosting slows Maya down, I want to select only the joints which are being animated, so during the selection process I want add a filter for a specific string in the name.
The following code will select the hierarchy of joints below the selection and filter for the string "Tail". It works in a simple scene://Select hierarchy then Search/Print Joints w/specificed name
select -hi;
string $letters = "Tail";
ls -sl -type joint ("*"+$letters+"*");
But the string filter fails in the rig I'm working with. The reason for the failure has to do with the hierarchy of the scene, but I don't know how why.
When I list the joints, a ":" appears in the results, ie://Results
Rig_0:ct_Tail8_C Rig_0:ct_Tail9_C
Model_0:jt_Tail0_C Model_0:jt_Tail1_C...
But when I try to filter these results for the string "Tail", nothing is returned.
What I'd like to know is why does the ":" appear in the listing and how do I work around this?
Thanks.
Because ghosting slows Maya down, I want to select only the joints which are being animated, so during the selection process I want add a filter for a specific string in the name.
The following code will select the hierarchy of joints below the selection and filter for the string "Tail". It works in a simple scene://Select hierarchy then Search/Print Joints w/specificed name
select -hi;
string $letters = "Tail";
ls -sl -type joint ("*"+$letters+"*");
But the string filter fails in the rig I'm working with. The reason for the failure has to do with the hierarchy of the scene, but I don't know how why.
When I list the joints, a ":" appears in the results, ie://Results
Rig_0:ct_Tail8_C Rig_0:ct_Tail9_C
Model_0:jt_Tail0_C Model_0:jt_Tail1_C...
But when I try to filter these results for the string "Tail", nothing is returned.
What I'd like to know is why does the ":" appear in the listing and how do I work around this?
Thanks.
