Extract LOP data property using python

Extract LOP data property using python #

  • In Houdini LOPs direct access to primitives is not possible.
  • To get the bounding box (bbox) of a primitive, there are no expressions in LOPs to directly extract values from primitives.
  • In Python, you can use hou.node(/path/to/prim).stage().GetObjectAtPath("/prim.extentsHint").Get() to get the min/max bounds of a primitive.
  • A simpler solution is to insert a sopmodify node before the node you need to get the bbox to, link the bbox to the OUT of the container, and get the surface node reference

example_scene

Note: This method works in Houdini’s LOP context, where direct primitive access is limited. It provides a workaround to extract bounding box information using Python scripting and node manipulation.