Color tracer by user data

Color tracer by user data

JHåland
Enthusiast Enthusiast
834 Views
9 Replies
Message 1 of 10

Color tracer by user data

JHåland
Enthusiast
Enthusiast

Hi! I came across a problem with the tracer object. I want to color the generated strokes by the parent matrix object.

The parent matrix is colored by a shader effector.

I've tried "curve_id", but seem to only color every trace with one color.

Is there other "id" that can fetch "user data" from the matrix object?

 

- Jørgen

0 Likes
835 Views
9 Replies
Replies (9)
Message 2 of 10

peter_horvath
Autodesk
Autodesk

Can you show your setup? If I understand correctly, you want to color the traces based on the Shader effector of the Matrix object, is that right? Don't think that's going to work, because the spline generated by the Tracer is missing the color information.


// Peter Horvath
// C4DtoA developer
0 Likes
Message 3 of 10

JHåland
Enthusiast
Enthusiast
hmm. I see that there are curve color in Redshift, picks the index, and hoped there something similar in Arnold.
0 Likes
Message 4 of 10

JHåland
Enthusiast
Enthusiast
I can share link to the setup. I guess I move the files in one or two days 🙂

https://www.dropbox.com/sh/q7g72zp7izyjjyx/AAAE-M6wRxVpDGPc35iGKL59a?dl=0
0 Likes
Message 5 of 10

peter_horvath
Autodesk
Autodesk

Does the RSCurveIDColor attribute return the color from the Matrix object? Because the documentation says it returns a random color:

The RSCurveIDColor attribute will create a random color value for each strand. 

You can generate a random color per strand using the curve_id user data and a random shader. But the color of a parent object is not translated to the Tracer curves currently.


// Peter Horvath
// C4DtoA developer
0 Likes
Message 6 of 10

JHåland
Enthusiast
Enthusiast
yes, that adds random color, so sounds about the same. So not picking up color form thee matrix
0 Likes
Message 7 of 10

peter_horvath
Autodesk
Autodesk
Alright, I think it's a limitation in Cinema 4D, since the generated splines does not have any color information or any connection to the parent object. You can try xptrails which has a color channel.

// Peter Horvath
// C4DtoA developer
0 Likes
Message 8 of 10

JHåland
Enthusiast
Enthusiast
hmm, don't seem to get random strands. I have added the arnold tag with export ids, and use user data rgb, and attribute color_id and connect that to a random node. Don't seem to pickup the color_id
0 Likes
Message 9 of 10

peter_horvath
Autodesk
Autodesk

The parameter is called curve_id and load it via a user_data_int shader. Connect it to the integer input of the random shader.


// Peter Horvath
// C4DtoA developer
0 Likes
Message 10 of 10

JHåland
Enthusiast
Enthusiast
aha, that works! now I have the index of all the tracer strokes. thanks 🙂 Now I just need to colorize them by the matrix object. hmm. thanks for your help so far 🙂
0 Likes