Summary
In short, I have a SketchObjectPython which onDocumentRestore() call its parents to run some methods. The model file opens and it runs without problem, until a Link to another External Document is added, then it seems a lots of objects are not loaded (both in Linked and Link documents !?) and return 'NoneType' error below.
Code: Select all
09:56:57 Traceback (most recent call last):
File "/home/paullee/Downloads/FreeCAD_0.20_weekly-builds-25025-Linux-Conda_glibc2.12-x86_64_vanilla/squashfs-root/usr/Mod/Link to SketchArchLite/ArchSketchObject.py", line 409, in onDocumentRestored
self.callParentToRebuildMasterSketchTags(fp) # "Master"
File "/home/paullee/Downloads/FreeCAD_0.20_weekly-builds-25025-Linux-Conda_glibc2.12-x86_64_vanilla/squashfs-root/usr/Mod/Link to SketchArchLite/ArchSketchObject.py", line 310, in callParentToRebuildMasterSketchTags
parent.Proxy.setPropertiesLinkCommon(parent)
<class 'AttributeError'>: 'NoneType' object has no attribute 'Proxy'
Demo Model Files
- See screencapture of 2 demo files with dependency graphs in images 1 & 2 below
(Model files attached below) - There are SketchObjectPython objects therein with onDocumentRestore() methods
- The object is called ArchSketch, and its has appLinkExecute() to support Link also
- Both models file have 2 ArchSketches
(name it ArchSketch__Master_x, and ArchSketch__Dependent_x respectively) - Both ArchSketch__Dependent_x has an App::PropertyLink, point it to ArchSketch__Master_x
- Save and re-open
- The onDocumentRestore() run and the ArchSketch__Master_x find its parent ArchSketch__Dependent_x to run relevant methods()
- So far so good
Link to External Doc
- Add a Link in one model to another document and save both files
- Open the model file with Link, it seems partial open the Documents
- It seems then, there are objects ( both in the Link and Linked Document ) can't be gotten and return NoneType errors
- Though in the attached Demo files, Only in the Link File the dependent/parent object can't be found and return NonType error
- Noted, in the demo Linked file, only the Link object ( but not the object ArchSketch__Dependent_1 which has PropertyLink to the ArchSketch__Master_1) is found in the fp.Inlist
(fp.Inlist should include PropertyLink ArchSketch__Dependent_1 as shown in the dependency graph)Code: Select all
10:57:29 fp.InList is - [<App::Link object>]
- So, there is no error return in this demo for those object in Linked model file (as they are not called)
(Can't yet single out the scenario / simplify the model files with both Linked / Link files return errors)
- Tried the "Disable partial loading of External Linked Objects"
- Still in complicated model, there are still traceback error complain Nonetype object, both in Linked and Link model files
- Tried open the 'Linked Document' first ( no compliant of cos), then the Link File
- Curiously, it seem on first open, there is still error; but on 2nd open of the Link File, no complaint ?
- For the attached demo mode files, "Disable partial loading of External Linked Objects" helps and no more complaints !
(Curious, though seem not a full 'fix', any way to Disable partial loading 'built-in' a model file, w/o user manual intervention ?)
Model File with Linked Object, and Parent/Child ArchSketch Objects
.
Model File with Link, and Parent/Child ArchSketch Objects .
On opening of File with Link, Error returned
See if you have any idea ? Thanks !realthunder wrote: Ping
OS: Fedora 31 (Workstation Edition) (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.20.25025 (Git)
Build type: Release
Branch: master
Hash: fb8b21ec43dca706a4aa2d63d59a4fb79f050369
Python version: 3.9.4
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.2
Locale: English/United States (en_US)