Merge pull request #2251 from realthunder/PathFix
Path: handle PathAreaOp object migration
This commit is contained in:
@@ -96,12 +96,16 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
obj.setEditorMode('PathParams', 2) # hide
|
||||
obj.addProperty("Part::PropertyPartShape", "removalshape", "Path")
|
||||
obj.setEditorMode('removalshape', 2) # hide
|
||||
|
||||
self.setupAdditionalProperties(obj)
|
||||
|
||||
self.initAreaOp(obj)
|
||||
|
||||
def setupAdditionalProperties(self, obj):
|
||||
if not hasattr(obj, 'UseRotation'):
|
||||
obj.addProperty("App::PropertyEnumeration", "UseRotation", "Path", QtCore.QT_TRANSLATE_NOOP("App::Property", "Use rotation to gain access to pockets/areas."))
|
||||
obj.UseRotation = ['Off', 'A(x)', 'B(y)', 'A & B']
|
||||
|
||||
self.initAreaOp(obj)
|
||||
|
||||
def initAreaOp(self, obj):
|
||||
'''initAreaOp(obj) ... overwrite if the receiver class needs initialisation.
|
||||
Can safely be overwritten by subclasses.'''
|
||||
@@ -152,6 +156,9 @@ class ObjectOp(PathOp.ObjectOp):
|
||||
for prop in ['AreaParams', 'PathParams', 'removalshape']:
|
||||
if hasattr(obj, prop):
|
||||
obj.setEditorMode(prop, 2)
|
||||
|
||||
self.setupAdditionalProperties(obj)
|
||||
|
||||
self.docRestored = True
|
||||
|
||||
self.areaOpOnDocumentRestored(obj)
|
||||
|
||||
Reference in New Issue
Block a user