-
Notifications
You must be signed in to change notification settings - Fork 419
Add Python bindings for generation and rendering #1386
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
Merged
jstone-lucasfilm
merged 1 commit into
AcademySoftwareFoundation:main
from
kwokcb:python_api_updates
Jun 22, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is required to be able to generate reference code for nodes. |
||
| .def_readwrite("libraryPrefix", &mx::GenOptions::libraryPrefix) | ||
| .def_readwrite("targetDistanceUnit", &mx::GenOptions::targetDistanceUnit) | ||
| .def_readwrite("hwTransparency", &mx::GenOptions::hwTransparency) | ||
| .def_readwrite("hwSpecularEnvironmentMethod", &mx::GenOptions::hwSpecularEnvironmentMethod) | ||
| .def_readwrite("hwWriteDepthMoments", &mx::GenOptions::hwWriteDepthMoments) | ||
| .def_readwrite("hwShadowMap", &mx::GenOptions::hwShadowMap) | ||
| .def_readwrite("hwMaxActiveLightSources", &mx::GenOptions::hwMaxActiveLightSources) | ||
| .def_readwrite("hwNormalizeUdimTexCoords", &mx::GenOptions::hwNormalizeUdimTexCoords) | ||
| .def_readwrite("hwAmbientOcclusion", &mx::GenOptions::hwAmbientOcclusion) | ||
| .def_readwrite("hwWriteAlbedoTable", &mx::GenOptions::hwWriteAlbedoTable) | ||
| .def_readwrite("hwImplicitBitangents", &mx::GenOptions::hwImplicitBitangents) | ||
| .def_readwrite("emitColorTransforms", &mx::GenOptions::emitColorTransforms) | ||
| .def(py::init<>()); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| // Copyright Contributors to the MaterialX Project | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
|
|
||
| #include <PyMaterialX/PyMaterialX.h> | ||
| #include <MaterialXRender/CgltfLoader.h> | ||
|
|
||
| namespace py = pybind11; | ||
| namespace mx = MaterialX; | ||
|
|
||
| void bindPyCgltfLoader(py::module& mod) | ||
| { | ||
| py::class_<mx::CgltfLoader, mx::CgltfLoaderPtr, mx::GeometryLoader>(mod, "CgltfLoader") | ||
| .def_static("create", &mx::CgltfLoader::create) | ||
| .def(py::init<>()) | ||
| .def("load", &mx::CgltfLoader::load); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.