
블렌더에서는 이름으로 데이터를 찾기 때문에 이름이 바뀌면 액션의 데이터 호환이 안됩니다. 즉, 데이터는 있는데 모션이 깨지는 현상이 발생합니다. 이를 해결하는 원시적인 해결법은 본의 이름을 옛날 이름으로 바꾼 후, 다시 새 이름으로 바꿔주는 거예요. 이를 모든 액션에 돌아가며 해주면 돼요. 하지만 그걸 언제 해…
이럴 땐 아래의 코드를 복사해서 사용해 주세요. 따옴표 내의 SwordTrail부분을 고쳐서 사용하면 됩니다. 첫번째가 원래 이름, 두번째가 바뀐 이름입니다. ChatGPT가 초안을 짜주었고, 조금 다듬었습니다.
import bpy
def change_fcurve_group_and_data_path(action, old_group_name, new_group_name):
for fcurve in action.fcurves:
fcurve.data_path = fcurve.data_path.replace(old_group_name, new_group_name)
for fcurve in action.fcurves:
if fcurve.group and fcurve.group.name == old_group_name:
fcurve.group.name = new_group_name
def main():
# 모든 액션에 대해 작업
for action in bpy.data.actions:
change_fcurve_group_and_data_path(action, 'SwordTrail', 'sword_trail')
if __name__ == "__main__":
main()



