Added blender scripts

This commit is contained in:
2025-01-28 11:30:59 +03:00
parent d34369512b
commit 9107ccbaa3
27 changed files with 5759 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
import bpy
from .bones_pose import *
from .bones_data import *
from ..definitions import naming
def get_mixamo_prefix():
p = ""
rig = bpy.context.active_object
if 'mixamo_prefix' in rig.data.keys():
p = rig.data["mixamo_prefix"]
else:
for dbone in rig.data.bones:
if dbone.name.startswith("mixamorig") and ':' in dbone.name:
p = dbone.name.split(':')[0]+':'
break
try:
rig.data["mixamo_prefix"] = p
except:# context error
pass
return p
def get_mix_name(name, use_prefix):
if not use_prefix:
return name
else:
p = get_mixamo_prefix()
return p+name
def get_bone_side(bone_name):
if bone_name.endswith("_Left"):
return "Left"
elif bone_name.endswith("_Right"):
return "Right"