find number of voxels

   1137   4   0
User Avatar
Member
57 posts
Joined: Jan. 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
8554 posts
Joined: July 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: Jan. 2015
Offline
Thanks Tomas! Great ideas. Bound is probably easiest for what I'm doing,

thanks again.
User Avatar
Member
859 posts
Joined: Oct. 2008
Offline
There's a primintrinsic called activevoxelcount.
--
Jobless
User Avatar
Member
57 posts
Joined: Jan. 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 - May 8, 2023 11:38:13
  • Quick Links