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: 

Assigning different colors to mograph object based on index of clone

11 REPLIES 11
Reply
Message 1 of 12
helloVPV7X
1676 Views, 11 Replies

Assigning different colors to mograph object based on index of clone

Hello, is it possible to assign different colors/textures to a linear cloner based on the index of the clone in an orderly fashion?
I've been trying to use "user_data_int" with the option "index" connected to a "switch_rgba" to define the colors, but the cloner assumes just the second color in the "switch_rgba". Am I missing something here? a node or a mograph effector? I've tried the "step effector" but no luck.

Thank you.

FC

Tags (1)
Labels (1)
11 REPLIES 11
Message 2 of 12

Basically you have two options. One is to generate the display color of the clones inside Cinema 4D (e.g. via effectors) and read that color with the user_data_rgb shader.

The other option is to read the index with the user_data_int shader as you described. It seems to be working fine in my simple test. Could you please send me a scene if it does not work for you?

Message 3 of 12
helloVPV7X
in reply to: helloVPV7X

sure... here it goesteste 1.c4d.zip

Message 4 of 12

The index does not work in this situation because the Cloner is inside a Boole object. The Boole has two objects, Metaball and Null, everything under the Null is exported with index 1.

I can take a look, but I'm not sure it will be easy to support this case. If you can make it work with the Display Color that would be great.

Message 5 of 12

Well, I´ve placed the cloner out of everything else and doesn´t work either

Message 6 of 12
helloVPV7X
in reply to: helloVPV7X

here is my shader network 5668-captura-de-ecra-2020-01-15-as-174604.png

Message 7 of 12

Place the Cloner out of the Boole and turn the Cube to a polygon object, then it will work. There seems to be a problem with the Cube object, as it is exported as an object generator, just like the Cloner, so it's kinda the same issue as with the Boole -> Cloner: object generator hierarchy is not managed properly.

Message 8 of 12

thank you Peter. It's not the perfect solution but I'll try to work around it. Thanks again.


Message 9 of 12

Here's a modified version of your scene using a Step effector and the Display Color.

teste 1 v02.zip

The tricky bit is that C4D splits the color in sRGB color space, while Arnold uses linear color space, so you need a gamma correction. Then multiply by the number of clones and round to get the index.

Hope it helps.

Message 10 of 12

I added a fix to the latest release, C4DtoA 3.0.1.2, which makes your scene work when cloning a polygon object. Unfortunately the indexes are not set properly when cloning a primitive object (e.g. Cube, Sphere, etc) which is under a Boole or Subdivision Surface. This is a limitation in Cinema 4D, confirmed by Maxon.

Message 11 of 12
hello.ipiv
in reply to: helloVPV7X

GPU mode and clone indexing issue:

In a case where rendering mode is set to GPU and using Mograph cloner to clone Arnold Volumes there seems to be an issue with clone indexing - Object IDs and Clone indexes are all resolving to 0/default value.

The issue above does not appear when switching to CPU mode.


Edit: Utility node set to Object mode or User data node with attribute set to index are outputting different IDs to clones but there doesn't seem to be a way to utilize that output. It looks like the output gets reset to 0 whenever it is outputting to any port on Standard volume node

Message 12 of 12

Thanks for reporting. Seems to be a bug with user_data shaders and volumes on the GPU. We're looking into it.

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

Post to forums  

Autodesk Design & Make Report