From dcabd2ae041bcf47997da78a719b98fd947d770b Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Mon, 9 Mar 2020 12:18:14 +0100 Subject: [PATCH] FEM: python base object and python base view object, workaround: - do not add Object attribute, regression added in 299879f8d - do not attacht Object and ViewObject attribute, regression added in f47c288001 - this deactivates the icons in tree view - thus this only is a workaround --- src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py | 9 +++++---- src/Mod/Fem/femobjects/FemConstraint.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py b/src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py index e12fe193b3..181c0298bd 100644 --- a/src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py +++ b/src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py @@ -48,14 +48,15 @@ class ViewProxy(object): # needs to be overwritten, if no standard icon name is used def getIcon(self): """after load from FCStd file, self.icon does not exist, return constant path instead""" - file_name = self.Object.Proxy.Type.replace("Fem::", "FEM_") - return ":/icons/{}.svg".format(file_name) + # file_name = self.Object.Proxy.Type.replace("Fem::", "FEM_") + # return ":/icons/{}.svg".format(file_name) + return "" def attach(self, vobj): default = coin.SoGroup() vobj.addDisplayMode(default, "Default") - self.Object = vobj.Object - self.ViewObject = vobj + # self.Object = vobj.Object + # self.ViewObject = vobj def getDisplayModes(self, obj): "Return a list of display modes." diff --git a/src/Mod/Fem/femobjects/FemConstraint.py b/src/Mod/Fem/femobjects/FemConstraint.py index 2a962c2a19..cb4d6d2f5f 100644 --- a/src/Mod/Fem/femobjects/FemConstraint.py +++ b/src/Mod/Fem/femobjects/FemConstraint.py @@ -34,7 +34,7 @@ class Proxy(object): BaseType = "Fem::ConstraintPython" def __init__(self, obj): - self.Object = obj # keep a ref to the DocObj for nonGui usage + # self.Object = obj # keep a ref to the DocObj for nonGui usage obj.Proxy = self # link between App::DocumentObject to this object # a few objects had this method in their class before the move to this base class