question

ulysse lefort avatar image
ulysse lefort asked

coloring splines according to their length

Hi there ! I got a Xparticles simple setup that generates a bunch of trails/splines and I wanted to know it was possible to export le splines/trails length to the arnold material in order to color each trails according to its length (ie using a gradient) ?

colorx-particlessplinestrails
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.

Lee Griggs avatar image
Lee Griggs answered

You might get something out of the color_mode in the utility shader. Maybe v_coord, barycentric and Object ID in combination with a color_correct to fine-tune it.


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

Sorry for the late reply. Use a state_float shader with the v variable.

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.

ulysse lefort avatar image
ulysse lefort answered

Hi ! thanks Peter for the answer ! this method to add gradient to splines works perfectly, so I'll keep it in mind ;)

however I didn't express my self clearly, I'm looking for a method to color each splines uniformly (not a ramp mapped along each ones) with one color picked from a gradient according to the length of each one

ie : I create a ramp from yellow to red and I want the shortest splines to be yellow and as they get longer they get closer to red (but one color per splines, not the gradient mapped over it)

is this possible with arnold (it's possible with cycle 4d but I prefer to keep everything in arnold ;) )

1 comment
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.

Gotcha. Don't think it's possible in the current build, but this would be a nice addition for a future release. Having a flag to export the length of each splines as a user data.
0 Likes 0 ·
ulysse lefort avatar image
ulysse lefort answered

Hi ! thanks for your answers ! i'll try that this afternoon !

about user data i was close to solution with xpresso (the spline node is actually able to compute a spline length, unfortunately if you give a flock of trails, which are considered segments of the same spline, you can only output one length at a time with a provided segment index, I didn't manage to export a matrix of indexed length)

anyway i'll play around with lee griggs suggestions ;) !

2 comments
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.

v_coords may work better.


1632301985916.png

1 Like 1 ·
1632301985916.png (337.2 KiB)
sounds great ! thanks !
1 Like 1 ·

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.