Part: allow TaskAttachmentEditor to install attacher extension on demand

This commit is contained in:
Zheng, Lei
2020-08-19 11:36:59 +08:00
committed by wmayer
parent 813b6b4df7
commit 0dd091e8c4

View File

@@ -187,6 +187,12 @@ class AttachmentEditorTaskPanel(FrozenClass):
self.callback_Apply = callback_Apply
self.obj = obj_to_attach
try:
if not self.obj.hasExtension('Part::AttachExtension'):
self.obj.addExtension('Part::AttachExtensionPython')
except Exception:
pass
if hasattr(obj_to_attach,'Attacher'):
self.attacher = obj_to_attach.Attacher
elif hasattr(obj_to_attach,'AttacherType'):