1
Fork 0

Remove hardcoded armature name

This commit is contained in:
redstrate 2021-08-12 07:13:04 -04:00
parent 9ac8a43f9e
commit 29e21774f1

View file

@ -77,7 +77,7 @@ class AvatarPrepOp(bpy.types.Operator):
perform_quest_optimizations: bpy.props.BoolProperty() perform_quest_optimizations: bpy.props.BoolProperty()
def execute(self, context): 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 # 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') 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, # bpy.data,
# "collections") # "collections")
self.layout.prop_search(context.scene,
"rat_armature",
bpy.data,
"objects")
self.layout.operator(AvatarPrepOp.bl_idname) self.layout.operator(AvatarPrepOp.bl_idname)
self.layout.operator(AvatarBakeOp.bl_idname) self.layout.operator(AvatarBakeOp.bl_idname)
self.layout.operator(AvatarBakeQuestOp.bl_idname) self.layout.operator(AvatarBakeQuestOp.bl_idname)
@ -310,6 +315,7 @@ class ExportPanel(ToolPanel, bpy.types.Panel):
def register(): def register():
bpy.utils.register_class(RATAddonPreferences) bpy.utils.register_class(RATAddonPreferences)
bpy.types.Scene.rat_armature = StringProperty(default="None")
bpy.types.Scene.master_collection = StringProperty(default="None") bpy.types.Scene.master_collection = StringProperty(default="None")
bpy.types.Scene.hair_collection = StringProperty(default="None") bpy.types.Scene.hair_collection = StringProperty(default="None")