I just tested my patch, and it seems to work. As I said in your pull request, just use the migrate function before setting the properties.
Code: Select all
def onDocumentRestored(self, obj):
self.migrate_attributes(obj)
self.setProperties(obj)
...
Code: Select all
import Draft
all = App.ActiveDocument.Objects
for obj in all:
App.ActiveDocument.getObject(obj.Name).Visibility = False
for obj in all:
if Draft.get_type(obj) == "Array":
print(obj.Label, obj.Proxy.__dict__)
App.ActiveDocument.getObject(obj.Name).Visibility = True
print()
for obj in all:
if Draft.get_type(obj) == "PathArray":
print(obj.Label, obj.Proxy.__dict__)
App.ActiveDocument.getObject(obj.Name).Visibility = True
Code: Select all
if self.use_link and "ExpandArray" not in pl:
_tip = _tr("Show array element as children object")
obj.addProperty("App::PropertyBool","ExpandArray", "Parameters", _tip)
obj.ExpandArray = False
obj.setPropertyStatus('Shape','Transient')