Jump to content
Atom

[SOLVED]VEX Struct Does Not Work?

Recommended Posts

Hi All,

I have a struct defined in the outer code area of an attribute wrangle.

When I try to reference the struct, the node errors out.

What is the syntax for using structs?

Untitled-1.jpg

 

If I comment out the code that tries to reference the struct I get no error, which indicates to me that the struct itself is defined correctly.

Untitled-1.jpg.0c39bb6ea3d7b3dffaf844d8d7fc1c31.jpg

Edited by Atom

Share this post


Link to post
Share on other sites

Hard to tell without a scene, but the Wrangle need to be unlocked to set parameter reference to "Outer Code" on Snippet VOP. The code seems good for me.

Share this post


Link to post
Share on other sites

Thanks for the reply. I had never actually dived inside a wrangle.

I don't really know the correct way to setup the Outer Code values. I found an example already posted that I was trying to manipulate but here is a new HIP file with the Outer Code field from the VOP copied to the top level.

Is that all there is to is? Or is there more that needs to be setup?

ap_vex_struct.hiplc

Share this post


Link to post
Share on other sites

You mistyped type name in your scene (relatePoint vs relatedPoint). It should work once you fix it, and you don't need extra parameter if you enter outer code directly in Snippet's field.

Houdini doesn't treat this overall thing in any special way. Outer code is a field on Snippet VOP. You can't edit it unless you unlock the Wrangle. Once you unlocked, you can add your structs, array-returning functions, etc. For convenience, you can create similar spare parameter on Wrangle node and reference it same way the Code field is referenced:

outer.png.99038f6c44c96125d556498862fab2b1.pngouter_code_wrangle.png.0297e515bbb4d9bf070e173c6325b7ac.png

Simple!

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the info. Arrays of struct also seems to work as well!

 

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

×