From 743903796cd9af2e61d79b9746e156c641f6cc39 Mon Sep 17 00:00:00 2001 From: Jordan Elevons Date: Sat, 3 Feb 2024 03:01:26 -0500 Subject: [PATCH 1/7] added linked file support --- blender/arm/exporter.py | 58 ++++++++++++++++++++++++++++++++++++++--- blender/arm/make.py | 33 ++++++++++++++++++++++- 2 files changed, 87 insertions(+), 4 deletions(-) diff --git a/blender/arm/exporter.py b/blender/arm/exporter.py index bd73697535..c2952df108 100644 --- a/blender/arm/exporter.py +++ b/blender/arm/exporter.py @@ -29,6 +29,17 @@ from arm import assets, exporter_opt, log, make_renderpath from arm.material import cycles, make as make_material, mat_batch +# Global storage for the new file path +new_file_path = None +original_filename = None + +def get_exported_file_path(): + """Function to access the global new_file_path and original_filename.""" + global new_file_path, original_filename + print(f"Retrieving file path: {new_file_path}") + print(f"Retrieving original filename: {original_filename}") + return new_file_path, original_filename + if arm.is_reload(__name__): assets = arm.reload_module(assets) exporter_opt = arm.reload_module(exporter_opt) @@ -2344,15 +2355,54 @@ def export_objects(self, scene): def execute(self): """Exports the scene.""" + global new_file_path + global original_filename + profile_time = time.time() wrd = bpy.data.worlds['Arm'] if wrd.arm_verbose_output: print('Exporting ' + arm.utils.asset_name(self.scene)) if self.compress_enabled: print('Scene data will be compressed which might take a while.') - + current_frame, current_subframe = self.scene.frame_current, self.scene.frame_subframe - + + # Save current file path + original_file_path = bpy.data.filepath + original_filename = original_file_path + + print(f'Saved filepath {original_file_path}') + + # Create new file path + savedcopy_file_path = original_file_path.replace('.blend', '-original.blend') + + print(f"Copying file to: {savedcopy_file_path}") + + # Set global variable to the new file so we can pass it to make.py. + new_file_path = savedcopy_file_path + + print(f"Setting new file path: {new_file_path}") + + # Save a copy of the current file + bpy.ops.wm.save_as_mainfile(filepath=savedcopy_file_path, copy=True) + + # Select all collections and make duplicates real + print("Making linked duplicates real - Start") + + # Code to make linked duplicates real + for obj in bpy.context.scene.objects: + if obj.instance_type == 'COLLECTION': + bpy.context.view_layer.objects.active = obj + obj.select_set(True) + bpy.ops.object.duplicates_make_real(use_hierarchy=True) + obj.select_set(False) + + # Debug line for execution completion + print("Making linked duplicates real - Complete") + + # Save changes to the duplicated file + bpy.ops.wm.save_mainfile() + scene_objects: List[bpy.types.Object] = self.scene.collection.all_objects.values() # bobject => blender object for bobject in scene_objects: @@ -2525,9 +2575,11 @@ def execute(self): # Restore frame if self.scene.frame_current != current_frame: self.scene.frame_set(current_frame, subframe=current_subframe) - + + if wrd.arm_verbose_output: print('Scene exported in {:0.3f}s'.format(time.time() - profile_time)) + def create_default_camera(self, is_viewport_camera=False): """Creates the default camera and adds a WalkNavigation trait to it.""" diff --git a/blender/arm/make.py b/blender/arm/make.py index b633bdc34b..0ce9dfa472 100644 --- a/blender/arm/make.py +++ b/blender/arm/make.py @@ -31,6 +31,9 @@ import arm.utils_vs import arm.write_data as write_data +#Used for scene duplication and restoration. +from arm.exporter import get_exported_file_path + if arm.is_reload(__name__): assets = arm.reload_module(assets) arm.exporter = arm.reload_module(arm.exporter) @@ -500,7 +503,35 @@ def play_done(): state.redraw_ui = True log.clear() live_patch.stop() - + + # Call the new function for handling file operations at the end of play_done + handle_reloading_originals() + + +def handle_reloading_originals(): + """Handles the file operations of opening, saving, and deleting files.""" + new_file_path, original_filename = get_exported_file_path() + if new_file_path: + bpy.ops.wm.open_mainfile(filepath=new_file_path) + print("Loaded original file copy.") + if original_filename and os.path.exists(original_filename): + try: + os.remove(original_filename) + print(f"Deleted original file at: {original_filename}") + bpy.ops.wm.save_as_mainfile(filepath=original_filename) + print(f"Saved the file to the original filename: {original_filename}") + except OSError as e: + print(f"Error deleting {original_filename}: {e.strerror}") + + if new_file_path and os.path.exists(new_file_path) and new_file_path != original_filename: + try: + os.remove(new_file_path) + print(f"Deleted temporary file at: {new_file_path}") + except OSError as e: + print(f"Error deleting {new_file_path}: {e.strerror}") + else: + print("Failed to retrieve new file path.") + def assets_done(): if state.proc_build == None: return From c7214f5f79152383a76eed5b56f94c482c504ac0 Mon Sep 17 00:00:00 2001 From: Jordan Elevons Date: Sun, 4 Feb 2024 07:19:30 -0500 Subject: [PATCH 2/7] Revert "added linked file support" This reverts commit 743903796cd9af2e61d79b9746e156c641f6cc39. --- blender/arm/exporter.py | 58 +++-------------------------------------- blender/arm/make.py | 33 +---------------------- 2 files changed, 4 insertions(+), 87 deletions(-) diff --git a/blender/arm/exporter.py b/blender/arm/exporter.py index c2952df108..bd73697535 100644 --- a/blender/arm/exporter.py +++ b/blender/arm/exporter.py @@ -29,17 +29,6 @@ from arm import assets, exporter_opt, log, make_renderpath from arm.material import cycles, make as make_material, mat_batch -# Global storage for the new file path -new_file_path = None -original_filename = None - -def get_exported_file_path(): - """Function to access the global new_file_path and original_filename.""" - global new_file_path, original_filename - print(f"Retrieving file path: {new_file_path}") - print(f"Retrieving original filename: {original_filename}") - return new_file_path, original_filename - if arm.is_reload(__name__): assets = arm.reload_module(assets) exporter_opt = arm.reload_module(exporter_opt) @@ -2355,54 +2344,15 @@ def export_objects(self, scene): def execute(self): """Exports the scene.""" - global new_file_path - global original_filename - profile_time = time.time() wrd = bpy.data.worlds['Arm'] if wrd.arm_verbose_output: print('Exporting ' + arm.utils.asset_name(self.scene)) if self.compress_enabled: print('Scene data will be compressed which might take a while.') - + current_frame, current_subframe = self.scene.frame_current, self.scene.frame_subframe - - # Save current file path - original_file_path = bpy.data.filepath - original_filename = original_file_path - - print(f'Saved filepath {original_file_path}') - - # Create new file path - savedcopy_file_path = original_file_path.replace('.blend', '-original.blend') - - print(f"Copying file to: {savedcopy_file_path}") - - # Set global variable to the new file so we can pass it to make.py. - new_file_path = savedcopy_file_path - - print(f"Setting new file path: {new_file_path}") - - # Save a copy of the current file - bpy.ops.wm.save_as_mainfile(filepath=savedcopy_file_path, copy=True) - - # Select all collections and make duplicates real - print("Making linked duplicates real - Start") - - # Code to make linked duplicates real - for obj in bpy.context.scene.objects: - if obj.instance_type == 'COLLECTION': - bpy.context.view_layer.objects.active = obj - obj.select_set(True) - bpy.ops.object.duplicates_make_real(use_hierarchy=True) - obj.select_set(False) - - # Debug line for execution completion - print("Making linked duplicates real - Complete") - - # Save changes to the duplicated file - bpy.ops.wm.save_mainfile() - + scene_objects: List[bpy.types.Object] = self.scene.collection.all_objects.values() # bobject => blender object for bobject in scene_objects: @@ -2575,11 +2525,9 @@ def execute(self): # Restore frame if self.scene.frame_current != current_frame: self.scene.frame_set(current_frame, subframe=current_subframe) - - + if wrd.arm_verbose_output: print('Scene exported in {:0.3f}s'.format(time.time() - profile_time)) - def create_default_camera(self, is_viewport_camera=False): """Creates the default camera and adds a WalkNavigation trait to it.""" diff --git a/blender/arm/make.py b/blender/arm/make.py index 0ce9dfa472..b633bdc34b 100644 --- a/blender/arm/make.py +++ b/blender/arm/make.py @@ -31,9 +31,6 @@ import arm.utils_vs import arm.write_data as write_data -#Used for scene duplication and restoration. -from arm.exporter import get_exported_file_path - if arm.is_reload(__name__): assets = arm.reload_module(assets) arm.exporter = arm.reload_module(arm.exporter) @@ -503,35 +500,7 @@ def play_done(): state.redraw_ui = True log.clear() live_patch.stop() - - # Call the new function for handling file operations at the end of play_done - handle_reloading_originals() - - -def handle_reloading_originals(): - """Handles the file operations of opening, saving, and deleting files.""" - new_file_path, original_filename = get_exported_file_path() - if new_file_path: - bpy.ops.wm.open_mainfile(filepath=new_file_path) - print("Loaded original file copy.") - if original_filename and os.path.exists(original_filename): - try: - os.remove(original_filename) - print(f"Deleted original file at: {original_filename}") - bpy.ops.wm.save_as_mainfile(filepath=original_filename) - print(f"Saved the file to the original filename: {original_filename}") - except OSError as e: - print(f"Error deleting {original_filename}: {e.strerror}") - - if new_file_path and os.path.exists(new_file_path) and new_file_path != original_filename: - try: - os.remove(new_file_path) - print(f"Deleted temporary file at: {new_file_path}") - except OSError as e: - print(f"Error deleting {new_file_path}: {e.strerror}") - else: - print("Failed to retrieve new file path.") - + def assets_done(): if state.proc_build == None: return From 6a504524cfa715282f86832d3210f712cd730880 Mon Sep 17 00:00:00 2001 From: Jordan Elevons Date: Mon, 12 Feb 2024 12:05:45 -0500 Subject: [PATCH 3/7] Added an array variable --- blender/arm/exporter.py | 22 ++++- blender/arm/props_properties.py | 150 ++++++++++++++++++++++++++++++-- 2 files changed, 162 insertions(+), 10 deletions(-) diff --git a/blender/arm/exporter.py b/blender/arm/exporter.py index bd73697535..c81df446ff 100644 --- a/blender/arm/exporter.py +++ b/blender/arm/exporter.py @@ -784,11 +784,31 @@ def export_object(self, bobject: bpy.types.Object, out_parent: Dict = None) -> N if len(bobject.arm_propertylist) > 0: out_object['properties'] = [] for proplist_item in bobject.arm_propertylist: + # Check if the property is a collection (array type). + if proplist_item.type_prop == 'array': + # Convert the collection to a list. + collection_value = getattr(proplist_item, 'array_prop') + value = [] + for item in collection_value: + if item.string_prop != "": + value.append(item.string_prop) + elif item.integer_prop != 0: + value.append(item.integer_prop) + elif item.float_prop != 0.0: + value.append(item.float_prop) + elif item.boolean_prop is not False: + value.append(item.boolean_prop) + else: + # Handle other types of properties. + value = getattr(proplist_item, proplist_item.type_prop + '_prop') + out_property = { 'name': proplist_item.name_prop, - 'value': getattr(proplist_item, proplist_item.type_prop + '_prop')} + 'value': value + } out_object['properties'].append(out_property) + # Export the object reference and material references objref = bobject.data if objref is not None: diff --git a/blender/arm/props_properties.py b/blender/arm/props_properties.py index b7fb24ed20..fe5ae894a9 100644 --- a/blender/arm/props_properties.py +++ b/blender/arm/props_properties.py @@ -2,12 +2,31 @@ from bpy.types import Menu, Panel, UIList from bpy.props import * + +class ArmArrayItem(bpy.types.PropertyGroup): + # Name property for each array item + name_prop: StringProperty(name="Name", default="Item") + index_prop = bpy.props.IntProperty( + name="Index", + description="Index of the item", + default=0, + options={'HIDDEN', 'SKIP_SAVE'} + ) + + # Properties for each type + string_prop: StringProperty(name="String", default="") + integer_prop: IntProperty(name="Integer", default=0) + float_prop: FloatProperty(name="Float", default=0.0) + boolean_prop: BoolProperty(name="Boolean", default=False) + + class ArmPropertyListItem(bpy.types.PropertyGroup): type_prop: EnumProperty( items = [('string', 'String', 'String'), ('integer', 'Integer', 'Integer'), ('float', 'Float', 'Float'), ('boolean', 'Boolean', 'Boolean'), + ('array', 'Array', 'Array'), ], name = "Type") name_prop: StringProperty(name="Name", description="A name for this item", default="my_prop") @@ -15,6 +34,89 @@ class ArmPropertyListItem(bpy.types.PropertyGroup): integer_prop: IntProperty(name="Integer", description="A name for this item", default=0) float_prop: FloatProperty(name="Float", description="A name for this item", default=0.0) boolean_prop: BoolProperty(name="Boolean", description="A name for this item", default=False) + array_prop: CollectionProperty(type=ArmArrayItem) + new_array_item_type: EnumProperty( + items = [ + ('string', 'String', 'String'), + ('integer', 'Integer', 'Integer'), + ('float', 'Float', 'Float'), + ('boolean', 'Boolean', 'Boolean'), + # Add more types here as needed + ], + name = "New Item Type", + default = 'string' + ) + +class ARM_UL_ArrayItemList(bpy.types.UIList): + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): + # Use the item's index within the array as its uneditable name + array_type = data.new_array_item_type + + if self.layout_type in {'DEFAULT', 'COMPACT'}: + # Display the index of the item as its name in a non-editable label + layout.label(text=str(index)) + + # Display the appropriate property based on the array type + if array_type == 'string': + layout.prop(item, "string_prop", text="") + elif array_type == 'integer': + layout.prop(item, "integer_prop", text="") + elif array_type == 'float': + layout.prop(item, "float_prop", text="") + elif array_type == 'boolean': + layout.prop(item, "boolean_prop", text="") + # Add other types as needed + elif self.layout_type in {'GRID'}: + layout.alignment = 'CENTER' + layout.label(text="", icon="OBJECT_DATAMODE") + + +class ArmArrayAddItem(bpy.types.Operator): + bl_idname = "arm_array.add_item" + bl_label = "Add Array Item" + + def execute(self, context): + obj = bpy.context.object + if obj.arm_propertylist and obj.arm_propertylist_index < len(obj.arm_propertylist): + selected_item = obj.arm_propertylist[obj.arm_propertylist_index] + + # Create a new item in the array + new_item = selected_item.array_prop.add() + + # Set the type of the new item based on the selected type + new_item_type = selected_item.new_array_item_type + if new_item_type == 'string': + new_item.string_prop = "" # Default value for string + elif new_item_type == 'integer': + new_item.integer_prop = 0 # Default value for integer + elif new_item_type == 'float': + new_item.float_prop = 0.0 # Default value for float + elif new_item_type == 'boolean': + new_item.boolean_prop = False # Default value for boolean + + # Set the index of the new item + new_item_index = len(selected_item.array_prop) - 1 + new_item.index_prop = new_item_index + + # Update the array index + selected_item.array_index = new_item_index + + return {'FINISHED'} + +# Operator to remove an item from the array +class ArmArrayRemoveItem(bpy.types.Operator): + bl_idname = "arm_array.remove_item" + bl_label = "Remove Array Item" + + def execute(self, context): + obj = bpy.context.object + if obj.arm_propertylist and obj.arm_propertylist_index < len(obj.arm_propertylist): + selected_item = obj.arm_propertylist[obj.arm_propertylist_index] + if selected_item.array_prop: + selected_item.array_prop.remove(selected_item.array_index) + if selected_item.array_index > 0: + selected_item.array_index -= 1 + return {'FINISHED'} class ARM_UL_PropertyList(bpy.types.UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): @@ -37,6 +139,8 @@ class ArmPropertyListNewItem(bpy.types.Operator): ('integer', 'Integer', 'Integer'), ('float', 'Float', 'Float'), ('boolean', 'Boolean', 'Boolean'), + ('array', 'Array', 'Array'), + ], name = "Type") @@ -126,28 +230,54 @@ def execute(self, context): def draw_properties(layout, obj): layout.label(text="Properties") - rows = 2 - if len(obj.arm_traitlist) > 1: - rows = 4 + + # Draw the ARM_UL_PropertyList + rows = 4 if len(obj.arm_propertylist) > 1 else 2 row = layout.row() row.template_list("ARM_UL_PropertyList", "The_List", obj, "arm_propertylist", obj, "arm_propertylist_index", rows=rows) + + # Column for buttons next to ARM_UL_PropertyList col = row.column(align=True) - op = col.operator("arm_propertylist.new_item", icon='ADD', text="") - op = col.operator("arm_propertylist.delete_item", icon='REMOVE', text="") + col.operator("arm_propertylist.new_item", icon='ADD', text="") + col.operator("arm_propertylist.delete_item", icon='REMOVE', text="") if len(obj.arm_propertylist) > 1: col.separator() - op = col.operator("arm_propertylist.move_item", icon='TRIA_UP', text="") - op.direction = 'UP' - op = col.operator("arm_propertylist.move_item", icon='TRIA_DOWN', text="") - op.direction = 'DOWN' + col.operator("arm_propertylist.move_item", icon='TRIA_UP', text="").direction = 'UP' + col.operator("arm_propertylist.move_item", icon='TRIA_DOWN', text="").direction = 'DOWN' + + # Draw UI List for array items if the selected property is an array + if obj.arm_propertylist and obj.arm_propertylist_index < len(obj.arm_propertylist): + selected_item = obj.arm_propertylist[obj.arm_propertylist_index] + if selected_item.type_prop == 'array': + layout.label(text="Array Items") + + # Dropdown to select the type of new array items + layout.prop(selected_item, "new_array_item_type", text="New Item Type") + + # Template list for array items + row = layout.row() + row.template_list("ARM_UL_ArrayItemList", "", selected_item, "array_prop", selected_item, "array_index", rows=rows) + + # Column for buttons next to the array items list + col = row.column(align=True) + col.operator("arm_array.add_item", icon='ADD', text="") + col.operator("arm_array.remove_item", icon='REMOVE', text="") + + + + __REG_CLASSES = ( + ArmArrayItem, ArmPropertyListItem, ARM_UL_PropertyList, + ARM_UL_ArrayItemList, ArmPropertyListNewItem, ArmPropertyListDeleteItem, ArmPropertyListMoveItem, + ArmArrayAddItem, + ArmArrayRemoveItem, ) __reg_classes, unregister = bpy.utils.register_classes_factory(__REG_CLASSES) @@ -156,3 +286,5 @@ def register(): __reg_classes() bpy.types.Object.arm_propertylist = CollectionProperty(type=ArmPropertyListItem) bpy.types.Object.arm_propertylist_index = IntProperty(name="Index for arm_propertylist", default=0) + # New property for tracking the active index in array items + bpy.types.PropertyGroup.array_index = IntProperty(name="Array Index", default=0) From 0e47339f8c9d88c7fb7b7ebc872f03ad3cc90a43 Mon Sep 17 00:00:00 2001 From: Jordan Elevons Date: Tue, 13 Feb 2024 05:32:27 -0500 Subject: [PATCH 4/7] Update exporter.py --- blender/arm/exporter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blender/arm/exporter.py b/blender/arm/exporter.py index c81df446ff..e7a067d832 100644 --- a/blender/arm/exporter.py +++ b/blender/arm/exporter.py @@ -786,17 +786,17 @@ def export_object(self, bobject: bpy.types.Object, out_parent: Dict = None) -> N for proplist_item in bobject.arm_propertylist: # Check if the property is a collection (array type). if proplist_item.type_prop == 'array': - # Convert the collection to a list. + # Convert the collection to a list. collection_value = getattr(proplist_item, 'array_prop') value = [] for item in collection_value: - if item.string_prop != "": + if hasattr(item, 'string_prop'): value.append(item.string_prop) - elif item.integer_prop != 0: + elif hasattr(item, 'integer_prop'): value.append(item.integer_prop) - elif item.float_prop != 0.0: + elif hasattr(item, 'float_prop'): value.append(item.float_prop) - elif item.boolean_prop is not False: + elif hasattr(item, 'boolean_prop'): value.append(item.boolean_prop) else: # Handle other types of properties. From 63ad5b52b18f601c3a2b11f77945873d18074ea4 Mon Sep 17 00:00:00 2001 From: Jordan Elevons Date: Tue, 13 Feb 2024 05:50:40 -0500 Subject: [PATCH 5/7] Update exporter.py --- blender/arm/exporter.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/blender/arm/exporter.py b/blender/arm/exporter.py index e7a067d832..2f9428d3c6 100644 --- a/blender/arm/exporter.py +++ b/blender/arm/exporter.py @@ -787,17 +787,10 @@ def export_object(self, bobject: bpy.types.Object, out_parent: Dict = None) -> N # Check if the property is a collection (array type). if proplist_item.type_prop == 'array': # Convert the collection to a list. + array_type = proplist_item.new_array_item_type collection_value = getattr(proplist_item, 'array_prop') - value = [] - for item in collection_value: - if hasattr(item, 'string_prop'): - value.append(item.string_prop) - elif hasattr(item, 'integer_prop'): - value.append(item.integer_prop) - elif hasattr(item, 'float_prop'): - value.append(item.float_prop) - elif hasattr(item, 'boolean_prop'): - value.append(item.boolean_prop) + property_name = array_type + '_prop' + value = [str(getattr(item, property_name)) for item in collection_value] else: # Handle other types of properties. value = getattr(proplist_item, proplist_item.type_prop + '_prop') From 31ff6ba40048f67ad4d53b3f7e4fc35a24e52e30 Mon Sep 17 00:00:00 2001 From: Jordan Elevons Date: Tue, 13 Feb 2024 07:43:53 -0500 Subject: [PATCH 6/7] removed "new" from array property --- blender/arm/exporter.py | 2 +- blender/arm/props_properties.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/blender/arm/exporter.py b/blender/arm/exporter.py index 2f9428d3c6..bf5822e6a3 100644 --- a/blender/arm/exporter.py +++ b/blender/arm/exporter.py @@ -787,7 +787,7 @@ def export_object(self, bobject: bpy.types.Object, out_parent: Dict = None) -> N # Check if the property is a collection (array type). if proplist_item.type_prop == 'array': # Convert the collection to a list. - array_type = proplist_item.new_array_item_type + array_type = proplist_item.array_item_type collection_value = getattr(proplist_item, 'array_prop') property_name = array_type + '_prop' value = [str(getattr(item, property_name)) for item in collection_value] diff --git a/blender/arm/props_properties.py b/blender/arm/props_properties.py index fe5ae894a9..489ca890b4 100644 --- a/blender/arm/props_properties.py +++ b/blender/arm/props_properties.py @@ -26,7 +26,7 @@ class ArmPropertyListItem(bpy.types.PropertyGroup): ('integer', 'Integer', 'Integer'), ('float', 'Float', 'Float'), ('boolean', 'Boolean', 'Boolean'), - ('array', 'Array', 'Array'), + ('array', 'Array', 'Array'), ], name = "Type") name_prop: StringProperty(name="Name", description="A name for this item", default="my_prop") @@ -35,7 +35,7 @@ class ArmPropertyListItem(bpy.types.PropertyGroup): float_prop: FloatProperty(name="Float", description="A name for this item", default=0.0) boolean_prop: BoolProperty(name="Boolean", description="A name for this item", default=False) array_prop: CollectionProperty(type=ArmArrayItem) - new_array_item_type: EnumProperty( + array_item_type: EnumProperty( items = [ ('string', 'String', 'String'), ('integer', 'Integer', 'Integer'), @@ -50,7 +50,7 @@ class ArmPropertyListItem(bpy.types.PropertyGroup): class ARM_UL_ArrayItemList(bpy.types.UIList): def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): # Use the item's index within the array as its uneditable name - array_type = data.new_array_item_type + array_type = data.array_item_type if self.layout_type in {'DEFAULT', 'COMPACT'}: # Display the index of the item as its name in a non-editable label @@ -84,7 +84,7 @@ def execute(self, context): new_item = selected_item.array_prop.add() # Set the type of the new item based on the selected type - new_item_type = selected_item.new_array_item_type + new_item_type = selected_item.array_item_type if new_item_type == 'string': new_item.string_prop = "" # Default value for string elif new_item_type == 'integer': @@ -252,7 +252,7 @@ def draw_properties(layout, obj): layout.label(text="Array Items") # Dropdown to select the type of new array items - layout.prop(selected_item, "new_array_item_type", text="New Item Type") + layout.prop(selected_item, "array_item_type", text="New Item Type") # Template list for array items row = layout.row() From 6b13832c766494244bdfadc0af5e3e4b5231a461 Mon Sep 17 00:00:00 2001 From: Jordan Elevons Date: Tue, 13 Feb 2024 10:28:44 -0500 Subject: [PATCH 7/7] Update props_properties.py --- blender/arm/props_properties.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blender/arm/props_properties.py b/blender/arm/props_properties.py index 489ca890b4..935c946941 100644 --- a/blender/arm/props_properties.py +++ b/blender/arm/props_properties.py @@ -252,7 +252,7 @@ def draw_properties(layout, obj): layout.label(text="Array Items") # Dropdown to select the type of new array items - layout.prop(selected_item, "array_item_type", text="New Item Type") + layout.prop(selected_item, "array_item_type", text="Array Type") # Template list for array items row = layout.row()