Obtaining the position of an object

   1464   1   1
User Avatar
Member
21 posts
Joined: Nov. 2015
Offline
Hi!

I'm new in Houdini and I have a problem.

I created and SOP object where the animation of it is controlled through DOP object and an script of python. I trying to to record the different positions of the object through the simulation. But, always my script returning the Initial position value when the simulation runs.

This is a piece of my python script:

#Function that return us the value of the roof's y-axis.
def roofMove():
try:

#Loading a geometry and parameters
print “Loading roof…”
geo = hou.node('/obj/sphere_object1/transform1')

#Initial value of the geometry in ‘y’-axis
geoPos=geo.geometry().boundingBox().center()

return geoPos

except Exception as e:
print type (e)



What can I do? Where is the problem? Should I take the value from another node?

Thanks
User Avatar
Member
101 posts
Joined: Feb. 2015
Offline
Hi , maybe try to use geometryAtFrame() method

geoPos=geo.geometryAtFrame(hou.frame()).boundingBox().center()
https://vimeo.com/user43710534 [vimeo.com]
  • Quick Links