forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPyVariant.cpp
34 lines (28 loc) · 1.45 KB
/
PyVariant.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
//
// TM & (c) 2017 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
// All rights reserved. See LICENSE.txt for license.
//
#include <PyMaterialX/PyMaterialX.h>
#include <MaterialXCore/Variant.h>
namespace py = pybind11;
namespace mx = MaterialX;
void bindPyVariant(py::module& mod)
{
py::class_<mx::Variant, mx::VariantPtr, mx::InterfaceElement>(mod, "Variant")
.def_readonly_static("CATEGORY", &mx::Variant::CATEGORY);
py::class_<mx::VariantSet, mx::VariantSetPtr, mx::Element>(mod, "VariantSet")
.def("addVariant", &mx::VariantSet::addVariant,
py::arg("name") = mx::EMPTY_STRING)
.def("getVariant", &mx::VariantSet::getVariant)
.def("getVariants", &mx::VariantSet::getVariants)
.def("removeVariant", &mx::VariantSet::removeVariant)
.def_readonly_static("CATEGORY", &mx::VariantSet::CATEGORY);
py::class_<mx::VariantAssign, mx::VariantAssignPtr, mx::Element>(mod, "VariantAssign")
.def("setVariantSetString", &mx::VariantAssign::setVariantSetString)
.def("hasVariantSetString", &mx::VariantAssign::hasVariantSetString)
.def("getVariantSetString", &mx::VariantAssign::getVariantSetString)
.def("setVariantString", &mx::VariantAssign::setVariantString)
.def("hasVariantString", &mx::VariantAssign::hasVariantString)
.def("getVariantString", &mx::VariantAssign::getVariantString)
.def_readonly_static("CATEGORY", &mx::VariantAssign::CATEGORY);
}