diff --git a/add_curve_sapling/__init__.py b/add_curve_sapling/__init__.py index 9bcd1492335b8110e9e0ff8f1c54878e705d6627..6756797b5c9d473a5c698c7fda973c55627449a4 100644 --- a/add_curve_sapling/__init__.py +++ b/add_curve_sapling/__init__.py @@ -246,16 +246,21 @@ class AddTree(Operator): bl_label = "Sapling: Add Tree" bl_options = {'REGISTER', 'UNDO'} + # Keep the strings in memory, see T83360. + _objectList_static_strings = [] + def objectList(self, context): - objects = [] - bObjects = bpy.data.objects + objects = AddTree._objectList_static_strings + objects.clear() - for obj in bObjects: - if (obj.type in ['MESH', 'CURVE', 'SURFACE']) and (obj.name not in ['tree', 'leaves']): + for obj in bpy.data.objects: + if (obj.type in {'MESH', 'CURVE', 'SURFACE'}) and (obj.name not in {'tree', 'leaves'}): objects.append((obj.name, obj.name, "")) - return (objects if objects else - [('NONE', "No objects", "No appropriate objects in the Scene")]) + if not objects: + objects.append(('NONE', "No objects", "No appropriate objects in the Scene")) + + return objects def update_tree(self, context): self.do_update = True