find number of voxels

   1719   4   0
User Avatar
Member
57 posts
Joined: 1月 2015
Offline
Is there a way to turn the number of voxels in a vdb into something accessible via vex? Short story long, I'm trying to test to see if an object can be turned into a vdb, and if it produces no voxels. Then use a different technique.

thanks
User Avatar
Member
8836 posts
Joined: 7月 2007
Offline
you can probably use volumeres() [www.sidefx.com] Hscript function

or volumeres() [www.sidefx.com] VEX function

to see if any of the dimensions is 0, in which case the volume primitive has probably no voxels

you can probably also use Bound SOP, if it returns all points at origin, the input has probably no voxels
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
57 posts
Joined: 1月 2015
Offline
Thanks Tomas! Great ideas. Bound is probably easiest for what I'm doing,

thanks again.
User Avatar
Member
874 posts
Joined: 10月 2008
Offline
There's a primintrinsic called activevoxelcount.
--
Jobless
User Avatar
Member
57 posts
Joined: 1月 2015
Offline
Thank you Soothsayer, That's another great option. For anyone looking into this in the future, the vex is, assuming your volume is plugged into the second input:
i@vCount = primintrinsic(1, "activevoxelcount", 0);
Edited by chris wells - 2023年5月8日 11:38:13
  • Quick Links