Turns out OpenImageIO has a pretty cool fill-holes function. It does this based on the alpha channel in the image.
oiiotool --frames 1001-1004 isPalmRig.#.exr --fillholes -o isPalmRig_fill.#.exr

wip and stuff
Turns out OpenImageIO has a pretty cool fill-holes function. It does this based on the alpha channel in the image.
oiiotool --frames 1001-1004 isPalmRig.#.exr --fillholes -o isPalmRig_fill.#.exr

New video up on generating masks (mattes) in Renderman for Maya.
Here’s a quick script to connect up a single PxrMatteID node to many PxrMaterial nodes.
import pymel.core as pym
mynodes = pym.ls (sl=True, fl=True, dag=False, ni=True)
mybxdfs = []
myhairs = []
mymatteid = []
for x in mynodes:
if isinstance(x , (pym.nodetypes.PxrSurface, pym.nodetypes.PxrLayerSurface)):
mybxdfs.append(x)
if isinstance(x , ( pym.nodetypes.PxrMarschnerHair)):
myhairs.append(x)
if isinstance(x , (pym.nodetypes.PxrMatteID)):
mymatteid.append(x)
if len(mymatteid) == 1:
for b in mybxdfs:
mymatteid[0].resultAOV.connect(b.utilityPattern[0], force=True)
for h in myhairs:
mymatteid[0].resultAOV.connect(h.inputAOV, force=True)
elif len(mymatteid) != 1:
print 'too many PxrMatteID nodes selected, just try one'
Enjoy