Script to connect all mia_materials in a Scene with Colorbuffers

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
Prev Previous Post   Next Post Next
  10 October 2011
Script to connect all mia_materials in a Scene with Colorbuffers

Hello everyone,

yesterday i looked for scripts wich can create 21 Custom Color Buffers, name them (add_result, refl_level, refr_level...) and connect them to WriteToColor Nodes.

Because i didn't find any i tried it on my own. I'm not a coder and don't have any experiences with mel, but i could realize this first step by recording/and copying the commands.

The next and maybe more difficult step would be, to connect all Materials in the scene (type Mia_material_x_passes) or at least named like this "Mia_material" with the right colorbuffers.

So that i can use a lot of Mia_Material_x_passes in my scene, after that scan the entire scene for them and connect for example "indirect_raw" to the colorbuffer "Indirect_raw_buffer" for all of them.

The recorded command is:
connectAttr -f mia_material_x_passes3.indirect_raw indirect_raw_buffer.color;
connectAttr -f mia_material_x_passes3.indirect_raw indirect_raw_buffer.evaluationPassThrough;

But of course it only works for the material named "mia_material_x_passes3".

And that is what i'm trying to achieve.

select -r "mia_material*";
string $miaNode[] = `ls -selection`;

connectAttr -f $miaNode.indirect_raw indirect_raw_buffer.color;
connectAttr -f $miaNode_x_passes3.indirect_raw indirect_raw_buffer.evaluationPassThrough;

Of course it's not that easy :-/
Today i found a great (closed) thread with the same topic but with an different approach.

I think my problem could be, that i only have this one variable ($miaNode) right now??

I would be really happy, if you can show me how to solve this problem.

Thank you!
Best wishes
3D Artist - Generalist and Lighting TD
  share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 10:22 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.