Fixed deletion of dressup - clearing child object pointer prevents Tree from moving it to the root of the tree.

This commit is contained in:
Markus Lampert
2017-06-24 23:51:13 -07:00
committed by Yorik van Havre
parent 7773d30c0d
commit 7d44c26b38
5 changed files with 7 additions and 2 deletions

View File

@@ -95,6 +95,7 @@ class ViewProviderDressup:
'''this makes sure that the base operation is added back to the project and visible'''
FreeCADGui.ActiveDocument.getObject(arg1.Object.Base.Name).Visibility = True
P.addToProject(arg1.Object.Base)
arg1.Object.Base = None
return True
class CommandPathDressup:

View File

@@ -975,6 +975,7 @@ class ViewProviderDressup:
'''this makes sure that the base operation is added back to the project and visible'''
FreeCADGui.ActiveDocument.getObject(arg1.Object.Base.Name).Visibility = True
PathUtils.addToJob(arg1.Object.Base)
arg1.Object.Base = None
return True
class CommandDressupDogbone:

View File

@@ -30,7 +30,7 @@ import Path
from PySide import QtCore, QtGui
import math
import DraftVecUtils as D
import PathScripts.PathUtils as P
import PathScripts.PathUtils as PathUtils
"""Dragknife Dressup object and FreeCAD command"""
@@ -458,7 +458,8 @@ class ViewProviderDressup:
def onDelete(self, arg1=None, arg2=None):
FreeCADGui.ActiveDocument.getObject(arg1.Object.Base.Name).Visibility = True
P.addToProject(arg1.Object.Base)
PathUtils.addToProject(arg1.Object.Base)
arg1.Object.Base = None
return True

View File

@@ -1465,6 +1465,7 @@ class ViewProviderDressup:
if obj:
obj.Visibility = True
PathUtils.addToJob(arg1.Object.Base)
arg1.Object.Base = None
return True
def updateData(self, obj, propName):

View File

@@ -564,6 +564,7 @@ class ViewProviderDressup:
'''this makes sure that the base operation is added back to the project and visible'''
FreeCADGui.ActiveDocument.getObject(arg1.Object.Base.Name).Visibility = True
PathUtils.addToJob(arg1.Object.Base)
arg1.Object.Base = None
return True
def __getstate__(self):