Notifications
Clear all

[Closed] Color changer?

I heard you can add custom attributes to materials. Do any of you know where I can find a tutorial about the power of this tool? I was wondering how I can change a color from “red” to “green” with a slider. How would you call the diffuse?

Thanks!
Jonathan

5 Replies

You can do it via the Parameter editor, but i’m not sure how you would set up the slider to go from red to green. That would be some nifty expression handling. Try just using the parameter editor first (the advanced rigging tutorial in max help is a good one to get the grip on it).

I’ve just tried it myself, and got as far as getting the slider into the material, but the expressions to control it may take a bit more research. If I get time, I’ll let you know!

 rdg

To get from red to green using a slider you can change the hue value of the color.

theColor=color 250 0 0
thecolor.hue=$Sphere01.hueValue
theColor

where $Sphere01 is a Object that has a customAttribute named hueValue.

Georg

That will work, but can you affect the diffuse channel of a material the same way?

 rdg

sI think so.
I tried this expression in a Point3-Script as diffuseColor.

I must admit that it reacted a little bit strange … it somehow clamped the colors.
It also depends on how you define the “baseColor” – as you can’t create a color only with hue, saturation and value, can you?

But this is likely due to my limited understanding. In another context – creating color swatches – this approach work really well.

Georg

can’t I do something like:

$Sphere01.diffuse = 255 0 0

then have an increment like

val1 = 255
val2 = 0
val3 = 0

then add 1 every time the slider moves with a loop then reassign it to the sphere?

Stabb in the dark.
Jon