How to randomise the colors on a Ramp node?

   923   10   1
User Avatar
Member
6 posts
Joined: Sept. 2023
Offline
So I'm working on a tool to randomly generate and texture assets all within the same Houdini file. So far I've been using the frame number as a random seed, with rand($F), so I can quickly iterate through different seeds. This has been fine for mesh generation, and for generating flat colours for meshes, but I have a positional gradient created by feeding the Y position through a Ramp Parameter node, and when I try to use the same expression for the colours within the gradient, I get an "Cannot have channels which depend on time." error. Is there a good way to make the ramp colours randomise with the frame number, or do I need to switch to a different randomisation system?
This is my first project in Houdini, so apologies if I'm overlooking something obvious! Thanks!
User Avatar
Member
2051 posts
Joined: Sept. 2015
Offline
Generally you should be able to do what you want with a ramp parameter,
but since you haven't provided a hip file we can't see the context/setup you are applying the ramp parameter in.
User Avatar
Member
7882 posts
Joined: Sept. 2011
Offline
If you hit 'u' to go up a level, do you see your ramp again on the parent node's parameters? If so, this is where you want to animate.
User Avatar
Member
6 posts
Joined: Sept. 2023
Offline
jsmack
If you hit 'u' to go up a level, do you see your ramp again on the parent node's parameters? If so, this is where you want to animate.
BabaJ
Generally you should be able to do what you want with a ramp parameter,
but since you haven't provided a hip file we can't see the context/setup you are applying the ramp parameter in.
For context - this is taking place directly within the /mat network, so there isn't any level above it. hip file is a bit of a mess rn but hopefully the screenshot helps.
User Avatar
Member
7882 posts
Joined: Sept. 2011
Offline
WanderingOwl
For context - this is taking place directly within the /mat network, so there isn't any level above it. hip file is a bit of a mess rn but hopefully the screenshot helps.

There is a level above that is implied, but doesn't exist until render time. Unfortunately, that means you can't animate it. You can create that level above explicitly by creating a material builder node and creating the material inside. This will allow parameters to properly instantiate on a parent level for interaction and animation.
User Avatar
Member
6 posts
Joined: Sept. 2023
Offline
jsmack
There is a level above that is implied, but doesn't exist until render time. Unfortunately, that means you can't animate it. You can create that level above explicitly by creating a material builder node and creating the material inside. This will allow parameters to properly instantiate on a parent level for interaction and animation.

That's great, thank you so much! Can I double check what kind of material builder you're referring to - I get options for Karma, VEX, USD and USD Preview when searching it up. Anything special I need to do to add this material to my model, also? I feel like I'm missing something since the click-and-drag and material node methods aren't working with the ones I've tried so far.
User Avatar
Member
7882 posts
Joined: Sept. 2011
Offline
WanderingOwl
jsmack
There is a level above that is implied, but doesn't exist until render time. Unfortunately, that means you can't animate it. You can create that level above explicitly by creating a material builder node and creating the material inside. This will allow parameters to properly instantiate on a parent level for interaction and animation.

That's great, thank you so much! Can I double check what kind of material builder you're referring to - I get options for Karma, VEX, USD and USD Preview when searching it up. Anything special I need to do to add this material to my model, also? I feel like I'm missing something since the click-and-drag and material node methods aren't working with the ones I've tried so far.

oh I forgot the renamed it in Houdini 20. It used to be the only one. It's the VEX material builder. It should drag and drop the same as any other VOP in /mat, but the material sop or material parameter on the object are other ways to pick the material.
User Avatar
Member
6 posts
Joined: Sept. 2023
Offline
jsmack
oh I forgot the renamed it in Houdini 20. It used to be the only one. It's the VEX material builder. It should drag and drop the same as any other VOP in /mat, but the material sop or material parameter on the object are other ways to pick the material.
Absolutely brilliant, thank you so much!!!
User Avatar
Member
6 posts
Joined: Sept. 2023
Offline
... ah.
Edited by WanderingOwl - May 6, 2024 12:43:32
User Avatar
Member
7882 posts
Joined: Sept. 2011
Offline
delete the ramp and make a new one, then don't touch it. edit the values on the builder node's parameters.
User Avatar
Member
6 posts
Joined: Sept. 2023
Offline
jsmack
delete the ramp and make a new one, then don't touch it. edit the values on the builder node's parameters.
Ahh, great! You've been a tremendous help
  • Quick Links