Skip to content

Commit

Permalink
FEM: base python object, fix and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Mar 18, 2020
1 parent d0fcbf3 commit 73711cd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Mod/Fem/femobjects/FemConstraint.py
Expand Up @@ -37,15 +37,16 @@ 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

# they are needed, see https://forum.freecadweb.org/viewtopic.php?f=18&t=44021
# they are needed, see:
# https://forum.freecadweb.org/viewtopic.php?f=18&t=44021
# https://forum.freecadweb.org/viewtopic.php?f=18&t=44009
def __getstate__(self):
return None
return self.Type

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 73711cd

Please sign in to comment.