forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PyUnitSystem.cpp
31 lines (26 loc) · 1.26 KB
/
PyUnitSystem.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
//
// TM & (c) 2017 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
// All rights reserved. See LICENSE.txt for license.
//
#include <PyMaterialX/PyMaterialX.h>
#include <MaterialXGenShader/UnitSystem.h>
#include <MaterialXGenShader/GenContext.h>
#include <MaterialXGenShader/ShaderGraph.h>
namespace py = pybind11;
namespace mx = MaterialX;
void bindPyUnitSystem(py::module& mod)
{
py::class_<mx::UnitTransform>(mod, "UnitTransform")
.def(py::init<const std::string&, const std::string&, const mx::TypeDesc*, const std::string&>())
.def_readwrite("sourceUnit", &mx::UnitTransform::sourceUnit)
.def_readwrite("targetUnit", &mx::UnitTransform::targetUnit)
.def_readwrite("type", &mx::UnitTransform::type)
.def_readwrite("unitType", &mx::UnitTransform::type);
py::class_<mx::UnitSystem, mx::UnitSystemPtr>(mod, "UnitSystem")
.def_static("create", &mx::UnitSystem::create)
.def("getName", &mx::UnitSystem::getName)
.def("loadLibrary", &mx::UnitSystem::loadLibrary)
.def("supportsTransform", &mx::UnitSystem::supportsTransform)
.def("setUnitConverterRegistry", &mx::UnitSystem::setUnitConverterRegistry)
.def("getUnitConverterRegistry", &mx::UnitSystem::getUnitConverterRegistry);
}