From 38fd061716c627db590b314f166e3377b08f2d97 Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Tue, 15 Oct 2019 12:54:28 +0800 Subject: [PATCH] PartDesign: fix Body getSubObject() --- src/Mod/PartDesign/App/Body.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Mod/PartDesign/App/Body.cpp b/src/Mod/PartDesign/App/Body.cpp index b62e285f3f..448f558546 100644 --- a/src/Mod/PartDesign/App/Body.cpp +++ b/src/Mod/PartDesign/App/Body.cpp @@ -510,6 +510,16 @@ std::vector Body::getSubObjects(int reason) const { App::DocumentObject *Body::getSubObject(const char *subname, PyObject **pyObj, Base::Matrix4D *pmat, bool transform, int depth) const { +#if 1 + return Part::BodyBase::getSubObject(subname,pyObj,pmat,transform,depth); +#else + // The following code returns Body shape only if there is at least one + // child visible in the body (when show through, not show tip). The + // original intention is to sync visual to shape returned by + // Part.getShape() when the body is included in some other group. But this + // interfere with direct modeling using body shape. Therefore it is + // disabled here. + if(!pyObj || showTip || (subname && !Data::ComplexGeoData::isMappedElement(subname) && strchr(subname,'.'))) return Part::BodyBase::getSubObject(subname,pyObj,pmat,transform,depth); @@ -525,6 +535,7 @@ App::DocumentObject *Body::getSubObject(const char *subname, if(pmat && transform) *pmat *= Placement.getValue().toMatrix(); return const_cast(this); +#endif } void Body::onDocumentRestored()