Skip to content

Commit

Permalink
PartDesign: fix Body getSubObject()
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder authored and wwmayer committed Oct 16, 2019
1 parent fa5d345 commit 8952306
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Mod/PartDesign/App/Body.cpp
Expand Up @@ -510,6 +510,16 @@ std::vector<std::string> 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);
Expand All @@ -525,6 +535,7 @@ App::DocumentObject *Body::getSubObject(const char *subname,
if(pmat && transform)
*pmat *= Placement.getValue().toMatrix();
return const_cast<Body*>(this);
#endif
}

void Body::onDocumentRestored()
Expand Down

0 comments on commit 8952306

Please sign in to comment.