Register Latest Topics
 
 
 


Reply
  Author   Comment   Page 1 of 2      1   2   Next
ltethe

Asking for seconds
Registered:
Posts: 26
Reply with quote  #1 
Is there an example scene where I can plug different shaders into the copier node for each object instanced/copied?

Simple problem. 3 objects, all with different shaders, I want them to exhibit those shaders after they're copied via the copier node.

I tried taking a look at the copier materialOverride example, but it's using one object as opposed to several, and when I try and recreate the network, the instanceObjectGroup won't hook into the surfaceShader dagSetMembers.  Gives me a syntax error every time. Further whenever I try and interface with the output mesh in the node editor, it hard crashes my machine, making analyzing this scene file difficult.

0
plars

Node Bending
Registered:
Posts: 254
Reply with quote  #2 
That materialOverride scene first has vertex colors set on the objects being copied. Then using those vertex values to choose one of the colors to use(with a ramp). The instObjectGroup should be connected when you assign the final shader to the Copier out geo. Here's a scene doing that with MR and 4 objects. ma copier_vtxColor2shader.ma     


0
pshipkov

SOuP Jedi
Registered:
Posts: 4,702
Reply with quote  #3 
Yep, you have to do a bit of prep-work before piping stuff to the copier. This way Maya takes care of object groups and stuff. Otherwise you have to do it all of that by yourself.

This example scene is actually very important, since it works around one of the biggest limitations in Maya - the rigidity of its shading engine. Using this or similar setup we can finally associate arbitrary shaders to instanced geometry by manipulating attributes during the copy-stamping process on the fly.

You may want to run this command in your scene: setAttr "ramp1.colorEntryList[2].position" 0.75;
I tweaked the original one and will update the scenes archive later on.
0
ltethe

Asking for seconds
Registered:
Posts: 26
Reply with quote  #4 
plars, you're a life saver again.

Example was succinct and allowed for me to dick around with it till comprehension came. Like I said, I don't know why but the one in the Soup example scene file hard crashed my comp anytime I touched the output polysurface node in the node editor, so your scene was key.
0
ourouk

Wanting the recipes
Registered:
Posts: 178
Reply with quote  #5 
Hello All,

Peter, plars, what about the same "shader trick" for renderman ? :)
( push the shader of the different instances in the output mesh )

thx
0
pshipkov

SOuP Jedi
Registered:
Posts: 4,702
Reply with quote  #6 
I don't have prman here, but i am pretty sure that mtor conforms to the same base line rules in Maya.
Give it a try and let us know.
0
plars

Node Bending
Registered:
Posts: 254
Reply with quote  #7 
I gave it a try using rmanPrimVarColor with the Copier's originalColor color set. And it seems to work fine with the ramp.
0
pshipkov

SOuP Jedi
Registered:
Posts: 4,702
Reply with quote  #8 
good news !
0
ourouk

Wanting the recipes
Registered:
Posts: 178
Reply with quote  #9 
Good news !

Plars could you send me a sample file so I can check the network please ?
Couldn't achieve it for now :/
0
plars

Node Bending
Registered:
Posts: 254
Reply with quote  #10 
Here's a scene with that. ( ma copier_vtxColor2shader_rman.ma      )
0
ourouk

Wanting the recipes
Registered:
Posts: 178
Reply with quote  #11 
Yes I tried on this scene on my side but in fact with my configuration ( maya 2015 / rman reyes ), the mesh do not render "white/grey/black" but "dark red/black" ( like the colors of the ramp )

Can't understand the problem :(

copier_vtxColor2shader_rman.png 

0
RacoonBear

Help ! I must learn SoUP
Registered:
Posts: 179
Reply with quote  #12 
You'll have to dive into the Renderman docs, you could also do what you want with Mental Ray and there is a production shader, I've been spending alot of time understanding Mental Ray. Most use vRay because it's easier, compared to Mental Ray and Renderman.
0
plars

Node Bending
Registered:
Posts: 254
Reply with quote  #13 
Oh I see. When the scene is first opened, the ramp has some kind of problem. Adjusting it or connecting single color ramps to each entry seems to fix it for me.
0
ourouk

Wanting the recipes
Registered:
Posts: 178
Reply with quote  #14 
RacoonBear : Thanks Racoon but in fact my pov was more "fx" ( scattering objects and push shader to copier node ), I don't plane to dive into renderman docs, it freaks me out too much :p

Plars : Yes, that's just a ramp bug...it works after some clicks :)
thanks
0
pechart

Wanting the recipes
Registered:
Posts: 230
Reply with quote  #15 
Has anyone set this up for vray? The example scene (copier_materialOverride.ma) doesn't work for me in Maya 2016. When I render with mentalray I get:

// Warning: line 1: (Mayatomr.Scene) : polySurfaceShape2: empty or corrupted UV set map1 detected, ignored

And the image is black. So I can't reconstruct the setup. Any help would be greatly appreciated, because my alternative is setting up several identical copiers. And that would be terribly slow. Thanks!

EDIT: I think I'm pretty close. Maybe someone wants to take a look at the attached scene.

 
Attached Files
mb copier_materialOverride_VRAY.mb (208.69 KB, 5 views)

0
Previous Topic | Next Topic
Print
Reply

Quick Navigation: