Skip to content

Commit

Permalink
Added attribute strings to Element class in Python API (#2047)
Browse files Browse the repository at this point in the history
This change fixes #1545
  • Loading branch information
rherrera-ilm authored Oct 2, 2024
1 parent 29477f7 commit 0653e1d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/PyMaterialX/PyMaterialXCore/PyElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0653e1d

Please sign in to comment.