Blender Kitsu: Fix Don't replace existing actions during Check Action Names
#75
@ -108,7 +108,9 @@ class KITSU_OT_anim_check_action_names(bpy.types.Operator):
|
|||||||
"if they follow the Blender Studio naming convention"
|
"if they follow the Blender Studio naming convention"
|
||||||
)
|
)
|
||||||
wrong: List[Tuple[bpy.types.Action, str]] = []
|
wrong: List[Tuple[bpy.types.Action, str]] = []
|
||||||
|
created: List[Tuple[bpy.types.Action, str]] = []
|
||||||
cleanup_empty_actions: bpy.props.BoolProperty(name="Delete Empty Action Data-Blocks", default=False, description="Remove any empty action data-blocks, actions that have 0 Fcurves/Keyframes")
|
cleanup_empty_actions: bpy.props.BoolProperty(name="Delete Empty Action Data-Blocks", default=False, description="Remove any empty action data-blocks, actions that have 0 Fcurves/Keyframes")
|
||||||
|
|
||||||
# List of tuples that contains the action on index 0 with the wrong name
|
# List of tuples that contains the action on index 0 with the wrong name
|
||||||
# and the name it should have on index 1.
|
# and the name it should have on index 1.
|
||||||
|
|
||||||
@ -120,7 +122,9 @@ class KITSU_OT_anim_check_action_names(bpy.types.Operator):
|
|||||||
if bpy.data.actions.get(action_name):
|
if bpy.data.actions.get(action_name):
|
||||||
return bpy.data.actions.get(action_name)
|
return bpy.data.actions.get(action_name)
|
||||||
else:
|
else:
|
||||||
return bpy.data.actions.new(action_name)
|
new_action = bpy.data.actions.new(action_name)
|
||||||
|
self.created.append(new_action)
|
||||||
|
return new_action
|
||||||
|
|
||||||
def execute(self, context: bpy.types.Context) -> Set[str]:
|
def execute(self, context: bpy.types.Context) -> Set[str]:
|
||||||
active_shot = cache.shot_active_get()
|
active_shot = cache.shot_active_get()
|
||||||
@ -178,7 +182,9 @@ class KITSU_OT_anim_check_action_names(bpy.types.Operator):
|
|||||||
report_str += f" | Removed Empty Actions: {len(removed)}"
|
report_str += f" | Removed Empty Actions: {len(removed)}"
|
||||||
if failed:
|
if failed:
|
||||||
report_state = "WARNING"
|
report_state = "WARNING"
|
||||||
report_str += f" | Failed: {len(failed)}"
|
report_str += f" | Rename Failed: {len(failed)}"
|
||||||
|
if len(self.created) != 0:
|
||||||
|
report_str += f" | Created Actions: {len(self.created)}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user