FEM: base python object, add missing getstate method

This commit is contained in:
Bernd Hahnebach
2020-03-18 12:34:31 +01:00
parent 2a50a19564
commit d0fcbf34b0

View File

@@ -37,10 +37,15 @@ class Proxy(object):
# 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
# these objects will give a setAttr failed error on document loading without this method
# they are needed, see https://forum.freecadweb.org/viewtopic.php?f=18&t=44021
def __getstate__(self):
return None
def __setstate__(self, state):
# a few FEM objects had this attribut assignment before the move to this Python base obj class
# these objects will give a setAttr failed error on document loading without this assignment
if state:
self.Type = state
return None
## @}