Attribute exists in detail view but can't use in expression?

   4137   6   0
User Avatar
Member
228 posts
Joined: 12月 2012
Offline
Hi,

I'm having some odd issues with attributes. I use the measure SOP to measure the primitive area, using the ‘override name’ option, setting the name to ‘original’. I then use an attribute transfer SOP to transfer this attribute to new geometry. This seems to work, as I can see ‘original’ in the details view on the new geo.

Then I measure area again, overriding name to ‘new’. I now see ‘new’ and ‘original’ in the details view. Now, I would like to use a Delete SOP and delete ‘$NEW < $ORIGINAL’. However, neither of those attributes are accessible in the expression. Further, $AREA exists in the expression, but shouldn't exist at all and is not present in the detail view.

What is going on? :?

Attachments:
houdiniWoes.jpg (322.0 KB)

www.kmcnamara.com
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
Come on its not that bad > Your title “woes” made me chuckle. See attached

The prim attributes are not available because they have not been mapped. You can map any variable , note I have unchecked the write values parameter to map . I then use the mapped variable to delete some prims based on an if statement

Rob

Attachments:
rse_variablemapping.hip (60.3 KB)

Gone fishing
User Avatar
Member
228 posts
Joined: 12月 2012
Offline
Beautiful, thank you! That fixed the issue.

So that I understand - I thought that the area node created attributes? Why do I need to re-map them to attributes again?
www.kmcnamara.com
User Avatar
Member
1390 posts
Joined: 7月 2005
Offline
KMcNamara
So that I understand - I thought that the area node created attributes? Why do I need to re-map them to attributes again?

Variables != attributes [sidefx.com]. Attributes are real (numbers), variables are aliases (shortcuts) for attributes. Some variables are there by default, most not. Mapping links them. Having an attribute doesn't imply the existence of variable.
User Avatar
Member
2624 posts
Joined: 8月 2006
Offline
You can check this if you look in the attribute create node and notice the local variable parameter. When you create a attribute it automatically gets mapped with a local variable name ie

attribute foo gets mapped as local variable $FOO

Rob
Gone fishing
User Avatar
Member
228 posts
Joined: 12月 2012
Offline
Thanks guys - I always thought each attribute automatically got it's own variable.

That clears it up!
www.kmcnamara.com
User Avatar
Member
4508 posts
Joined: 2月 2012
Offline
It's also important to note that if you leave the Local Variable parameter field empty in the AttribCreate SOP, a variable is automatically created. But the same does NOT happen when using an Add Attribute VOP, which should to be uniform all across the board IMO.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
  • Quick Links