Fem: Fix link scope for Python objects

This commit is contained in:
marioalexis
2024-07-28 16:11:47 -03:00
parent fd5eb34d6a
commit f8a0a0a727
6 changed files with 94 additions and 53 deletions

View File

@@ -65,3 +65,10 @@ class _PropHelper:
obj.addProperty(**self.info)
obj.setPropertyStatus(self.name, "LockDynamic")
setattr(obj, self.name, self.value)
def handle_change_type(self, obj, old_type, convert_old_value=lambda x: x):
if obj.getTypeIdOfProperty(self.name) == old_type:
self.value = convert_old_value(obj.getPropertyByName(self.name))
obj.setPropertyStatus(self.name, "-LockDynamic")
obj.removeProperty(self.name)
self.add_to_object(obj)