From b70fac242aa6226ca4e0886feef2493884d99bff Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 8 Apr 2020 12:10:59 +0300 Subject: [PATCH] Fix for the issue #3203 : Wrong group update on mesh with branch occ/modificationByFeatures --- .../ConnectorPlugin_PublishToStudyFeature.py | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py b/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py index aca23d564..a70cfafed 100644 --- a/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py +++ b/src/ConnectorPlugin/ConnectorPlugin_PublishToStudyFeature.py @@ -159,19 +159,18 @@ class PublishToStudyFeature(ModelAPI.ModelAPI_Feature): aResObject = aPartDoc.object(model.ModelAPI_ResultBody_group(), aResId) aRes = model.objectToResult(aResObject) aSSEntry = self.computeEntry(aRes) - if aSSEntry in allNewReferences: - continue aSShape = anEngine.FindOrCreateShape(aSSEntry) - aSShape.SetShapeByStream(aRes.shape().getShapeStream(False)) - if not aSShape.GetSO(): # publish in case it is a new shape - anEngine.AddInStudy(aSShape, aRes.data().name(), None) - else: # restore a red reference if it was deleted - aDone, aSO2 = aSShape.GetSO().FindSubObject(1) - if aDone: - aDone, aRef = aSO2.ReferencedObject() - if not aDone: - aBuilder = SHAPERSTUDY_utils.getStudy().NewBuilder() - aBuilder.Addreference(aSO2, aSShape.GetSO()) + if not aSSEntry in allNewReferences: + aSShape.SetShapeByStream(aRes.shape().getShapeStream(False)) + if not aSShape.GetSO(): # publish in case it is a new shape + anEngine.AddInStudy(aSShape, aRes.data().name(), None) + else: # restore a red reference if it was deleted + aDone, aSO2 = aSShape.GetSO().FindSubObject(1) + if aDone: + aDone, aRef = aSO2.ReferencedObject() + if not aDone: + aBuilder = SHAPERSTUDY_utils.getStudy().NewBuilder() + aBuilder.Addreference(aSO2, aSShape.GetSO()) allProcessed.append(aSSEntry) # Groups self.processGroups(aRes, anEngine, aPartFeatureId, aSShape, False) -- 2.39.2