simulation groups custom float
#1
Hello,
i came across 2 issues when i tried to change particle-groups by their birthID with "custom properties" operator.
The BirthID of the first born particle in an event is always 0. But Simulation Groups start at 1. Is there a way to offset that without script?
Also, in "display data" operator, i can not input 0 in the "specifc particle ID" field. Maybe that is a bug?
Further the BirthIDs are also the expected float values: e.g. birthID 4 = float value 4 and so on. so thats fine. 

My second problem then is: even if i ignore the first particle, the float value is not really corresponding to the groups.
At least the order is a bit counterintuitive to me.
With float value 3 i get them assigned to sim group "1, 2" instead of just "3". 
If i want them to go to group 3 i need float value 4. 
float value 5 puts the particle to group "1, 3" (picture) and so on. 
Is there some logic behind this order? 
Is that just the way it is, or am i doing somthing wrong?

Thanks you!


Attached Files Thumbnail(s)
   
  Reply
#2
Thank you, specific particle IDs starting at 1 is a bug that will be fixed in the next build.

As for particle groups, they are flags set on an unsigned 16 bit integer. Each flag corresponds to a bit set. So, in binary, group 1 would be:

Code:
0000000000000001

and group 2 would be:

Code:
0000000000000010

And so on...

However, the conversion of those bits into a readable integer is not intuitive...so it's best to remember that groups are toggled bitflags when working with them directly. Group X is not the number X assigned to the particle's group property, but instead the Xth bit (from the right) toggled on on the 16-bit group integer. You are seeing groups 1 and 2 displayed when you assign the number 3, because

Code:
0000000000000011

in decimal form is 3.
  Reply
#3
aaah ok that makes sense!
I always wondered, why the groups are capped and are buttons instead of a input field Smile
Thanks for the explanation and im happy i found a bug too!

This all leads to another question for me though but its very specific so i will create a new post; i hope you can help me out again there, its very appreciated!
  Reply


Forum Jump: