Advertisement
mrhumbility

Print Min and Max Value from Vol Houdini

Sep 24th, 2021
1,866
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.67 KB | None | 0 0
  1. node = hou.selectedNodes()[0]
  2. geo = node.geometry()
  3. prims = geo.prims()
  4. newGeo = hou.Geometry()
  5. convertvdb_verb = hou.sopNodeTypeCategory().nodeVerb("convertvdb")
  6. for p in prims:
  7.     if('VDB' in str(p.type())):
  8.         convertvdb_verb.execute(newGeo, [geo])
  9.         prims2 = newGeo.prims()
  10.         for pp in prims2:
  11.             maxVal = pp.volumeMax()
  12.             minVal = pp.volumeMin()
  13.             print(pp.attribValue('name') + ": " + "Max: " + str(maxVal) + " Min: " + str(minVal))
  14.         break
  15.     else:
  16.         maxVal = p.volumeMax()
  17.         minVal = p.volumeMin()
  18.         print(p.attribValue('name') + ": " + "Max: " + str(maxVal) + " Min: " + str(minVal))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement