Salome HOME
Adapt selection of features in the Booleans and Fillet operations
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Fillet.cpp
index eab8b03ca8c4721d6ae00316736b76c321fb6076..8b0fdab8130349a2b35a6160557a2a2124f6565f 100644 (file)
@@ -112,8 +112,16 @@ void FeaturesPlugin_Fillet::execute()
       return;
 
     ResultPtr aContext = anObjectAttr->context();
-    ResultBodyPtr aCtxOwner = ModelAPI_Tools::bodyOwner(aContext);
-    GeomShapePtr aParent = aCtxOwner ? aCtxOwner->shape() : aContext->shape();
+    GeomShapePtr aParent;
+    if (aContext.get()) {
+      ResultBodyPtr aCtxOwner = ModelAPI_Tools::bodyOwner(aContext);
+      aParent = aCtxOwner ? aCtxOwner->shape() : aContext->shape();
+    } else { // get it from a feature
+      FeaturePtr aFeature = anObjectAttr->contextFeature();
+      if (aFeature.get()) {
+        aParent = aFeature->firstResult()->shape();
+      }
+    }
     if (!aParent)
       return;