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
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?
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.
Well, I´ve placed the cloner out of everything else and doesn´t work either
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.
thank you Peter. It's not the perfect solution but I'll try to work around it. Thanks again.
Here's a modified version of your scene using a Step effector and the Display Color.
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.
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.
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
Thanks for reporting. Seems to be a bug with user_data shaders and volumes on the GPU. We're looking into it.