-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into rporter/MDAGModifier
- Loading branch information
Showing
21 changed files
with
2,536 additions
and
660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
*.dist-info | ||
*.pyd | ||
*.py[id] | ||
build/** | ||
tmp/* | ||
*.pyc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import time | ||
import pybind11_stubgen | ||
|
||
STUBS_LOCATION = "build/cmdc.pyi" | ||
|
||
print("Generating stubs") | ||
t0 = time.time() | ||
|
||
module = pybind11_stubgen.ModuleStubsGenerator("cmdc") | ||
module.write_setup_py = False | ||
|
||
print("(1) Parsing module..") | ||
|
||
module.parse() | ||
|
||
t1 = time.time() | ||
print("(1) Finished in {0:0.3} s".format(t1-t0)) | ||
print("(1) ----------------------------") | ||
|
||
print("(2) Writing stubs..") | ||
|
||
with open(STUBS_LOCATION, "w") as handle: | ||
content = "\n".join(module.to_lines()) | ||
|
||
handle.write(content) | ||
|
||
t2 = time.time() | ||
print("(2) Finished in {0:0.3} s".format(t2-t1)) | ||
print("(2) ----------------------------") | ||
|
||
print("Succesfully created .{0} in {1:0.3} s".format(STUBS_LOCATION, t2-t0)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
py::class_<MAngle> Angle(m, "Angle"); | ||
py::class_<MDAGDrawOverrideInfo> DAGDrawOverrideInfo(m, "DAGDrawOverrideInfo"); | ||
py::class_<MDagPath> DagPath(m, "DagPath"); | ||
py::class_<MDagPathArray> DagPathArray(m, "DagPathArray"); | ||
py::class_<MDataBlock> DataBlock(m, "DataBlock"); | ||
py::class_<MDataHandle> DataHandle(m, "DataHandle"); | ||
py::class_<MDistance> Distance(m, "Distance"); | ||
py::class_<MFn> Fn(m, "Fn"); | ||
py::class_<MFnDependencyNode> FnDependencyNode(m, "FnDependencyNode"); | ||
py::class_<MMatrix> Matrix(m, "Matrix"); | ||
py::class_<MObject> Object(m, "Object"); | ||
py::class_<MObjectArray> ObjectArray(m, "ObjectArray"); | ||
py::class_<MObjectHandle> ObjectHandle(m, "ObjectHandle"); | ||
py::class_<MPlug> Plug(m, "Plug"); | ||
py::class_<MPoint> Point(m, "Point"); | ||
py::class_<MPxData> PxData(m, "PxData"); | ||
py::class_<MQuaternion> Quaternion(m, "Quaternion"); | ||
py::class_<MSelectionList> SelectionList(m, "SelectionList"); | ||
py::class_<MStatus> Status(m, "Status"); | ||
py::class_<MString> String(m, "String"); | ||
py::class_<MTime> Time(m, "Time"); | ||
py::class_<MTypeId> TypeId(m, "TypeId"); | ||
py::class_<MVector> Vector(m, "Vector"); | ||
py::enum_<MFn::Type> fn_type(Fn, "Type"); | ||
py::class_<MUuid> Uuid(m, "Uuid"); | ||
py::class_<MNodeClass> NodeClass(m, "NodeClass"); | ||
py::class_<MDGModifier> DGModifier(m, "DGModifier"); | ||
py::class_<MFnDagNode> FnDagNode(m, "FnDagNode"); | ||
py::class_<MBoundingBox> BoundingBox(m, "BoundingBox"); | ||
py::class_<MColor> Color(m, "Color"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,77 @@ | ||
py::class_<MBoundingBox>(m, "BoundingBox") | ||
#define _doc_BoundingBox_center \ | ||
"Center point" | ||
|
||
#define _doc_BoundingBox_clear \ | ||
"Empties the bounding box, setting its corners to (0, 0, 0)." | ||
|
||
#define _doc_BoundingBox_contains \ | ||
"Returns True if a point lies within the bounding box." | ||
|
||
#define _doc_BoundingBox_depth \ | ||
"Size in Z" | ||
|
||
#define _doc_BoundingBox_expand \ | ||
"Expands the bounding box to include a point or other bounding box." | ||
|
||
#define _doc_BoundingBox_height \ | ||
"Size in Y" | ||
|
||
#define _doc_BoundingBox_intersects \ | ||
"Returns True if any part of a given bounding box lies within this one." | ||
|
||
#define _doc_BoundingBox_transformUsing \ | ||
"Multiplies the bounding box's corners by a matrix." | ||
|
||
#define _doc_BoundingBox_width \ | ||
"Size in X" | ||
|
||
BoundingBox | ||
.def(py::init<>()) | ||
|
||
.def("center", [](MBoundingBox& self) -> MPoint { | ||
return self.center(); | ||
}, R"pbdoc(Center point)pbdoc") | ||
}, _doc_BoundingBox_center) | ||
|
||
.def("clear", [](MBoundingBox& self) -> void { | ||
self.clear(); | ||
}, R"pbdoc(Empties the bounding box, setting its corners to (0, 0, 0).)pbdoc") | ||
}, _doc_BoundingBox_clear) | ||
|
||
.def("contains", [](MBoundingBox& self, MPoint point) -> bool { | ||
return self.contains(point); | ||
}, R"pbdoc(Returns True if a point lies within the bounding box.)pbdoc") | ||
}, | ||
py::arg("point"), | ||
_doc_BoundingBox_contains) | ||
|
||
.def("depth", [](MBoundingBox& self) -> double { | ||
return self.depth(); | ||
}, R"pbdoc(Size in Z)pbdoc") | ||
}, _doc_BoundingBox_depth) | ||
|
||
.def("expand", [](MBoundingBox& self, MBoundingBox box) -> void { | ||
self.expand(box); | ||
}, R"pbdoc(Expands the bounding box to include a point or other bounding box.)pbdoc") | ||
}, | ||
py::arg("box"), | ||
_doc_BoundingBox_expand) | ||
|
||
.def("expand", [](MBoundingBox& self, MPoint point) -> void { | ||
self.expand(point); | ||
}, R"pbdoc(Expands the bounding box to include a point or other bounding box.)pbdoc") | ||
}, py::arg("point"), | ||
_doc_BoundingBox_expand) | ||
|
||
.def("height", [](MBoundingBox& self) -> double { | ||
return self.height(); | ||
}, R"pbdoc(Size in Y)pbdoc") | ||
}, _doc_BoundingBox_height) | ||
|
||
.def("intersects", [](MBoundingBox& self, MBoundingBox box, double tol = 0.0) -> bool { | ||
return self.intersects(box, tol); | ||
}, R"pbdoc(Returns True if any part of a given bounding box lies within this one.)pbdoc") | ||
}, py::arg("box"), | ||
py::arg("tol") = 0.0, | ||
_doc_BoundingBox_intersects) | ||
|
||
.def("transformUsing", [](MBoundingBox& self, MMatrix matrix) -> void { | ||
self.transformUsing(matrix); | ||
}, R"pbdoc(Multiplies the bounding box's corners by a matrix.)pbdoc") | ||
}, py::arg("matrix"), | ||
_doc_BoundingBox_transformUsing) | ||
|
||
.def("width", [](MBoundingBox& self) -> double { | ||
return self.width(); | ||
}, R"pbdoc(Size in X)pbdoc"); | ||
}, _doc_BoundingBox_width); |
Oops, something went wrong.