Houdini - LOPS & USD



  • Automatic headlight Creation
    • The default behaviour when there are no lights present in the scene is to create a default headlight. To disable the default light uncheck the following checkbox
      Karma render settings (node) > Rendering > Geometry and Shading > Shading > Automatic Headlight Creation : Disable

Solaris is the umbrella name for Houdini’s scene building, layout, lighting, and rendering tools based on the Universal Scene Description (USD) framework. LOP (lighting operator) nodes generate USD describing characters, props, lighting, and rendering.




Latlong cubemap in Karma
I needed to render out a cube map using Karma so this led me to dig deeper into lens shaders. Paul Ambrosiussen and Matt Estela has some good information on the subject.
There seems to be a bug when Karma is rendering with Hython so the lensshader using cvex errors out (will maybe be fixed in Houdini 19.5). A workaround is to use the vrlens shader that you can create in a shopnet context.

Latlong / Polar CVEX Lens shader


Applies renderer-specific geometry settings to geometry in the scene graph.

Using a mtlxuniform_edf and a render geometry settings node to render an unshaded color material


Read more about material assignment in lops cgwiki. Below is a hip file where I try out varius ways of editing material attributes in lops.

setting materials in lops using attributes from sops

Python & USD


Camera properties

# camera in the lop context named camera1

# translation: (1, 2, 3)

# rotation: (-270, 0, 0)

lop_cam = hou.node('/obj/lopnet1/camera1')
stage = lop_cam.stage()
primpath = lop_cam.evalParm("primpath")
cam = stage.GetPrimAtPath(primpath)

property_names = cam.GetPropertyNames() 
# print(property_names)

# ['clippingPlanes', 'clippingRange', 'exposure', 'focalLength', ...

focus_dist_attr = cam.GetAttribute('focusDistance')
focus_dist = focus_dist_attr.Get()

# 9.644547462463379


# <class 'float'>

transform_attr = cam.GetAttribute('xformOp:transform')
transform = transform_attr.Get()

# ( (1, 0, 0, 0), (0, 0, 1, 0), (0, -1, 0, 0), (1, 2, 3, 1) )


# <class 'pxr.Gf.Matrix4d'>


pos = transform.GetRow3(3)

# (1, 2, 3)


# <class 'pxr.Gf.Vec3d'>

pos_tuple = (pos[0], pos[1], pos[2])

z_axis = transform.GetRow3(2)

# (0, -1, 0)

z_axis_tuple = (z_axis[0], z_axis[1], z_axis[2])