Announcements

We are currently experiencing an issue impacting some Autodesk Products and Services - please refer to the Autodesk Health Dashboard for updates.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

randomly assign colors per object from a custom color palette

randomly assign colors per object from a custom color palette

Hi,

 

The Arnold Color Jitter node is helpful, but ultimately, randomizing value, hue, saturation doesn't give aesthetically pleasing results. Randomizing hue, in particular, looks awful. There's no way to get harmonious colors. It all ends up looking like harsh RGB hue noise.

What I would love to see is an easy way to randomly map a palette of custom colors onto objects. Kind of like how we can remap texture colors with a gradient ramp using the Source Map input.

 

Thanks,

 

Aaron

12 Comments
Status changed to: Future Consideration

Interesting idea @aaronfross, thanks for your contribution.

electrotoast_old
Community Manager
Status changed to: Accepted
 
masterzap
Enthusiast

As of today you will be able to do this with the OSL "1-of-10 (color)". If you need more than 10 the shaders can be cascaded.

 

/Z

electrotoast_old
Community Manager
Status changed to: Implemented

This is Implemented as part of OSL integration in 3ds Max 2019. Thanks for the Idea!

aaronfross
Collaborator

Thanks guys, for some reason I didn't get notification when you posted replies.

 

OSL is fantastic.

onitreb
Enthusiast

Where does the randomization part come in?

 

The OSL is a list of colors or maps that you can choose explicitly.

 

The OP asked for a way to randomly assign the colors. Am I missing something?

electrotoast_old
Community Manager

@aaronfross Were you able to use the OSL implementation as described? Maybe you have a tutorial on it already?

onitreb
Enthusiast
 

This is the OSL (the "1 of 5" version). How can this be used to randomly assign these colors to objects (or elements)?

 

OSL_color-1-5_screengrab.jpg

aaronfross
Collaborator

Hey guys,

 

I do have a tutorial for this, I've unlocked it on LinkedIn Learning. The key is you need to use the Random Index and Node Handle maps to generate random numbers from object scene identifier numbers ("node handles"). 


https://www.linkedin.com/learning/embed/3ds-max-tips-tricks-and-techniques-2/shading-per-object-with...

onitreb
Enthusiast

Thank you very much. Terrific tutorial.

 

I'm curious if anyone has an idea how this could work on an element level? Specifically using the scatter modifier, which produces a single object built of individual elements.

 

Thanks!

 

 

onitreb
Enthusiast

I think I answered my own question. It's the OSL "MaterialID" node.

 

Here is the slate editor layout, for a quick reference. But definitely check out Aaron's tutorial.

 

OSL_randomElemntColor.jpg

onitreb
Enthusiast

Me again. 😛

 

I've assigned this to a scatter object with a MaterialByElement modifier and I'm not seeing the output (namely the random part) of this in the viewport. I see the correct colors in activeshade. 

 

Is there any workaround for this? Is viewport visibility likely to be implemented in the future?

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea