PDA

View Full Version : determining the type of connection between texture and shader?


cgbeige
12-01-2012, 06:07 PM
I'm updating a gamma correct loop for V-Ray shaders and I need to make a separate loop for .outAlpha, .outColor and .output connections to the shader. I plan to tokenize this to determine that connection but the problem is that I can't get one value for the connection for a given texture:

listConnections -p true -d 1 -s 0 $mySelection[$n];
// Result: ramp_materialInfo1.texture[0] defaultTextureList1.textures[51] ramp_VRayMtl1.color //


I only want the last one, so is there another way to determine exactly what's connected between the shader and that subtexture?

NaughtyNathan
12-02-2012, 11:26 AM
Hey Dave, I'm not 100% sure I've understood what you want, or what your scenario is, but am I right in thinking $mySelection[$n] is a file node and you want to get it's .color connection only?

if so, when you use the listConnections command you should be able to specify the actual attribute too to narrow down your results to just that specifically. so, instead of doing:
listConnctions -p true -d 1 -s 0 filenode1;
// Result: materialInfo1.texture[0] defaultTextureList1.textures[1] shader.color
You can do:listConnctions -p true -d 1 -s 0 filenode1.outColor;
// Result: shader.color

cgbeige
12-02-2012, 06:00 PM
sorry, I should have worded it better. I ended up figuring it out because I was going about it the complete backwards way. I should have queried the connections from the V-Ray mat channel, not the subtexture.
thanks again, though.

CGTalk Moderation
12-02-2012, 06:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.