-
Notifications
You must be signed in to change notification settings - Fork 371
/
Copy pathPyUtil.cpp
39 lines (33 loc) · 1.44 KB
/
PyUtil.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// Copyright Contributors to the MaterialX Project
// SPDX-License-Identifier: Apache-2.0
//
#include <PyMaterialX/PyMaterialX.h>
#include <MaterialXGenShader/Util.h>
#include <MaterialXGenShader/ShaderGenerator.h>
namespace py = pybind11;
namespace mx = MaterialX;
std::vector<mx::TypedElementPtr> findRenderableMaterialNodes(mx::ConstDocumentPtr doc)
{
return mx::findRenderableMaterialNodes(doc);
}
std::vector<mx::TypedElementPtr> findRenderableElements(mx::ConstDocumentPtr doc, bool includeReferencedGraphs)
{
(void) includeReferencedGraphs;
return mx::findRenderableElements(doc);
}
void bindPyUtil(py::module& mod)
{
mod.def("isTransparentSurface", &mx::isTransparentSurface);
mod.def("mapValueToColor", &mx::mapValueToColor);
mod.def("requiresImplementation", &mx::requiresImplementation);
mod.def("elementRequiresShading", &mx::elementRequiresShading);
mod.def("findRenderableMaterialNodes", &findRenderableMaterialNodes);
mod.def("findRenderableElements", &findRenderableElements, py::arg("doc"), py::arg("includeReferencedGraphs") = false);
mod.def("getNodeDefInput", &mx::getNodeDefInput);
mod.def("tokenSubstitution", &mx::tokenSubstitution);
mod.def("getUdimCoordinates", &mx::getUdimCoordinates);
mod.def("getUdimScaleAndOffset", &mx::getUdimScaleAndOffset);
mod.def("connectsToWorldSpaceNode", &mx::connectsToWorldSpaceNode);
mod.def("hasElementAttributes", &mx::hasElementAttributes);
}