question

Francisco Cunha avatar image
Francisco Cunha asked ·

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

c4dtoa
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Ipiv I avatar image
Ipiv I answered ·

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

1 comment Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

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

0 Likes 0 · ·
Peter Horvath avatar image
Peter Horvath answered ·

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.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Peter Horvath avatar image
Peter Horvath answered ·

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.


teste-1-v02.zip (138.0 KiB)
Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Peter Horvath avatar image
Peter Horvath answered ·

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.

4 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

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

0 Likes 0 · ·

here is my shader network

0 Likes 0 · ·

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.

0 Likes 0 · ·

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


0 Likes 0 · ·
Francisco Cunha avatar image
Francisco Cunha answered ·

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


teste-1c4d.zip (111.2 KiB)
Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Peter Horvath avatar image
Peter Horvath answered ·

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?

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.