Hello all,
I am playing with the HOM acces to volumes. As a simple test I am trying to get the values from all the voxels,
The code I am trying in a python sop:
# This code is called when instances of this SOP cook.
geo = hou.pwd().geometry()
# Add code to modify the contents of geo.
for prim in geo.prims():
if (prim.type() == hou.primType.Volume):
res = prim.resolution()
for i in range(res*res*res):
dens = prim.voxel(i)
I run into a problem in the voxel(i) call. The sop has an error message that looks something like:
…./hou.py line 18400 in voxel,
return _hou.Volume_voxel(*args)
Type error in method Volume_voxel, argument 2 of type `std::vector<float…
Does the volume voxel require a vector? Perhaps it expects the position instead of an index?
Any help is appreciated.
Koen
hou.Volume.voxel
5251 5 2- koen
- Member
- 792 posts
- Joined: April 2020
- Offline
- johner
- Staff
- 821 posts
- Joined: July 2006
- Offline
- koen
- Member
- 792 posts
- Joined: April 2020
- Offline
- koen
- Member
- 792 posts
- Joined: April 2020
- Offline
- jason_iversen
- Member
- 12603 posts
- Joined: July 2005
- Offline
I don't think you can create volumes yet, can you?
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
- koen
- Member
- 792 posts
- Joined: April 2020
- Offline
Dont think so. I was just playing with a python sop to modify an existing volume. I want to implent a “flood-fill” for volumes with a noise in it. Getting to the information seems very simple, changing the values seems a little harder right now.
Back to the particle/dops flood filling, if only I could get gas_field_to_particle to work correctly :-)
Cheers,
koen
Back to the particle/dops flood filling, if only I could get gas_field_to_particle to work correctly :-)
Cheers,
koen
-
- Quick Links