Jump to content

How to randomization of material-textures?


samboosa

Recommended Posts

Hello!

If I have say 100 objects and want to randomly assign them a texture from a selection of 5, I would attach 5 UVquickshade nodes (with path to jpeg) to a switch and write an expression (very basic setup) to choose a random UVquickshade node from the available inputs.

I have written a python script/function so that a button can automatically duplicate the original quickshade node which is fed into the existing switch node - the problem is that the duplicates do not maintain their connection to the switch.

What would be a good way to add more available material-textures to the selection without having to create and delete the node manually? I basically want to be able to add and remove available textures from one interface (in combination with multiparm).

Any help would be greatly appreciated!

- Samboosa.

Edited by samboosa
Link to comment
Share on other sites

you can just override texture path per primitive with simple Attribute Create SOP

if you create string attribute with the same name as texture parameter on material, containing path to the texture, it will automatically override the parameter with per primitive value

no scripting necessary, just simple expression varying the path

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...