Skip to content

Commit

Permalink
Part: When saving shape in binary mode then continue even if it's empty
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jan 5, 2025
1 parent a974e41 commit 5398276
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Mod/Part/App/PropertyTopoShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,17 +561,18 @@ void PropertyPartShape::loadFromStream(Base::Reader &reader)

void PropertyPartShape::SaveDocFile (Base::Writer &writer) const
{
// If the shape is empty we simply store nothing. The file size will be 0 which
// can be checked when reading in the data.
if (_Shape.getShape().IsNull())
return;
TopoDS_Shape myShape = _Shape.getShape();
if (writer.getMode("BinaryBrep")) {
TopoShape shape;
shape.setShape(myShape);
shape.exportBinary(writer.Stream());
}
else {
// If the shape is empty we simply store nothing. The file size will be 0 which
// can be checked when reading in the data.
if (_Shape.getShape().IsNull()) {
return;
}
bool direct = App::GetApplication().GetParameterGroupByPath
("User parameter:BaseApp/Preferences/Mod/Part/General")->GetBool("DirectAccess", true);
if (!direct) {
Expand Down

0 comments on commit 5398276

Please sign in to comment.