script jobs and refrenced files.
Posted by ~Ray @ 2008-03-12 23:14:43
Hi. Ok so I have done some investigate but for the life of me I can not sight the command to find out the namespace that is added to a file when it is refrenced. For example. I am trying to create verbally a compose 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 be 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 script job triggered by a specific disapprove that would work change surface exceed currenctly the only way I can get it to initiate 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 hope 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 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
arrange $referenceFiles[] = `file -q -r`; for ($i = 0; $i < coat($referenceFiles); $i++) { string $rn = `file -q -rfn $referenceFiles[$i]`; }gives you the ref nodes for a start
I made something very similar and I can express you a very easy way to do what you are trying to do regardless of reference namespaces. You can create a "message" attribute 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 compose that goes through each of the message 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 control names. Just an idea that has worked for me. If you still are set on stripping the namespace. I did create verbally a procedure a while ago that based on a given disapprove it ordain return the namespace but you undergo 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 character 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 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 string $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!) string $colonCheck = `be ":" $sel[0]`; if ($colonCheck == ":") { // here I break my selection name to two variables. $break[0] (before the colon) will contain the namespace and $break[1] (after the colon) will include the object name string $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 ($break[0] + ":pSphere1 ty") ($break[0] + ":ctrl sphereY"); } // now I undergo 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!
|