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
This commit is contained in:
Bernd Hahnebach
2020-03-09 12:18:14 +01:00
parent 06afffaa36
commit dcabd2ae04
2 changed files with 6 additions and 5 deletions

View File

@@ -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."

View File

@@ -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