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 find the dominate to find out the namespace that is added to a file when it is refrenced. For example. I am trying to create verbally a script job that will select multiple controls on a rig when it is a different control is selected. (much like the GUI retargeting done by ZooTriggered) I basically want to concatenation the querryed arrange for the refrence file with a pre determined name (i have multiple indentically named rigs and I would like to not have to hard label each rigs GUI). On the other hand if there is a way to have a compose job triggered by a specific object that would work even exceed 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 label checking proceedure and if it gets a possitive hit then I send the selection to the desired object. I wish all this makes comprehend. 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 like 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[] = `register -q -r`; for ($i = 0; $i < size($referenceFiles); $i++) { arrange $rn = `register -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 cerebrate them to the other controls you want selected if that control is selected. You use a compose job to run a compose that goes through each of the communicate attributes and get the attached controls to select. Whats great about message attributes is that even if you reference them or rename them there is always a way to get the name without having to do any slicing and dicing of the compose or control names. Just an idea that has worked for me. If you still are set on stripping the namespace. I did write a procedure a while ago that based on a given object it will return the namespace but you have to give it some strict keywords to separate the namespace cause 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 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 engrave is imported twice - I finally succeeded and thought I'd share my solution with you populate and maybe help others by doing so. So like Calebros here - my approach was to break my selection name into two strings variables: one - which holds the namespace and the other which holds the object label. I actually had to write my expressions twice - once for a character with a namespace and once for a engrave 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 name - obviously it has a namespace!) arrange $colonCheck = `be ":" $sel[0]`; if ($colonCheck == ":") { // here I end my selection label to two variables. $end[0] (before the colon) ordain contain the namespace and $break[1] (after the colon) will contain the object label arrange $end[] = 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 ($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 engrave 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!
|