From 0653e1da3753291616aa7be048738cd4aa9d9ddf Mon Sep 17 00:00:00 2001 From: rherrera-ilm Date: Wed, 2 Oct 2024 13:41:57 -0700 Subject: [PATCH] Added attribute strings to Element class in Python API (#2047) This change fixes #1545 --- source/PyMaterialX/PyMaterialXCore/PyElement.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/PyMaterialX/PyMaterialXCore/PyElement.cpp b/source/PyMaterialX/PyMaterialXCore/PyElement.cpp index 6e846c120e..9f35770e8b 100644 --- a/source/PyMaterialX/PyMaterialXCore/PyElement.cpp +++ b/source/PyMaterialX/PyMaterialXCore/PyElement.cpp @@ -103,6 +103,15 @@ void bindPyElement(py::module& mod) py::arg("geom") = mx::EMPTY_STRING) .def("asString", &mx::Element::asString) .def("__str__", &mx::Element::asString) + .def_readonly_static("NAME_ATTRIBUTE", &mx::Element::NAME_ATTRIBUTE) + .def_readonly_static("FILE_PREFIX_ATTRIBUTE", &mx::Element::FILE_PREFIX_ATTRIBUTE) + .def_readonly_static("GEOM_PREFIX_ATTRIBUTE", &mx::Element::GEOM_PREFIX_ATTRIBUTE) + .def_readonly_static("COLOR_SPACE_ATTRIBUTE", &mx::Element::COLOR_SPACE_ATTRIBUTE) + .def_readonly_static("INHERIT_ATTRIBUTE", &mx::Element::INHERIT_ATTRIBUTE) + .def_readonly_static("NAMESPACE_ATTRIBUTE", &mx::Element::NAMESPACE_ATTRIBUTE) + .def_readonly_static("DOC_ATTRIBUTE", &mx::Element::DOC_ATTRIBUTE) + .def_readonly_static("XPOS_ATTRIBUTE", &mx::Element::XPOS_ATTRIBUTE) + .def_readonly_static("YPOS_ATTRIBUTE", &mx::Element::YPOS_ATTRIBUTE) BIND_ELEMENT_FUNC_INSTANCE(Collection) BIND_ELEMENT_FUNC_INSTANCE(Document) BIND_ELEMENT_FUNC_INSTANCE(GeomInfo)