Skip to content

Commit

Permalink
FEM: base python object, add missing getstate method
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Mar 18, 2020
1 parent 2a50a19 commit d0fcbf3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Mod/Fem/femobjects/FemConstraint.py
Expand Up @@ -37,10 +37,15 @@ def __init__(self, obj):
# 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

## @}

0 comments on commit d0fcbf3

Please sign in to comment.