Skip to content

Commit

Permalink
FEM: base Python VP, extend to get the icon without hard coded name
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Mar 6, 2020
1 parent f4f5d7b commit 5829fc4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py
Expand Up @@ -45,6 +45,12 @@ class ViewProxy(object):
def __init__(self, vobj):
vobj.Proxy = self

# 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)

def attach(self, vobj):
default = coin.SoGroup()
vobj.addDisplayMode(default, "Default")
Expand Down

0 comments on commit 5829fc4

Please sign in to comment.