Jump to content

Colour ramping - expressions beginner


Recommended Posts

Hi all,

First of all - sorry for the basic question! (rest assured I've read the help sections for all the relative nodes I'm working with here, I just can't get expressions at the moment!)

Was wondering if someone could help me out with a pretty basic expression that I'd like to use.

I have a cache'd particle sim that I'm loading in, and for a specific group of points, I want to ramp the colour from a > b over the each individual points Y position (TY)

(The cache includes the particle ID's)

I'm sure there's a fairly simple expression that will achieve this, but I'm completely flummoxed by it.

I'd greatly appreciate any help!

cheers,

Tomwyn.

Link to comment
Share on other sites

If you're in SOP level, append a point SOP, change the color mode do "add colour" and plug the following expression on any of the color components:

fit($TY/($YMAX-$YMIN), -.5, .5, 0, 1)

You can later reference the modified component on the other two.

cheers

Link to comment
Share on other sites

I just figured this might be a bit counter-intuitive... you could either replace the last two parameters in the fit expression by the desired colors' components.

Although I'm sure the task at hand would be much more easily implemented by a VOP SOP.

Link to comment
Share on other sites

If you're in SOP level, append a point SOP, change the color mode do "add colour" and plug the following expression on any of the color components:

fit($TY/($YMAX-$YMIN), -.5, .5, 0, 1)

You can later reference the modified component on the other two.

cheers

I think the question was about querying bounding info of a specific point group from incoming geometry.

Link to comment
Share on other sites

Hi guys,

Thanks for the example file rafaelfs, works exactly how I wanted. Now just need to figure out the correct values to control colour A & colour B! ;)

vectorblur, you're right as I wanted to isolate a group to effect colour on, but I have done this before adding colour using a delete SOP, and the expression values in the point SOP further down the network isolates ramps from A > B from the groups first > last points, so it seems fine! :)

Thanks again for the feedback, much appreciated!

t.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...