View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000415 | FreeCAD | Bug | public | 2011-08-10 06:54 | 2012-04-12 10:53 |
Reporter | wmayer | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Fixed in Version | 0.13 | ||||
Summary | 0000415: Wrong tree structure of restored python objects | ||||
Description | http://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=10&t=1186&sid=59b054007638d8acbb3561bd114c3f31 | ||||
Tags | No tags attached. | ||||
FreeCAD Information | |||||
|
Can reproduce. Seam a problem in serializing the python object. Get the error: PropertyPythonObject::toString: can't pickle FeaturePython objects wen saving the document. |
|
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 True |
|
As entering and leaving transform mode, heals this. Possible solution: Emit something that triggers 'slotChangeObject' for every object after finished opening the file. |
|
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") _Test(obj) obj.Base = box _ViewProviderTest(obj.ViewObject) FreeCAD.ActiveDocument.recompute() class _Test: def __init__(self,obj): obj.addProperty("App::PropertyLink","Base","Base", "The base object this component is built upon") obj.addProperty("App::PropertyLength","Width","Base", "The width of this wall. Not used if this wall is based on a face") obj.addProperty("App::PropertyLength","Height","Base", "The height of this wall. Keep 0 for automatic. Not used if this wall is based on a solid") obj.addProperty("App::PropertyLength","Length","Base", "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 return def __getstate__(self): return None def __setstate__(self,state): return None |
|
git show 327f9be16c5acd728412a70502a9cdc4000f4795 |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-08-10 06:54 | wmayer | New Issue | |
2011-11-21 08:57 |
|
Note Added: 0001334 | |
2011-11-21 08:57 |
|
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 |