Jump to content

Randomise Light Hue Colour [SOLVED]

Recommended Posts

How can I randomise the hue of a light colour?

So far I have tried using the Motion FX Noise, but the problem here is the RGB values go above 1, making the light too colour bright.

I tried another example where I coloured a sphere red, then used a Point VOP with a Colour Correct node, then Motion FX to randomise the hue of the initial set red colour.
This way works best, because it is truly randomising the red hue from it's initial set red colour and the rgb values do not go above 1.

My problem here is I don't know how to get those @Cd colour values onto the light itself. Can I type vex expressions into the RGB values of a light to grab the @Cd from another object?

HIP File attached of where I am at.



Edited by GlennimusPrime

Share this post

Link to post
Share on other sites


Is this what you meant?
I took the Cd values and placed it in the light color.

Because the color attribute is stored in points. And all the points have the same Cd info.
I used these expressions to send it to light:
point("../Random_Hue_Colour_Generator", 0, Cd, 0)
I will break it down if you don't get what's happening.
point() < get value from a specific attribute and from a specific point.
1. is from which node it should receive the info
2. point number
3. attribute name
4. index, in this case, XYZ, 0 = X, 1 = Y, 2 = Z

This is the color stored in Random_Hue_Colour_Generator.                 This is the color value stored in Light.
image.png.6ca453bca2992c15c3dc68b9e536e30e.png                                  image.png.75aaf13b37df4df2f8a3438a96ec0966.png 

Edited by laurups

Share this post

Link to post
Share on other sites

Hi laurups, thanks so much for this!

I had used a similar expression once before to lock an object to a specific point on another object. I forgot this can be used to access all the different point attributes too.

Thank you for this, and the clear explanation!

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now