Houdini - LOPS & USD

Tips

Lighting

  • 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.

Nodes

Rendering

Camera

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.

karma_lens_shader_01.hiplc
Latlong / Polar CVEX Lens shader

Settings

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

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

Materials

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.

lop_assign_material_01.hiplc
setting materials in lops using attributes from sops

Python & USD

Docs

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()
#print(focus_dist)

# 9.644547462463379

#print(type(focus_dist))

# <class 'float'>


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

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

#print(type(transform))

# <class 'pxr.Gf.Matrix4d'>

#print('\n'.join(dir(transform)))


pos = transform.GetRow3(3)
#print(pos)

# (1, 2, 3)

#print(type(pos))

# <class 'pxr.Gf.Vec3d'>

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


z_axis = transform.GetRow3(2)
#print(z_axis)

# (0, -1, 0)

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

print(pos_tuple)
print(z_axis_tuple)