script jobs and refrenced files.
Posted by ~Ray @ 2008-03-12 23:14:43
Hi. Ok so I undergo done some research but for the life of me I can not find 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 compose job that ordain decide 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 register with a pre determined label (i have 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 disapprove that would work even better currenctly the only way I can get it to trigger is a setup desire 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 back up and if you don't experience off hand the answer but you know 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
arrange $referenceFiles[] = `file -q -r`; for ($i = 0; $i < size($referenceFiles); $i++) { arrange $rn = `register -q -rfn $referenceFiles[$i]`; }gives you the ref nodes for a go away
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 "communicate" evaluate on the controls and connect them to the other controls you be selected if that control is selected. You use a script job to run a script that goes through each of the communicate attributes and get the attached controls to decide. 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 hold back names. Just an idea that has worked for me. If you comfort are set on stripping the namespace. I did create verbally a procedure a while ago that based on a given disapprove it will return the namespace but you have to give it some strict keywords to separate 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 affix in cgtalk! (Congrats to me. I guess...) 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 share my solution with you people and maybe back up others by doing so. So like Calebros here - my approach was to break my selection label into two strings variables: one - which holds the namespace and the other which holds the object name. I actually had to create verbally 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 arrange $sel[] = `ls -sl`; // here I check whether I have a colon in my selection's name. (If there's a colon in the selection's label - obviously it has a namespace!) string $colonCheck = `match ":" $sel[0]`; if ($colonCheck == ":") { // here I break my selection label to two variables. $break[0] (before the colon) will contain the namespace and $break[1] (after the colon) will include the object name arrange $end[] = stringToStringArray ($sel[0] . ":"); // now I can register whatever I be and add the namespace to the objects that my expression relates to... Let's say: setAttr ($break[0] + ":pSphere1 ty") ($break[0] + ":ctrl sphereY"); } // now I have to add an ELSE which contains the same script 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!
|