[Blender_Kitsu] Add Operators to cleanup Animation Files #38
@ -273,22 +273,12 @@ class KITSU_OT_anim_enforce_naming_convention(bpy.types.Operator):
|
||||
layout.prop(self, "remove_str")
|
||||
|
||||
def rename_datablock(self, data_block, replace:str):
|
||||
if data_block is None:
|
||||
# Return Early if data_block is linked but not overriden
|
||||
if data_block is None or data_block.library is not None:
|
||||
return
|
||||
if replace in data_block.name:
|
||||
data_block.name = data_block.name.replace(replace,"")
|
||||
return (data_block.name)
|
||||
|
||||
def get_version_from_string(self, string:str):
|
||||
try:
|
||||
numbers = string.split(
|
||||
".v")[-1]
|
||||
if ".001" in numbers:
|
||||
numbers = int(numbers.replace(".001", ""))+1
|
||||
int_numbers = int(numbers)
|
||||
return str(int_numbers)
|
||||
except AttributeError:
|
||||
return "001"
|
||||
|
||||
def execute(self, context:bpy.types.Context):
|
||||
shot_base_name = bpy.path.basename(bpy.data.filepath).replace(".anim.blend","")
|
||||
|
Loading…
Reference in New Issue
Block a user