Skip to content

Commit

Permalink
Import: fix STEP export crash on vertex only shape
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed Nov 12, 2022
1 parent 0e8deb6 commit c64e4a4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Mod/Import/App/ImportOCAF2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,8 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj,
const char *sub, TDF_Label parent, const char *name)
{
App::DocumentObject *obj;
auto shape = Part::Feature::getTopoShape(parentObj,sub,false,0,&obj,false,!sub);
bool needSubElement = sub && Data::ComplexGeoData::findElementName(sub) == sub;
auto shape = Part::Feature::getTopoShape(parentObj,sub,needSubElement,0,&obj,false,!sub);
if(!obj || shape.isNull()) {
if (obj)
FC_WARN(obj->getFullName() << " has null shape");
Expand Down Expand Up @@ -1314,7 +1315,9 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj,
links.push_back(linked);
}

auto subs = obj->getSubObjects();
std::vector<std::string> subs;
if (!needSubElement)
subs = obj->getSubObjects();
// subs empty means obj is not a container.
if(subs.empty()) {

Expand Down

0 comments on commit c64e4a4

Please sign in to comment.