Thus on three times saving I get ...
Code: Select all
{'Type': {'Type': {'Type': {'Type': 'Fem::FemMeshRegion'}}}}
Moderator: bernd
Code: Select all
{'Type': {'Type': {'Type': {'Type': 'Fem::FemMeshRegion'}}}}
I quickly looked at the FEM code and in none of your fem objects a method __getstate__ exists. This if course won't work because as explained in the other thread when saving the Python proxy it invokes the __getstate__ method if it exists, if not then it uses the dict of the object.
Code: Select all
def __setstate__(self, state):
if state:
self.Type = state
def __getstate__(self):
return self.Type
the __getstate__ was missiong at all for the python base object. After this
got this ...
Code: Select all
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
I don't think it's really needed.What is this "if state ..." useful for in __setstate__?