Skip to content

Commit

Permalink
[Mesh Python] Mesh.show() returns python object, update documentation…
Browse files Browse the repository at this point in the history
… for Mesh.show(), Part.show(), and Points.show()
  • Loading branch information
mwganson authored and chennes committed Feb 3, 2025
1 parent d5b0f68 commit a85756b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Mod/Mesh/App/AppMeshPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Module: public Py::ExtensionModule<Module>
add_varargs_method("show",
&Module::show,
"show(shape,[string]) -- Add the mesh to the active document or create "
"one if no document exists.");
"one if no document exists. Returns document object.");
add_varargs_method("createBox", &Module::createBox, "Create a solid mesh box");
add_varargs_method("createPlane", &Module::createPlane, "Create a mesh XY plane normal +Z");
add_varargs_method("createSphere", &Module::createSphere, "Create a tessellated sphere");
Expand Down Expand Up @@ -311,8 +311,7 @@ class Module: public Py::ExtensionModule<Module>
}
// copy the data
pcFeature->Mesh.setValue(*mo);

return Py::None();
return Py::asObject(pcFeature->getPyObject());
}
Py::Object createBox(const Py::Tuple& args)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/Part/App/AppPartPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ class Module : public Py::ExtensionModule<Module>
"read(string) -- Load the file and return the shape."
);
add_varargs_method("show",&Module::show,
"show(shape,[string]) -- Add the shape to the active document or create one if no document exists."
"show(shape,[string]) -- Add the shape to the active document or create one if no document exists.\n"
"Returns document object."
);
add_varargs_method("getFacets",&Module::getFacets,
"getFacets(shape): simplified mesh generation"
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Points/App/AppPointsPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Module: public Py::ExtensionModule<Module>
add_varargs_method("show",
&Module::show,
"show(points,[string]) -- Add the points to the active document or "
"create one if no document exists.");
"create one if no document exists. Returns document object.");
initialize("This module is the Points module."); // register with Python
}

Expand Down

0 comments on commit a85756b

Please sign in to comment.