isoparmB
02-13-2007, 11:15 AM
Wouldn't it be great if expressions knew their own names? I feel like I'm trying to do something that appears to be undoable.
I have a master file which has an expression. This expression is supposed to switch connections between shaders on a specified shading group. I want to reference this file multiple times into a scene, and have the controller of one reference just alter the connections on that reference alone.
Problem is the existing workaround for mel commands in an expression in regards to naming, namespaces and such, which is to query the existance of a uniquely named node, dosen't work in this scenario because every one of these references will have the unique node. I want the references to be from the same file, but for each reference's own expressions to only access the contents of their own reference.
I can pretty much do this globally, say have a script that can switch all of the shaders of each instance change, but I want to individually control instances using an expression (as it seems the logical medium for setting up a conditional switch for a connectAttr command) tied to a controller. I'm aware that expressions are limited to renaming only those attributes which are directly connected to them at the node level, but it would just be so simple if expressions had something like a default variable that identified itself within itself. That way, you could associate it with a particular reference.
I guess my question is, it there any way, from within an expression, to at least query the connections of that expression's plugs so as to at least have a starting point of getting a name that I can parse?
I have a master file which has an expression. This expression is supposed to switch connections between shaders on a specified shading group. I want to reference this file multiple times into a scene, and have the controller of one reference just alter the connections on that reference alone.
Problem is the existing workaround for mel commands in an expression in regards to naming, namespaces and such, which is to query the existance of a uniquely named node, dosen't work in this scenario because every one of these references will have the unique node. I want the references to be from the same file, but for each reference's own expressions to only access the contents of their own reference.
I can pretty much do this globally, say have a script that can switch all of the shaders of each instance change, but I want to individually control instances using an expression (as it seems the logical medium for setting up a conditional switch for a connectAttr command) tied to a controller. I'm aware that expressions are limited to renaming only those attributes which are directly connected to them at the node level, but it would just be so simple if expressions had something like a default variable that identified itself within itself. That way, you could associate it with a particular reference.
I guess my question is, it there any way, from within an expression, to at least query the connections of that expression's plugs so as to at least have a starting point of getting a name that I can parse?
