Allow deletion of dressup even if model is not setup correctly.

This commit is contained in:
Markus Lampert
2020-01-03 19:00:15 -08:00
parent edd46bc7d0
commit a0d7174a3d
7 changed files with 31 additions and 20 deletions
@@ -168,10 +168,12 @@ class ViewProviderDressup:
def onDelete(self, arg1=None, arg2=None):
'''this makes sure that the base operation is added back to the project and visible'''
# pylint: disable=unused-argument
FreeCADGui.ActiveDocument.getObject(arg1.Object.Base.Name).Visibility = True
job = PathUtils.findParentJob(arg1.Object)
job.Proxy.addOperation(arg1.Object.Base, arg1.Object)
arg1.Object.Base = None
if arg1.Object and arg1.Object.Base:
FreeCADGui.ActiveDocument.getObject(arg1.Object.Base.Name).Visibility = True
job = PathUtils.findParentJob(arg1.Object)
if job:
job.Proxy.addOperation(arg1.Object.Base, arg1.Object)
arg1.Object.Base = None
return True
class CommandPathDressup: