i@activeGroup = 0;
if(@P != @initpos)
{
@activeGroup = 1;
}
else
{
@activeGroup = 0;
}
I have an RBD sim where I want to isolate only the pieces that are moving and put them in a group so I can create a volume that emits from those pieces only. In this code, I am asking that when the initial position is different from the position, then group into “activeGroup”. Am I approaching this the right way. I just want to group the pieces that have velocity and move after broken constraints.
Thanks
If Statement error - Trying to create a group
3116 12 1-
- DasBK
- Member
- 17 posts
- Joined: 6月 2017
- Offline
-
- ironsightdesign
- Member
- 23 posts
- Joined: 4月 2020
- Offline
-
- Hatchery
- Member
- 139 posts
- Joined: 3月 2016
- Offline
-
- ironsightdesign
- Member
- 23 posts
- Joined: 4月 2020
- Offline
-
- Hatchery
- Member
- 139 posts
- Joined: 3月 2016
- Offline
-
- ironsightdesign
- Member
- 23 posts
- Joined: 4月 2020
- Offline
That works to get activeGroup as a face selection like inside/outside, but everything is in the group. Doesnt look like "v@P != v@initpos" is separating them into in/out of the group.
Any other ideas?
Maybe testing whether its constraint is broken or not instead would work?
Really appreciate the help.
Any other ideas?
Maybe testing whether its constraint is broken or not instead would work?
Really appreciate the help.
Edited by ironsightdesign - 2023年8月29日 13:17:02
-
- Hatchery
- Member
- 139 posts
- Joined: 3月 2016
- Offline
-
- eaniix
- Member
- 63 posts
- Joined: 11月 2021
- Offline
-
- ironsightdesign
- Member
- 23 posts
- Joined: 4月 2020
- Offline
-
- Hatchery
- Member
- 139 posts
- Joined: 3月 2016
- Offline
yeah thats no problem, i think what eaniix quite rightly pointed out is you need to run over points but then assign to the group on the prims so i think this should do the job.
if(v@P != v@initpos){ int prims[] = pointprims(0,@ptnum); foreach(int i; prims){ setprimgroup(0,'activeGroup',i,1,'set'); } }else{ setprimgroup(0,'activeGroup',@ptnum,0,'set'); }
Edited by Hatchery - 2023年8月31日 03:57:28
Love Houdini
-
- ironsightdesign
- Member
- 23 posts
- Joined: 4月 2020
- Offline
-
- Hatchery
- Member
- 139 posts
- Joined: 3月 2016
- Offline
-
- ironsightdesign
- Member
- 23 posts
- Joined: 4月 2020
- Offline
Thanks Hatchery.
No I didnt...and also didnt add the geo to input 2.
Looks like that works, but might be an alembic limitation now.
Houdini updates the activeGroup as the RBD runs and pieces move, but the selection in the alembic in C4D is always empty. I think maybe selections cant be animated (unless its with C4D fields).
Maybe if it would work if I can get that group as a vertex map in the alembic?
Thanks again for all the help.
No I didnt...and also didnt add the geo to input 2.
Looks like that works, but might be an alembic limitation now.
Houdini updates the activeGroup as the RBD runs and pieces move, but the selection in the alembic in C4D is always empty. I think maybe selections cant be animated (unless its with C4D fields).
Maybe if it would work if I can get that group as a vertex map in the alembic?
Thanks again for all the help.
-
- Quick Links