View Issue Details

IDProjectCategoryView StatusLast Update
0000415FreeCADBugpublic2012-04-12 10:53
Reporterwmayer Assigned To 
Status closedResolutionfixed 
Fixed in Version0.13 
Summary0000415: Wrong tree structure of restored python objects
TagsNo tags attached.
FreeCAD Information



2011-11-21 08:57

administrator   ~0001334

Can reproduce. Seam a problem in serializing the python object. Get
the error:
PropertyPythonObject::toString: can't pickle FeaturePython objects
wen saving the document.


2012-03-14 15:49

developer   ~0001775

Last edited: 2012-03-15 05:57

I've a simmilar problem, but without any error message. I want to remark that the getIcon method is respected while claimChildren does not seem to have an effect.
And I doubt that the pickeling Problem in the view Object is the sole cause.
>>> doc.import_dxf.ViewObject.Proxy.Object is doc.import_dxf


2012-03-15 13:04

developer   ~0001776

Last edited: 2012-03-15 13:04

As entering and leaving transform mode, heals this.
Possible solution:
Emit something that triggers 'slotChangeObject' for every object after finished opening the file.


2012-04-12 10:52

administrator   ~0001928

Minimal example to demonstrate the error:

import FreeCAD, FreeCADGui, Part

def makeTest():
    doc = FreeCAD.newDocument()
    box = doc.addObject("Part::Box","Box")
    obj = doc.addObject("App::FeaturePython","Claim")
    obj.Base = box

class _Test:
    def __init__(self,obj):
                        "The base object this component is built upon")
                        "The width of this wall. Not used if this wall is based on a face")
                        "The height of this wall. Keep 0 for automatic. Not used if this wall is based on a solid")
                        "The length of this wall. Not used if this wall is based on a shape")
        self.Type = "Wall"
        obj.Width = 0.1
        obj.Length = 1
        obj.Height = 0.1
        obj.Proxy = self

    def execute(self,obj):
        obj.Label = "Hello"

class _ViewProviderTest:
    def __init__(self,obj):
        obj.Proxy = self
        self.Object = obj.Object

    def getIcon(self):
        return ":/icons/Arch_Wall_Tree.svg"

    def claimChildren(self):
        return [self.Object.Base]

    def attach(self,vobj):
        self.Object = vobj.Object

    def __getstate__(self):
        return None

    def __setstate__(self,state):
        return None


2012-04-12 10:53

administrator   ~0001929

git show 327f9be16c5acd728412a70502a9cdc4000f4795

Issue History

Date Modified Username Field Change
2011-08-10 06:54 wmayer New Issue
2011-11-21 08:57 Jriegel Note Added: 0001334
2011-11-21 08:57 Jriegel Status new => acknowledged
2012-03-14 15:49 shoogen Note Added: 0001775
2012-03-15 05:57 shoogen Note Edited: 0001775
2012-03-15 13:04 shoogen Note Added: 0001776
2012-03-15 13:04 shoogen Note Edited: 0001776
2012-04-12 10:52 wmayer Note Added: 0001928
2012-04-12 10:53 wmayer Note Added: 0001929
2012-04-12 10:53 wmayer Status acknowledged => closed
2012-04-12 10:53 wmayer Resolution open => fixed
2012-04-12 10:53 wmayer Fixed in Version => 0.13