From 75b9dd8a0ec6f58d0b74860af00c430e00423f25 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 10 Mar 2020 16:32:31 +0100 Subject: [PATCH] [skip ci] App: print affected Python type if serializing via JSON fails FemGui: add default implementations of __getstate__/__setstate__ to _ViewProviderFemResultMechanical --- src/App/PropertyPythonObject.cpp | 2 ++ .../Fem/femguiobjects/_ViewProviderFemResultMechanical.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/src/App/PropertyPythonObject.cpp b/src/App/PropertyPythonObject.cpp index bf65c45ee0..d7aa79a295 100644 --- a/src/App/PropertyPythonObject.cpp +++ b/src/App/PropertyPythonObject.cpp @@ -109,6 +109,8 @@ std::string PropertyPythonObject::toString() const repr = str.as_std_string("ascii"); } catch (Py::Exception&) { + Py::String typestr(this->object.type().str()); + Base::Console().Error("PropertyPythonObject::toString(): failed for %s\n", typestr.as_string().c_str()); Base::PyException e; // extract the Python error text e.ReportException(); } diff --git a/src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py b/src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py index 1b7f41d57d..fbeb90fe56 100644 --- a/src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py +++ b/src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py @@ -85,6 +85,12 @@ class _ViewProviderFemResultMechanical(ViewProviderFemConstraint.ViewProxy): FreeCAD.Console.PrintError("Error in onDelete: {0} \n".format(err)) return True + def __getstate__(self): + return None + + def __setstate__(self, data): + return None + class _TaskPanel: """