Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python bindings for generation and rendering #1386

Merged

Conversation

kwokcb
Copy link
Contributor

@kwokcb kwokcb commented Jun 22, 2023

Most of these wrapper updates are related to exposing missing APIs in Python for code gen and rendering.
For now this is for GLSL rendering in Python this is sufficient (driver is this example)

@@ -0,0 +1,18 @@
//
Copy link
Contributor Author

Choose a reason for hiding this comment

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

GLTF loader was missing so can't load a number of sample geometry.

@@ -43,6 +43,9 @@ void bindPyDefinition(py::module& mod)
.def("getFunction", &mx::Implementation::getFunction)
.def("setNodeDef", &mx::Implementation::setNodeDef)
.def("getNodeDef", &mx::Implementation::getNodeDef)
.def("setNodeGraph", &mx::Implementation::setNodeGraph)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually for definition creation but added in to avoid another PR.

@@ -27,12 +27,18 @@ void bindPyGenOptions(py::module& mod)
.def_readwrite("shaderInterfaceType", &mx::GenOptions::shaderInterfaceType)
.def_readwrite("fileTextureVerticalFlip", &mx::GenOptions::fileTextureVerticalFlip)
.def_readwrite("targetColorSpaceOverride", &mx::GenOptions::targetColorSpaceOverride)
.def_readwrite("addUpstreamDependencies", &mx::GenOptions::addUpstreamDependencies)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is required to be able to generate reference code for nodes.

Copy link
Member

@jstone-lucasfilm jstone-lucasfilm left a comment

Choose a reason for hiding this comment

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

These changes look good to me, thanks @kwokcb!

@jstone-lucasfilm jstone-lucasfilm changed the title Update Python API interfaces for code gen / rendering Python API updates for generation and rendering Jun 22, 2023
@jstone-lucasfilm jstone-lucasfilm changed the title Python API updates for generation and rendering Add Python bindings for generation and rendering Jun 22, 2023
@jstone-lucasfilm jstone-lucasfilm merged commit da444d5 into AcademySoftwareFoundation:main Jun 22, 2023
@kwokcb kwokcb deleted the python_api_updates branch July 5, 2023 02:49
Michaelredaa pushed a commit to Michaelredaa/MaterialX that referenced this pull request Oct 21, 2023
…dation#1386)

Most of these wrapper updates are related to exposing missing APIs in Python for code gen and rendering.
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