I've been trying to figure out a way to drive my aiSwitch index by ObjectID or some other procedural way of adding a few variations to randomly populate a scene.
I've tried to use an aiUserDataInt, but I'm not really sure what the formula for ObjectID is.
Any thoughts?
Solved! Go to Solution.
Solved by madsd. Go to Solution.
It's very easy, take a look at a construct I just made.
You use the range node to weight and control which of the index nodes gets introduced into the random shuffle, as well as probability.
I also recorded a video going through all the nodes, bare in mind this is 3ds max but you do the exact same thing in Maya, the UI is just a bit different, the outcome will be identical.
Link to Instuction video here:
https://www.dropbox.com/s/7treq9zfwkbyisi/2018-04-16%2007-37-17.mp4?dl=0
@Mads Drøschler Perfect! This is exactly what I was looking for.
Thank you Mads!
What are the purpose of using UserDataColor, since you can assign directly the color in aiSwitchRgba?
They only serve as example nodes in the video. You can plug anything in there you want. Bitmaps, procedurals, so the 5 nodes can be "whatever" ( leafs ) - with leafs you can also introduce the Jitter map and not only have 5 different types of leafs but also random saturation or hue, or anything else. You can also ignore the jitter node, and just use the Random exit point and pipe it to a new Range node and into a Color Correct nodes, Saturation/Hue/whatever - The range node in this case, will tighten the bandwidth up in dispersion of the random color tweak.
ah ok
I asked because I was expecting to see an attribute "mtoa_constant_..." for the objects with "UserData"
like feeding multi textures or driving multi bump map with only one shader to several objects.
anyway nice video, I really like your effort
Here is an expanded version, just copy the wires to Maya and you have, random saturation and random rotation in same setup along with random distribution.
All bound to the Random Seed, so pushing a new seed, randomizes all 3 parameters automaticly.
Thank you
But I misspoke or You did not understand me, because of my bad English, I already did that a year ago in FB.
what I'm trying to say is whenever UserData exist in the scene, must have the corresponding added attribute mtoa_constant_....
Hey Mads, thanks for the help! Here is my tutorial with your suggestion in action. Gave a shout out in the video 😄