Skip to content

Commit

Permalink
improve stubs for FnDependencyNode
Browse files Browse the repository at this point in the history
  • Loading branch information
Muream committed Jun 9, 2021
1 parent 3a3ea23 commit 7283103
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/MFnDependencyNode.inl
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#define _doc_create R"pbdoc(Creates a new dependency node with the given type.)pbdoc"
#define _doc_findPlug R"pbdoc(Attempt to find a plug for the given attribute.)pbdoc"

FnDependencyNode
.def(py::init<>())
.def(py::init<const MObject &>())
.def(py::init<const MObject &>(), py::arg("object"))

.def("create", [](MFnDependencyNode& self,
const std::string type) -> MObject {
MStatus status;
MObject obj = self.create(type.c_str(), &status);
CHECK_STATUS(status);
return obj;
}, R"pbdoc(Creates a new dependency node with the given type.)pbdoc",
py::arg("type"))
}, py::arg("type"),
_doc_create)

.def("create", [](MFnDependencyNode& self,
const std::string type,
Expand All @@ -19,9 +21,9 @@ FnDependencyNode
MObject obj = self.create(type.c_str(), name.c_str(), &status);
CHECK_STATUS(status);
return obj;
}, R"pbdoc(Creates a new dependency node with the given type.)pbdoc",
py::arg("type"),
py::arg("name"))
}, py::arg("type"),
py::arg("name"),
_doc_create)

.def("findPlug", [](MFnDependencyNode& self,
const std::string attrName,
Expand All @@ -30,9 +32,9 @@ FnDependencyNode
MPlug obj = self.findPlug(attrName.c_str(), wantNetworkedPlug, &status);
CHECK_STATUS(status);
return obj;
}, R"pbdoc(Attempt to find a plug for the given attribute.)pbdoc",
py::arg("attrName"),
py::arg("wantNetworkedPlug") = true)
}, py::arg("attrName"),
py::arg("wantNetworkedPlug") = true,
_doc_findPlug)

.def("name", [](MFnDependencyNode& self) -> std::string {
MStatus status;
Expand Down

0 comments on commit 7283103

Please sign in to comment.