Attrib Create Value not overriding Default value?

   1025   5   0
User Avatar
Member
7 posts
Joined: Feb. 2019
Offline
Getting this small issue with the Default/Value of the Attribute Create node adding the "active" attribute to a geometry for a RBD Bullet Solver simulation.

Creating the attribute as 0.0 and setting it to 1.0 seems to work fine. But creating at 1.0 and setting it to 0.0 for some reason is ignored by the RBD bullet solver, and despite the attribute value being correctly set to 0.0, all pieces are included in the simulation.

Am I doing anything wrong? Did I misunderstand the function of the "default" and "Value" on the Attribute Create node? Or is this a bug?

Thanks!

Attachments:
create_invert.gif (301.6 KB)
create_working.gif (315.0 KB)
attcreate.hip (1.4 MB)

User Avatar
Member
2558 posts
Joined: June 2008
Offline
You can't create an attribute on some points and not another. When you try, the attribute is generated at the default value of 0.0 for those non-grouped points. That's why your first case works. When you create the value on only !groupexpand2 you are still creating the attribute on the other points not in the group, but at their default value of 0.0 as you can see in the geometry spread sheet.

Try dropping down a single attributecreate to set the default value, then pipe that into the next attribute create which operates only on your specified group.

Or, use a wrangle, which would take only one node.
if(inpointgroup(0,"groupexpand2",@ptnum))
    f@active = 1.0;
else
    f@active = 0.0;
Edited by Enivob - Aug. 28, 2023 14:45:36
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
7 posts
Joined: Feb. 2019
Offline
Thanks for the answer!

I'm aware that the AttribCreate node has to create the attribute for all the points. In my first gif I was assuming that it would create a default value of 1.0 for ALL the points and assign the value of 0.0 only for the selection. The visualizer and the spreadsheet show that correctly (black as 0.0 --> inactive). In short, I wanted only the red tip to jump out.

Your wrangle works great and I understand the issue, but I'm still confused on why the spreadsheet shows the correct values for the points but fail to exclude them from the simulation.

It's not a big issue, but thanks!
User Avatar
Member
46 posts
Joined: April 2016
Offline
"active" is a point integer attribute, not a float attribute. Try change type in attribcteate SOP and you get what you want.
User Avatar
Staff
365 posts
Joined: Feb. 2008
Offline
active should be an int attrib - if you switch the attribcreate SOP's type to Integer in your first example, it works as expected.
in a wrangle you can do
i@active = i@group_groupexpand2;
User Avatar
Member
7 posts
Joined: Feb. 2019
Offline
vicvvsh
"active" is a point integer attribute, not a float attribute. Try change type in attribcteate SOP and you get what you want.

Yes, but weirdly enough, it works as float too in the 2nd example.
I remember trying switching to integer and getting the same error, but now I tried it again and indeed it works, thanks!

npetit
active should be an int attrib - if you switch the attribcreate SOP's type to Integer in your first example, it works as expected.
in a wrangle you can do
i@active = i@group_groupexpand2;

Yup, tried again and it works, thanks!
  • Quick Links