assembly: fix handling of undo/redo
This commit is contained in:
parent
1a96bb2805
commit
5b2583cddc
24
assembly.py
24
assembly.py
|
@ -280,7 +280,9 @@ class AsmPartGroup(AsmGroup):
|
|||
return 1 if self.getAssembly().frozen else 0
|
||||
|
||||
def onChanged(self,obj,prop):
|
||||
if obj.Removing or FreeCAD.isRestoring():
|
||||
if obj.Removing or FreeCAD.isRestoring() :
|
||||
return
|
||||
if obj.Document and getattr(obj.Document,'Transacting',False):
|
||||
return
|
||||
if prop == 'DerivedFrom':
|
||||
self.checkDerivedParts()
|
||||
|
@ -481,6 +483,10 @@ class AsmElement(AsmBase):
|
|||
parent = getattr(self,'parent',None)
|
||||
if not parent or obj.Removing or FreeCAD.isRestoring():
|
||||
return
|
||||
if obj.Document and getattr(obj.Document,'Transacting',False):
|
||||
if prop == 'Label':
|
||||
parent.Object.cacheChildLabel()
|
||||
return
|
||||
if prop=='Offset':
|
||||
self.updatePlacement()
|
||||
return
|
||||
|
@ -1282,10 +1288,17 @@ class AsmElementLink(AsmBase):
|
|||
not getattr(self,'parent',None) or \
|
||||
FreeCAD.isRestoring():
|
||||
return
|
||||
if obj.Document and getattr(obj.Document,'Transacting',False):
|
||||
self.infos *= 0 # clear the list
|
||||
self.info = None
|
||||
return
|
||||
if prop == 'Count':
|
||||
self.infos *= 0 # clear the list
|
||||
self.info = None
|
||||
return
|
||||
if prop == 'Offset':
|
||||
self.getInfo(True)
|
||||
return
|
||||
if prop == 'NoExpand':
|
||||
cstr = self.parent.Object
|
||||
if obj!=flattenGroup(cstr)[0] \
|
||||
|
@ -1294,9 +1307,6 @@ class AsmElementLink(AsmBase):
|
|||
self.setLink(self.getAssembly().getPartGroup(),
|
||||
self.getElementSubname(True))
|
||||
return
|
||||
if prop == 'Offset':
|
||||
self.getInfo(True)
|
||||
return
|
||||
if prop == 'Label':
|
||||
if obj.Document and getattr(obj.Document,'Transacting',False):
|
||||
return
|
||||
|
@ -1652,6 +1662,8 @@ class AsmConstraint(AsmGroup):
|
|||
Constraint.setDisable(obj)
|
||||
|
||||
def onChanged(self,obj,prop):
|
||||
if obj.Document and getattr(obj.Document,'Transacting',False):
|
||||
return
|
||||
if not obj.Removing and prop not in _IgnoredProperties:
|
||||
if prop == Constraint.propMultiply() and not FreeCAD.isRestoring():
|
||||
self.checkMultiply()
|
||||
|
@ -2299,6 +2311,8 @@ class AsmConstraintGroup(AsmGroup):
|
|||
def onChanged(self,obj,prop):
|
||||
if obj.Removing or FreeCAD.isRestoring():
|
||||
return
|
||||
if obj.Document and getattr(obj.Document,'Transacting',False):
|
||||
return
|
||||
if prop not in _IgnoredProperties:
|
||||
System.onChanged(obj,prop)
|
||||
Assembly.autoSolve(obj,prop)
|
||||
|
@ -3263,6 +3277,8 @@ class Assembly(AsmGroup):
|
|||
not getattr(self,'Object',None) or \
|
||||
FreeCAD.isRestoring():
|
||||
return
|
||||
if obj.Document and getattr(obj.Document,'Transacting',False):
|
||||
return
|
||||
if prop == 'BuildShape':
|
||||
self.buildShape()
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user