Jump to content

Undefined Variable Issue (super noob question)

Recommended Posts

Hi there, 


I'm just trying to get started with Houdini and I am stuck trying to follow a tute on attributes. :(

Can someone help me figure out why I'm getting this error in my copy node?


So I'm creating an attribute - "testattribute"




then I'm trying to stamp that attribute but I thats where I get this error...




Any ideas?






Link to comment
Share on other sites

And if you want to use lower case $testattribute then put testattribute in Local Variable field so it'll be mapped to testattribute. If you don't put anything there then it maps to upper case TESTATTRIBUTE by default.

Edited by pbarua
Link to comment
Share on other sites

Hey thanks guys! Yeah I'm really getting into Houdini :)

But I'm stil stuck on this :( 


Capitalising didn't seem to change it. But if I middle click over the copy node (as below) it doesn't seem to have the test attribute within it... Maybe it's not making it past the scatter?




If anyone has a sec, here's the file. 





Link to comment
Share on other sites

You've made an attribute called testattribute but you need to map it to a variable.

Go to your attribute create node and in the local variable box type TESTATTRIBUTE

Leave the copy sop as you have it, $TESTATTRIBUTE.


It's called variable mapping.  It's confusing but basically it's a two part process, you have to create an attribute and then bind it to a local variable.


Any attribute you want to call in sops with the $ has to be variable mapped first.  After you add the local variable parameter you can middle click on the node and your mapped variables will be visible.


It's standard practice to to create an attribute all lowercase and then map it all capitalized. 

Link to comment
Share on other sites

The problem is your variable mapping indeed. The variable mapping is done automatically in the attribcreate node but when you transfer the attribute to scattered points, the variable mapping is lost.

You can easily add this back with an attribwrangle node after your scatter with:

Link to comment
Share on other sites

You're right Robert.  I didn't think the attribute create automatically mapped new variables, I feel like I have to map my variables quite a lot, it must be different circumstances. 


Another way to do it PetSki is to copy/paste your attribute create after the scatter and disable the Write Values check box.  This tells the attribute create just to map an existing variable and not to change the values.  Same as the wrangle code above.

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.

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...