From 6781a8167fbe7a2fc508f60f85e34fddfc155927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20Ker=C3=A4nen?= Date: Mon, 28 May 2018 15:34:18 +0300 Subject: [PATCH] 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 --- src/Mod/Part/CompoundTools/CompoundFilter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/CompoundTools/CompoundFilter.py b/src/Mod/Part/CompoundTools/CompoundFilter.py index 0a91ff5c40..b385c3137e 100644 --- a/src/Mod/Part/CompoundTools/CompoundFilter.py +++ b/src/Mod/Part/CompoundTools/CompoundFilter.py @@ -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