Jump to content
Sign in to follow this  
artzor

random texture assignment

Recommended Posts

hi guys,

i'm doing a little project for a friend and need some help...

i want to scatter points on a surface and then use a copy sop to get a bunch of random planes, and i want them to have different textures

so i'm thinking somehow getting rand($PT) from the scattered points into the material to drive a switch operator which just has different textures coming into it...

but i can't get it to work :(

thanks!

Share this post


Link to post
Share on other sites

thanks AndrewVK, but i do really want to learn how to do this myself :)

-edit -

haha, figured it out, you can just stamp a rand($PT)

and then in a material operater add a local overide with the stamp as an integer value...

houdini is niiiiicccceee!!!

Edited by artzor

Share this post


Link to post
Share on other sites

"Local Overrides" from "Material Sop" may help

Assign material...

Add "Local Override"...

Select any parameter (texture name in your case)...

Replace texture name with an expression

Share this post


Link to post
Share on other sites

working great :)

which leads me to the next challenge, how this applies to instanced points instead of scattered points...???

Share this post


Link to post
Share on other sites
working great :)

which leads me to the next challenge, how this applies to instanced points instead of scattered points...???

Turn on "Use Template Point Attribute" (Copy Sop -> Attribute Tab )

Put this string: shop_materialpath material_override

to "To Primitive" field

Share this post


Link to post
Share on other sites

thanks again AndrewVK :)

my last question on this subject, my shader setup is quite tedious now...

i've stamped a rand($PT) and put that through to local overides in the material op.

then i'm using the local overide parameter to flip a switch node which has lots of strings(images) going into it...

is there a way to get the local overide parameter into one string,

so if i have images 0.jpg, 1.jpg 2.jpg etc i can just go images\`switcher`.jpg

make sense?

edit : it works with paramters like `$F` in the string name but i can't seem to get the value from the local overide (which came from copy stamping)

Edited by artzor

Share this post


Link to post
Share on other sites

Not sure if it is possible without scripting...

I have had the same problem few month ago :wacko:

I wrote "ShowAmAll" especially for this kind of tasks...

Share this post


Link to post
Share on other sites

Not sure if this is the sort of thing you're looking for?

Whoa! simplest and quickest !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×