Import: Export tip when body is selected (#24678)
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
#include <Mod/Part/App/Interface.h>
|
||||
#include <Mod/Part/App/OCAF/ImportExportSettings.h>
|
||||
#include <Mod/PartDesign/App/Body.h>
|
||||
|
||||
#include "ExportOCAF2.h"
|
||||
|
||||
@@ -392,6 +393,16 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj,
|
||||
return {};
|
||||
}
|
||||
|
||||
if (obj->isDerivedFrom(PartDesign::Body::getClassTypeId())) {
|
||||
PartDesign::Body* body = static_cast<PartDesign::Body*>(obj);
|
||||
App::DocumentObject* tip = body->Tip.getValue();
|
||||
if (tip) {
|
||||
// keep the shape from the body, but use the tip's colors
|
||||
// by replacing obj with tip
|
||||
obj = tip;
|
||||
}
|
||||
}
|
||||
|
||||
// sub may contain more than one hierarchy, e.g. Assembly container may use
|
||||
// getSubObjects to skip some hierarchy containing constraints and stuff
|
||||
// when exporting. We search for extra '.', and set it as prefix if found.
|
||||
|
||||
Reference in New Issue
Block a user