forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPyUtil.cpp
More file actions
35 lines (30 loc) · 1.34 KB
/
PyUtil.cpp
File metadata and controls
35 lines (30 loc) · 1.34 KB
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
//
// TM & (c) 2017 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
// All rights reserved. See LICENSE.txt for license.
//
#include <PyMaterialX/PyMaterialX.h>
#include <MaterialXGenShader/Util.h>
#include <MaterialXGenShader/ShaderGenerator.h>
namespace py = pybind11;
namespace mx = MaterialX;
std::vector<mx::TypedElementPtr> findRenderableElements(mx::ConstDocumentPtr doc, bool includeReferencedGraphs)
{
std::vector<mx::TypedElementPtr> elements;
mx::findRenderableElements(doc, elements, includeReferencedGraphs);
return elements;
}
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", &mx::findRenderableMaterialNodes);
mod.def("findRenderableElements", &findRenderableElements);
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);
}