From 29e21774f1c05fccc6ec834e83457dd0bbf87d42 Mon Sep 17 00:00:00 2001 From: redstrate Date: Thu, 12 Aug 2021 07:13:04 -0400 Subject: [PATCH] Remove hardcoded armature name --- __init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 4a7e615..2261583 100644 --- a/__init__.py +++ b/__init__.py @@ -77,7 +77,7 @@ class AvatarPrepOp(bpy.types.Operator): perform_quest_optimizations: bpy.props.BoolProperty() def execute(self, context): - arm_ob = recurLayerCollection(bpy.context.view_layer.layer_collection, 'Master').collection.objects['Armature.002'] + arm_ob = recurLayerCollection(bpy.context.view_layer.layer_collection, 'Master').collection.objects[context.scene.rat_armature] # we are going to prep the hair for export first, and then add it into the collection bpy.context.view_layer.active_layer_collection = recurLayerCollection(bpy.context.view_layer.layer_collection, 'original hair') @@ -303,6 +303,11 @@ class ExportPanel(ToolPanel, bpy.types.Panel): # bpy.data, # "collections") + self.layout.prop_search(context.scene, + "rat_armature", + bpy.data, + "objects") + self.layout.operator(AvatarPrepOp.bl_idname) self.layout.operator(AvatarBakeOp.bl_idname) self.layout.operator(AvatarBakeQuestOp.bl_idname) @@ -310,6 +315,7 @@ class ExportPanel(ToolPanel, bpy.types.Panel): def register(): bpy.utils.register_class(RATAddonPreferences) + bpy.types.Scene.rat_armature = StringProperty(default="None") bpy.types.Scene.master_collection = StringProperty(default="None") bpy.types.Scene.hair_collection = StringProperty(default="None")