What is "Random By Node Handle" (VrayMultiSubTex) ?

Hi,

The question is in the title. I couldn’t find the proper explanation in Vray Help.

I would also like to ask how “Random by Name” works ? Does each name get different ID based on the number of slots in the texture?

Each node in 3ds Max is assigned a unique number (a handle) when it is created. This option generates the color index based on that node ID. It is useful because the node handle survives through scene editing - f.e. if you add/remove other objects, or rename them, you will still get the same colors.

Random by name generates a color index based on the name of the node that the texture is applied to. This allows the color to remain consistent if the object is merged into another scene, or X-Ref’d etc.

Best regards,
Vlado

Oh thanks for that tip vlado! I hadn’t considered the pitfalls of using random by handle if I had to split a file off for different passes for some reason and required consistancy of randomisation between files.

Thanks Vlado.
I have a question, for example I have vrayMultiSUbTex map which contains 6 different maps, “random by node”
So if I assign this on all objects on the scene, will all the objects get random distribution of the 6 maps?

And what if I choose “random by name” ? Will all these objects get randomly one of these maps again?

I still hope we can get “By User Defined Properties” at some point in the near future, could really use it.

- Neil

You can use the VRayUserColor texture for that?

Best regards,
Vlado

Afraid not. I don’t want to control colors, I want to assign max maps based on user definable properties. I think the VrayMultiSubTex just needs a “attribute name” text field and we should be all set.

- Neil

I was reading about “User Defined Properties” but it is still not clear to me and I don’t know how to use.
Do we assign a property by (for example) color:red or color: RGB value ?
Then if there is an VrayMultiSubTex with 4 different ID (red, blue,green, yellow), it will be assigned the red color?
How do we make it for textures?

I’m waiting for you guys to decide what you want :slight_smile:

There are two options:

*) The user attribute is expected to be a number, and it is used in place of the face material ID when choosing a sub-texture
*) The user attribute is just some string; V-Ray uses the hash of that string to randomly select a sub-texture

Which one makes most sense?

Best regards,
Vlado

:slight_smile:

Ok here is what I want:
I can make variations by giving object ID.
But lets say we have a composite map. I make one layer of textures varying based on object ID
I have another layer and I want these textures to vary as well but not based on Object ID. Otherwise layer1 and layer2 will be as couples for every object ID.
So for layer2, I want the textures varying on a different parameter.
I hope I was able to explain.

So that would mean the first option above? You can define a custom named user property with a number, which would be used in place of the object ID in the VRayMultiSubTex?

Best regards,
Vlado

How should I write that property? Can you write as example?

I would be very glad if you can also write an example string for option 2 as well.

That’s the one that makes the most sense to me.

Say I have 2 VrayMultiSubTex maps in a material, each with 5 submaps. One keys off the User Definable Property “RockColor”. One keys off the User Definable Property “RockBump”. Then on my object, in the user definable properties, I have RockColor=1 and RockBump=4. Then that object would get whatever’s in the 1st slot in the first VrayMultiSubTex and whatever’s in the 4th slot in the second VrayMultiSubTex.

- Neil

Now when I read the example, I understand the usage more clearly.
Sorry for my confusion, it was my mistake to think that this feature has already been implemented but now I realise that Vlado is asking us how we want.
Neil’s example simplifies things for me but still have some questions:

1. When you say: "keys off the User Definable Property ‘RockColor’ , will we put the ‘RockColor’ as the name of the map ?
And when we write under objectProperties/UserDefinedProperties RockColor=1, it will know to pick up map 1.
Right?

2. So for the VrayMultiSUbTex : Which one will we choose “get ID from” ?

3. I assume it will be possible to randomize RockColor=X with SoulburnScripts within a min and max value. Right?

Would this not be possible if we could assign a different seed to each vraymultisubtex?

To me, this makes the most sense for the modes in which the user does not control the value directly, e.g. RenderID, Node Name, Node Handle, Particle ID and Instance ID.

For Object ID and Face ID, it’s a bit counter-intuitive. Imagine assigning all your objects with IDs 1 and 2. If we offset this by a random value, they could get textures 5 and #11.

I can’t remember why I was thinking this would be a good idea, perhaps I was drunk, but it might be handy to be able to pipe a value (ie scalar) in to the seed value so you can actually control the seed on a per-object basis. It would extend the control over randomisation quite considerably. (I think I was trying to create a shader for randomising facade textures for a city and thought this would be the best way to achieve what I needed)

RockColor won’t be the name of the map, it will be the name the VrayMultiSUbTex uses in the UserDefinedProperties field inside the map.

yes.

it would get the ID from a new entry called UserDefinableProperties, which has an edit text box where you put the name of the property.

Yes. The advantage is this: If you use a pure random algorithm, it will work for a lot of situations, but in my experience, you assign random colors or whatever and then there’s 2 or 3 objects where you want to assign a specific value. So I move the randomization part to the values on the objects themselves using my scripts. And then when I want to assign a specific value, I can do so by just changing the value manually on those objects. Its a way to have both random values and specific values using the same system.

- Neil

Thanks for all the clear explanation. I totally agree about having randomization and flexibility of adjusting specific values is important.

Vlado, when will it be possible to have these new features - possible to have in nightly builds?