Jump to content


  • Content count

  • Donations

    0.00 CAD 
  • Joined

  • Last visited

Community Reputation

1 Neutral

About sherlockHound

  • Rank

Personal Information

  • Name
    David Thomas
  • Location
    Hanover, MA USA
  1. Virtual Depth Sensors

    Hey! For anyone interested, I found a solution that works. I started by creating a "sensor" (a small sphere) and constraining to the ship. Next I used an Extract Centroid SOP, with Detail for Run Over, Center of Mass for Method, Attribute (called "centroid") for Output. Next, I added an Object Merge SOP, to merge the sea surface. I then dropped a Python SOP and attached the sensor to Input 1 and the sea surface merge into Input 2. I wanted to export a csv with depths for the entire frame range. Works great as long as the sensor is always under the surface. Would need to tweak the equation for depth on line 24. node = hou.pwd() hipFile = hou.hipFile path = hipFile.path() filename = path.replace(hipFile.basename(), node.parent().name() + ".csv") inputs = node.inputs() sensor_geo = inputs[0].geometry() sea_surface_geo = inputs[1].geometry() try: if (hou.intFrame() == 1): file = open(filename, "w+") file.close() file = open(filename, "a") except: print("ermagerd! ferl errr!") with file: position = hou.Vector3() normal = hou.Vector3() uvw = hou.Vector3() ray_origin = hou.Vector3(geo.attribValue("centroid")) ray_dir = hou.Vector3(0,100,0) intersected = sea_surface_geo.intersect(ray_origin, ray_dir, position, normal, uvw) depth = position[1] - ray_origin[1] str1="{:.8f}".format(depth) file.write(str1 + "\n") fend = hou.playbar.frameRange()[1] if (hou.intFrame() == fend): file.close()
  2. Virtual Depth Sensors

    Hi - I have a ship that is behaving nicely with pretty realistic buoyancy on a Houdini Ocean. I would like to outfit the ship with sensors that will give me their depth below the ocean surface at any given time. Any ideas how best to do that? Thanks!
  3. Attach Camera to Boat

    Hey All - I have an ocean in Houdini with a boat floating on it. I'd like to attach a camera to the mast, but can't figure out how to do it. Any ideas? Thanks!
  4. Get polygon and normals in Python

    Hooray! I got it! Since the type is already hou.Polygon, I just needed to treat it as such. No casting required. I think I love Python.
  5. Get polygon and normals in Python

    Hey all- I have a simulation running that is controlling the position and orientation of a grid that comprises just a single square polygon. Trying to use python to output the normal and center point of that grid. I can access the first hou.Prim, but I can't figure out how to get the polygon to get the normal. How do I do that? Thanks! Dave
  6. Generate Text File out of Houdini

    Thank you, Dennis! I looked into that on your recommendation, but I can not find a float array to use. Any ideas? I am very new to this, despite having used Houdini for many years!
  7. Generate Text File out of Houdini

    Hi All - I used the attribute_dump.hipnc file as a guide and it works great, but I would like to save out as just floats (not vectors) Does anybody know what I need to do in the code to change that? Right now I have: for (int i = 0; i < @numpt; i++) { vector pos = point(0, "P", i); float h = pos.y; append(v[]@point_colors, h); } But that writes a vector where all three values are h for each line. I'd like to just write a float to save space and time. Any ideas? Thanks!
  8. Generate Text File out of Houdini

    This is great! Thank you! Does anybody have any idea how to Dump automatically every frame?