Understanding the Behavior of the SegmentEditor with converted models

Hello,

When applying a segmentation effect on surface models (converted into segments), the effect needs to be applied twice to get the desired result. For instance, below I try to apply a Gaussian filter to a tube model generated using markups-to-model module.

If I hit apply on the filter, then the tube becomes voxelated but not smooth.

When I apply the filter again however, the filter seems to be applied correctly.

In code, I do this;

splintSegmentID = inputSegmentIDs.GetValue(0)
segmentEditorWidget.setCurrentSegmentID(splintSegmentID)
segmentEditorWidget.setActiveEffectByName("Smoothing")
effect = segmentEditorWidget.activeEffect()
effect.setParameter("SmoothingMethod", "GAUSSIAN")
effect.setParameter("KernelSizeMm", 1)
#effect.setParameter("ApplyToAllVisibleSegments", str(1))
effect.self().onApply()

segmentEditorWidget.setActiveEffectByName("Smoothing")
effect = segmentEditorWidget.activeEffect()
effect.setParameter("SmoothingMethod", "GAUSSIAN")
effect.setParameter("KernelSizeMm", 1)
#effect.setParameter("ApplyToAllVisibleSegments", str(1))
effect.self().onApply()

What am I doing wrong and what is the appropriate way of applying effects on these models?