Get/Find Attribute in Attribute Vop
3442 4 0- r3yu
- 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.
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.
- jlait
- 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.
- r3yu
- 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?.
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?.
- jlait
- Staff
- 6298 posts
- Joined: July 2005
- Offline
- r3yu
- Member
- 13 posts
- Joined: Jan. 2014
- Offline
-
- Quick Links