Jump to content
RicardoMadeira

Get Parameter value from created attribute.

Recommended Posts

Hello there! Kinda new around here; think this is my first post, but lurking in the shadows and reading a lot this forum has been a great resource in learning the tools of the trade with Houdini lately.

Well, straight to the point;

I'm wondering if it's possible to make a parameter fetch a value from a created attribute. Can't post my network right now, but imagine;

I have a IsoOffset, which creates a volume from a Boolean to be read by a Measure node; After that I promote the created Primitive attribute to a Detail attribute and Scatter some points on it.

After this, a PopNetwork is created and I want it to emmit from the created points; but I need it to stop when the Volume Detail attribute is over a certain value;

I'm wondering if via Wrangle I can do this with an If function, but then again, how would I transfer the final variable value to the Birth Rate Parameter in the Pop Source?

I thought of something like this in the Parameter Field `detail("obj/Geometry1/attribpromote1", "VolCut", 0)` but it doesn't seem to work.

Any ideas? Kind of noobish, so don't judge me hard on this! 

Cheers and thanks in advance!

Share this post


Link to post
Share on other sites

I'm using area instead of volume, but you get the gist...so I start off with a normal grid 10x10 (in size), then I keyframed it to 5x5. So you can see, emission stops after the area has reach too 'small' a size, in this case 50.

EDIT: if I didn't use spare param (-1) and put the path in there...I need a / infront

if(detail("/obj/geo1/attribpromote1","area",0)>50,1,0) maybe that was all you were missing

Cutoff1.jpg

Edited by Noobini

Share this post


Link to post
Share on other sites

Thanks! Looks like I was overthinking the whole process. ll give it a shot tomorrow and post some feedback. ;) Still, is it possible to call a Var from a certain Wrangle into a Parameter in a similar way?

Share this post


Link to post
Share on other sites

Hi there!

The solution does not seem to work. When I introduce the expression if(detail("/obj/geo1/attribpromote1/","VolVol",0)<2,1,0); in the Const. Activation the emission doesn't even start.

My Emmission Type in the Source is in Points, the one mode that allows me to use the expression in the Const. Activation. If I change it to All Points, it emmits from all of them, but does not stop when the Volume Value is reached.

Any ideas?

Share this post


Link to post
Share on other sites

Man, I've rebuilt the whole thing and it's still not working as it's supposed to. I even replaced the VDB from polygons and used the ISOoffset, not to measure the volume, but mainly because I want the scatter to work in the whole volume and not only in the surface. The detail attribute works fine and reads the values as it is supposed to, but in the popnet it's not working.

I must be doing something really wrong.

Share this post


Link to post
Share on other sites

I haven't follow the whole thread but you are putting ";" colon at the end of the expression, with hscript expressions I believe you do not use ";"

so your expression should be 
 

if(detail("/obj/geo1/attribpromote1","volume",0)<2,1,0)

 

without the colon at the end,

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

×