Skip to content

Bind remaining OslRenderer and OSL GenOptions settings in Python - #3123

Merged
jstone-lucasfilm merged 1 commit into
AcademySoftwareFoundation:mainfrom
autodesk-forks:ppenenko/osl-render-bindings
Oct 28, 2026
Merged

jstone-lucasfilm merged 1 commit into
AcademySoftwareFoundation:mainfrom
autodesk-forks:ppenenko/osl-render-bindings

Conversation

@ppenenko

@ppenenko ppenenko commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Exposes the remaining OslRenderer setters and GenOptions.oslConnectCiWrapper to Python, so Python can configure OSL rendering the same way MaterialXTest's [renderosl] tests do in C++.

New bindings:

  • OslRenderer: setEnvShaderParameterOverrides, setDataLibraryOSOPath, useOslCommandString, setOSLCmdStr, setAaLit, setAaUnlit
  • GenOptions: oslConnectCiWrapper

These are plain one-to-one bindings, with no changes to the C++ API.

Testing

There are no Python tests for the renderer bindings in this repository yet. I use these bindings in a pytest-based render test harness in metashade/MaterialX - see PR metashade#86. It configures OslRenderer from Python with MaterialXTest's settings (-aa levels, the envmap_filename environment shader override, oslConnectCiWrapper) and renders the TestSuite materials with testrender. The resulting 143 images are pixel-identical to the ones MaterialXTest writes.

Related: #3120 (unquoted paths in OslRenderer command lines).

Add Python bindings for OslRenderer.setEnvShaderParameterOverrides,
setDataLibraryOSOPath, useOslCommandString, setAaLit, setAaUnlit and
setOSLCmdStr, and for GenOptions.oslConnectCiWrapper.  These are the
settings MaterialXTest's OSL render tests use, so Python drivers of
OslRenderer can reproduce its renders.

@jstone-lucasfilm jstone-lucasfilm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, thanks @ppenenko!

@jstone-lucasfilm
jstone-lucasfilm merged commit cf655dd into AcademySoftwareFoundation:main Oct 28, 2026
41 checks passed
@ppenenko
ppenenko deleted the ppenenko/osl-render-bindings branch October 28, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants