Correct small bug in CompoundFilter in command line

Without this, CompoundFilter does not work in Python script in non-GUI-mode.
See:
https://forum.freecadweb.org/viewtopic.php?f=10&t=27593&p=222303
and
https://www.freecadweb.org/tracker/view.php?id=3381
This commit is contained in:
Janne Keränen
2018-05-28 15:34:18 +03:00
committed by wmayer
parent 1a71777f5f
commit 6781a8167f

View File

@@ -44,7 +44,8 @@ def makeCompoundFilter(name):
'''makeCompoundFilter(name): makes a CompoundFilter object.'''
obj = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", name)
_CompoundFilter(obj)
_ViewProviderCompoundFilter(obj.ViewObject)
if obj.ViewObject:
_ViewProviderCompoundFilter(obj.ViewObject)
return obj