diff --git a/src/Mod/Import/App/ImportOCAF2.cpp b/src/Mod/Import/App/ImportOCAF2.cpp index f997187f36..3b0d6ea49a 100644 --- a/src/Mod/Import/App/ImportOCAF2.cpp +++ b/src/Mod/Import/App/ImportOCAF2.cpp @@ -1244,8 +1244,17 @@ TDF_Label ExportOCAF2::exportObject(App::DocumentObject* parentObj, // not call setupObject() on a non-located baseshape like above, // because OCCT does not respect shape style sharing when not // exporting assembly - if(!keepPlacement) + if(!keepPlacement || shape.getPlacement() == Base::Placement()) shape.setShape(shape.getShape().Located(TopLoc_Location())); + else { + Base::Matrix4D mat = shape.getTransform(); + shape.setShape(shape.getShape().Located(TopLoc_Location())); + // Transform with copy to conceal the transformation + shape.transformShape(mat, true); + // Even if the shape has no transformation, TopoShape still sets + // a TopLoc_Location, so we need to clear it again. + shape.setShape(shape.getShape().Located(TopLoc_Location())); + } label = aShapeTool->AddShape(shape.getShape(),Standard_False, Standard_False); auto o = name?parentObj:obj; if(o!=linked)