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!
Attrib Create Value not overriding Default value?
1256 5 0- freule
- Member
- 8 posts
- Joined: Feb. 2019
- Offline
- Enivob
- Member
- 2625 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.
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.
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
- freule
- Member
- 8 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!
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!
- vicvvsh
- Member
- 54 posts
- Joined: April 2016
- Offline
- npetit
- Staff
- 407 posts
- Joined: Feb. 2008
- Offline
- freule
- Member
- 8 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 doi@active = i@group_groupexpand2;
Yup, tried again and it works, thanks!
-
- Quick Links