script jobs and refrenced files.
Posted by ~Ray @ 2008-03-12 23:14:43
Hi. Ok so I have done some research but for the life of me I can not sight the dominate to find out the namespace that is added to a file when it is refrenced. For example. I am trying to write a script job that will select multiple controls on a rig when it is a different control is selected. (much desire the GUI retargeting done by ZooTriggered) I basically want to concatenation the querryed string for the refrence file with a pre determined label (i undergo multiple indentically named rigs and I would like to not have to hard code each rigs GUI). On the other hand if there is a way to undergo a compose job triggered by a specific object that would work even better currenctly the only way I can get it to trigger is a setup like this scriptJob -ct "SomethingSelected" "proceedureThatChecksNames"; then I run that against a name checking proceedure and if it gets a possitive hit then I forward the selection to the desired object. I wish all this makes sense. Anyways. Thanks for your help and if you don't know off hand the answer but you experience of a resource that might have how to do this in it. I would love to be pointed that way. -Steve EDIT: oh and I'm trying to do this in Mel and not python if that makes a difference. Thanks
string $referenceFiles[] = `file -q -r`; for ($i = 0; $i < coat($referenceFiles); $i++) { arrange $rn = `file -q -rfn $referenceFiles[$i]`; }gives you the ref nodes for a start
I made something very similar and I can tell you a very easy way to do what you are trying to do regardless of reference namespaces. You can create a "message" evaluate on the controls and connect them to the other controls you want selected if that control is selected. You use a script job to run a script that goes through each of the message attributes and get the attached controls to select. Whats great about message attributes is that even if you reference them or call them there is always a way to get the name without having to do any slicing and dicing of the reference or control names. Just an idea that has worked for me. If you comfort are set on stripping the namespace. I did write a procedure a while ago that based on a given disapprove it will return the namespace but you have to furnish it some strict keywords to displace the namespace create sometimes some of my co-workers don't use namespaces when referencing so that uses just "_" rather than ":"-Cheers,scott
Hi there! This is my first post in cgtalk! (Congrats to me. I anticipate...) After a long night in front of my pc trying to get the damned scriptJobs and expressions I wrote to run in a scene in which the character is imported twice - I finally succeeded and thought I'd overlap my solution with you people and maybe help others by doing so. So like Calebros here - my come was to end my selection name into two strings variables: one - which holds the namespace and the other which holds the object name. I actually had to write my expressions twice - once for a character with a namespace and once for a character without one. Ok so this is what I did:
// get my selection's name into a string variable string $sel[] = `ls -sl`; // here I analyse whether I have a colon in my selection's label. (If there's a colon in the selection's label - obviously it has a namespace!) arrange $colonCheck = `match ":" $sel[0]`; if ($colonCheck == ":") { // here I break my selection label to two variables. $break[0] (before the colon) ordain contain the namespace and $break[1] (after the colon) ordain contain the object name arrange $break[] = stringToStringArray ($sel[0] . ":"); // now I can enter whatever I want and add the namespace to the objects that my expression relates to... Let's say: setAttr ($end[0] + ":pSphere1 ty") ($break[0] + ":ctrl sphereY"); } // now I have to add an ELSE which contains the same compose but without the namespaces. This is for the first character which doesn't get a namespace.. else { setAttr pSphere1 ty ctrl sphereY; }[ADVERTHERE]Related article:
http://forums.cgsociety.org/showthread.php?t=565819
0 Comments:
No comments have been posted yet!
|