FEM: Python base object fix regression added with 71c9694824 by readding getstate method
This commit is contained in:
@@ -55,8 +55,8 @@ class ViewProxy(object):
|
||||
def attach(self, vobj):
|
||||
default = coin.SoGroup()
|
||||
vobj.addDisplayMode(default, "Default")
|
||||
# self.Object = vobj.Object
|
||||
# self.ViewObject = vobj
|
||||
self.Object = vobj.Object # used on various places, claim childreens, get icon, etc.
|
||||
# self.ViewObject = vobj # not used ATM
|
||||
|
||||
def getDisplayModes(self, obj):
|
||||
"Return a list of display modes."
|
||||
@@ -104,7 +104,9 @@ class ViewProxy(object):
|
||||
FreeCAD.Console.PrintError(message + "\n")
|
||||
return True
|
||||
|
||||
# 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):
|
||||
return None
|
||||
|
||||
@@ -33,7 +33,6 @@ __url__ = "http://www.freecadweb.org"
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
from pivy import coin
|
||||
from PySide import QtCore
|
||||
from PySide import QtGui
|
||||
from PySide.QtCore import Qt
|
||||
@@ -51,12 +50,6 @@ class _ViewProviderFemResultMechanical(ViewProviderFemConstraint.ViewProxy):
|
||||
A View Provider for the FemResultObject Python derived FemResult class
|
||||
"""
|
||||
|
||||
def attach(self, vobj):
|
||||
default = coin.SoGroup()
|
||||
vobj.addDisplayMode(default, "Default")
|
||||
self.Object = vobj.Object
|
||||
self.ViewObject = vobj
|
||||
|
||||
def setEdit(self, vobj, mode=0):
|
||||
ViewProviderFemConstraint.ViewProxy.setEdit(
|
||||
self,
|
||||
@@ -85,12 +78,6 @@ 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:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user