Get/Find Attribute in Attribute Vop

   3442   4   0
User Avatar
Member
13 posts
Joined: Jan. 2014
Offline
Hi.

After a long break I started to play around in houdini again.
I found an older file and I cant rebuild the same thing.
The problem is that the older file had VOPSOP in it and VOPSOP is replaced with AttributeVOPs in H14.

So in VOPSOP if i take ptnum and multiply it, its easy to write out its product as a new attribute.

But if a try to do the same thing in AttributeVop I cant make it because ptnum holds only one number. So after I read the help I tried to Bind the ptnum attributes and add, set them to a new attribute.

Here comes my question. How can i use the newly created attribute? I want to manipulate it further (just multiplying with 2 in this example) and create the final attribute.
I tried to use Get Attribute and Find Attribute but I cant get back the correct Attribute values.

Attachments:
ptN.JPG (21.1 KB)
ptN_01.jpg (460.7 KB)
ptN_02.jpg (418.2 KB)

User Avatar
Staff
6298 posts
Joined: July 2005
Offline
r3yu
Hi.

After a long break I started to play around in houdini again.
I found an older file and I cant rebuild the same thing.
The problem is that the older file had VOPSOP in it and VOPSOP is replaced with AttributeVOPs in H14.

So in VOPSOP if i take ptnum and multiply it, its easy to write out its product as a new attribute.

But if a try to do the same thing in AttributeVop I cant make it because ptnum holds only one number.

I am confused what you mean by it only holding one number? You can have multiple wires leave ptnum in Attribute VOP, just like you can have multiple wires leave ptnum in VOP SOP…?

Are you referring to how the 2048 is replicated down the chain? That is because addattribute() is setting the *default* value, not the current value. This should have worked as you expected with a setattribute.

One note is that if you are writing to your currently processed point I'd recommend just using Bind rather than Add Attribute where possible. Attached shows setups using either set/add pairs or Bind Export.

Here comes my question. How can i use the newly created attribute? I want to manipulate it further (just multiplying with 2 in this example) and create the final attribute.
I tried to use Get Attribute and Find Attribute but I cant get back the correct Attribute values.

You can't inspect the value of your newly created attribute. You have to split a wire out from where you wrote the value. Points are processed in arbitrary order, so it is not meaningful to ask what the currently changed value is. The Get Attribute will get the value *before* you started all your manipulation at all times, as that is the one consistent value available. In this case this distinction isn't important as you have the value you wrote to PtNum on a wire ready to pass down to the second set attribute.

Attachments:
bind_example.png (38.6 KB)
set_add.png (48.4 KB)

User Avatar
Member
13 posts
Joined: Jan. 2014
Offline
Thanks for the answer.

Here is a follow up.
In VOPSOP the add attrib node has a “Local Variable Name” option.
So its missing in AttributVOP.

I added a AttribCreate before the AttribVOP and created the attribute and the Variable .

Is there a way where i can remap my variables inside the AttributeVOP? Or I need to always create the attribute before the AttributeVOP ifI want mapped variables?.

Attachments:
solved.jpg (456.3 KB)

User Avatar
Staff
6298 posts
Joined: July 2005
Offline
The Add Attribute inside of the Attribute VOP also has a local variable option you can use to setup your variable binding?
User Avatar
Member
13 posts
Joined: Jan. 2014
Offline
Woops sorry. I think is missed that one.
  • Quick Links