From 5829fc4f4af33f269bae2faadacc411f2cc63a6e Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Fri, 6 Mar 2020 17:50:41 +0100 Subject: [PATCH] FEM: base Python VP, extend to get the icon without hard coded name --- src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py b/src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py index 9ac32cc9ed..e12fe193b3 100644 --- a/src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py +++ b/src/Mod/Fem/femguiobjects/ViewProviderFemConstraint.py @@ -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")