[renderpassesformaya] renderpasses fails on connectAttr -f warning

  • From: matt estela <matt@xxxxxxxxxx>
  • To: renderpassesformaya@xxxxxxxxxxxxx
  • Date: Tue, 8 Feb 2005 14:25:59 -0800 (PST)

Heya,

I have several shapes that share a blinn material, and I want to create a 
shadow pass. The current connection goes

blinn1.outColor -> blinn1SG.surfaceShader

I create a useBackground material, and twiddle the connections so its now

useBackground1.outColor -> blinn1SG.surfaceShader;

This works fine when I do it by hand, so I converted that into my 
override/revert code like:


// override
connectAttr -f useBackground1.outColor blinn1SG.surfaceShader;
// revert
connectAttr -f blinn1.outColor blinn1SG.surfaceShader;


If the blinn is already connected, maya spits back the warning

Warning: 'blinn1.outColor' is already connected to 'blinn1SG.surfaceShader'

Which makes sense, however the renderpass plugin reads this as an error, 
and doesn't continue. I could wrap this all in a test to see whats already 
connected before trying to force the connection, but thats a little messy.

Is there a cleaner way of doing this, apart from the slightly 
tempremental and not what I need assignSG command?


Cheers,

-matt

Other related posts: