Community
Arnold for Cinema 4D Forum
Rendering with Arnold in CINEMA 4D using the C4DtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select object by shader and override it with Operator

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
edenexposito
298 Views, 3 Replies

Select object by shader and override it with Operator

Hello!

I have 3 Arnold Shaders called : red, green, blue.

I'm testing operators and trying to find any object with "blue" shader applied and replace with a "green" shader. But not seems works, maybe I don't write correctly expression:


*.(shader == "blue")


I attach a screenshot.

5096-arnold-operator-network-editor.jpg

What I'm doing wrong here?


Maybe with something like that in selection:


/*.(@node == 'polymesh' and shader == 'blue|standard_surface')


But no luck.


Thanks!

Tags (1)
Labels (1)
3 REPLIES 3
Message 2 of 4

You have to test a parameter value.

*.(@node == 'polymesh' and shader.name == 'Red')

polymesh.shader is a link to a shader node

and

a shader node has a name parameter



// Stephen Blair
// Arnold Renderer Support
Message 3 of 4

Exactly what Stephen said. Also note that the name of an Arnold shader exported from C4D has the following format:

/[material_name]|[shader_name]

Spaces and other special characters are replaced with '_'.

So assuming you have an Arnold Material named 'blue' with a standard_surface shader as the root using the default name 'standard_surface' you have to write:

*.(@node == 'polymesh' and shader.name == '/blue|standard_surface')
Message 4 of 4

Works like a charm! thank you again!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report