From d0fcbf34b08810c65e18f05a2de6e704bd2c8531 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Wed, 18 Mar 2020 12:34:31 +0100 Subject: [PATCH] FEM: base python object, add missing getstate method --- src/Mod/Fem/femobjects/FemConstraint.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Fem/femobjects/FemConstraint.py b/src/Mod/Fem/femobjects/FemConstraint.py index cb4d6d2f5f..26eef95b4d 100644 --- a/src/Mod/Fem/femobjects/FemConstraint.py +++ b/src/Mod/Fem/femobjects/FemConstraint.py @@ -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 ## @}