manitou Posted July 8, 2017 Share Posted July 8, 2017 Hi, could someone show an example of the use of the "hou.Geometry.boundingBox()" class? I want to query the of bbox objects from the Python Shell. I've written scripts in maya-mel, and I'm getting my head around python in Houdini. Any syntax examples would be appreciated Brian Samuels Quote Link to comment Share on other sites More sharing options...
f1480187 Posted July 8, 2017 Share Posted July 8, 2017 You need to get an instance of hou.Geometry. Sometimes there is no easy way to track what set of calls you need to get hou.Something. You may try to construct it by calling hou.Something(). It may throw an "AttributeError: No constructor defined", which is, I think, will happen with most of hou classes. Even if you can construct hou.Geometry, you obviously need a specific geometry, not an empty one. Fortunately, any SopNode seems to have a Geometry. Here is Python Shell example: >>> node = hou.node('/obj/geo1/platonic1') >>> geo = node.geometry() >>> bb = geo.boundingBox() >>> bb <hou.BoundingBox [-0.92793, 0.92793, -0.975684, 0.975684, -0.789344, 0.789344]> >>> mv = bb.minvec() >>> mv <hou.Vector3 [-0.92793, -0.975684, -0.789344]> >>> tuple(mv) (-0.9279304146766663, -0.9756839275360107, -0.7893444299697876) 2 1 Quote Link to comment Share on other sites More sharing options...
manitou Posted July 10, 2017 Author Share Posted July 10, 2017 Thanks, this helps Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.