Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions source/PyMaterialX/PyMaterialXCore/PyDefinition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy Markdown
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.

.def("hasNodeGraph", &mx::Implementation::hasNodeGraph)
.def("getNodeGraph", &mx::Implementation::getNodeGraph)
.def_readonly_static("CATEGORY", &mx::Implementation::CATEGORY)
.def_readonly_static("FILE_ATTRIBUTE", &mx::Implementation::FILE_ATTRIBUTE)
.def_readonly_static("FUNCTION_ATTRIBUTE", &mx::Implementation::FUNCTION_ATTRIBUTE);
Expand Down
6 changes: 6 additions & 0 deletions source/PyMaterialX/PyMaterialXGenShader/PyGenOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy Markdown
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.

.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<>());
}
18 changes: 18 additions & 0 deletions source/PyMaterialX/PyMaterialXRender/PyCgltfLoader.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
Copy link
Copy Markdown
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.

// 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);
}
2 changes: 2 additions & 0 deletions source/PyMaterialX/PyMaterialXRender/PyLightHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ void bindPyLightHandler(py::module& mod)
.def("getAlbedoTable", &mx::LightHandler::getAlbedoTable)
.def("setEnvSampleCount", &mx::LightHandler::setEnvSampleCount)
.def("getEnvSampleCount", &mx::LightHandler::getEnvSampleCount)
.def("setRefractionTwoSided", &mx::LightHandler::setRefractionTwoSided)
.def("getRefractionTwoSided", &mx::LightHandler::getRefractionTwoSided)
.def("addLightSource", &mx::LightHandler::addLightSource)
.def("setLightSources", &mx::LightHandler::setLightSources)
.def("getLightSources", &mx::LightHandler::getLightSources)
Expand Down