Merge pull request #6373 from Russ4262/fix/3d_surface_property_enumerations

Path: Correct restoration of 3D Surface property enumerations
This commit is contained in:
sliptonic
2022-02-18 10:57:11 -06:00
committed by GitHub

View File

@@ -433,7 +433,7 @@ class ObjectSurface(PathOp.ObjectOp):
]
@classmethod
def propertyEnumerations(self, dataType="data"):
def propertyEnumerations(cls, dataType="data"):
"""propertyEnumerations(dataType="data")... return property enumeration lists of specified dataType.
Args:
dataType = 'data', 'raw', 'translated'
@@ -607,15 +607,14 @@ class ObjectSurface(PathOp.ObjectOp):
obj.setEditorMode("ShowTempObjects", mode)
# Repopulate enumerations in case of changes
ENUMS = self.opPropertyEnumerations()
for n in ENUMS:
for prop, enums in ObjectSurface.propertyEnumerations():
restore = False
if hasattr(obj, n):
val = obj.getPropertyByName(n)
if hasattr(obj, prop):
val = obj.getPropertyByName(prop)
restore = True
setattr(obj, n, ENUMS[n])
setattr(obj, prop, enums)
if restore:
setattr(obj, n, val)
setattr(obj, prop, val)
self.setEditorProperties(obj)