Jump to content

How to read/write heightfield layer through variable in wrangle?


Recommended Posts

In normal way, we can use following code to operate layers in heightfield.

@height += 0.5;
@mask = 1;

But how to access layer info through variable?

string layer_name = "height";
@layer_name = 1; // doesn't work

Thanks.

Link to comment
Share on other sites

  • 1 year later...

I found a way that works.  I'm not sure if it's the only way to do this, but a lot of houdini's own nodes do it so I assume it's correct.

You have to use the BINDINGS tab inside the VOLUME WRANGLE. 
-add a binding.
-set PRIMITIVE NAME = height
-set VEX PARAMTER = poo
-Then in your code, put @poo += 1; and you'll see it is editing your height layer, so it's working.
-Then you'll want to promote that PRIMITIVE NAME variable to the root of your node(s), so it's easy to type in whatever layer you wanna edit.

 

  • Like 1
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...