vault backup: 2024-02-14 22:48:39

This commit is contained in:
BlueRose 2024-02-14 22:48:39 +08:00
parent cc57946c4c
commit e38e27bac6

View File

@ -146,9 +146,14 @@ import math
from io_import_scene_unreal_psa_psk_280 import * from io_import_scene_unreal_psa_psk_280 import *
from better_fbx import * from better_fbx import *
for action in bpy.data.actions:
bpy.data.actions.remove(action)
# 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\ch\\ch0100\\04_Mesh\\SM_ch0100.pskx'
# 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\no\\no0000\\04_Mesh\\SM_no0000_orbit.psk'
pskPath = 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\ch\\ch0100\\04_Mesh\\SM_ch0100.pskx' pskPath = 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\ch\\ch0100\\04_Mesh\\SM_ch0100.pskx'
psaPath = 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\ch\\ch0100\\05_Animation\\000_BM_N\\SK_ch0100.psa' psaPath = 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\ch\\ch0100\\25_SpAttack\\Battle\\c04\\AS_ElectricPole_ch0100_c04_ch0100.psa'
fbxExportPath = 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\ch\\ch0100\\05_Animation\\000_BM_N\\' fbxExportPath = 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\ch\\ch0100\\25_SpAttack\\Battle\\c04\\'
# 清空并且设置为60fps # 清空并且设置为60fps
bpy.ops.scene.new(type='EMPTY') bpy.ops.scene.new(type='EMPTY')
@ -156,26 +161,25 @@ bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete() bpy.ops.object.delete()
bpy.context.scene.render.fps = 60 bpy.context.scene.render.fps = 60
# 导入骨骼以及动画(所有NLA) # 导入骨骼以及动画(所有NLA)
pskimport(pskPath, bReorientBones = False, bImportmesh = False, bImportbone = True) pskimport(pskPath, bReorientBones = False, bImportmesh = False, bImportbone = True)
psaimport(psaPath, bActionsToTrack = True) psaimport(psaPath, bActionsToTrack = True)
for obj in bpy.data.objects: for obj in bpy.data.objects:
print(obj.type) print(obj.type)
if obj.type=='ARMATURE': if obj.type=='ARMATURE':
currentSkeleton = obj currentSkeleton = obj
print(currentSkeleton.animation_data.action) print(currentSkeleton.animation_data.action)
for action in bpy.data.actions: for action in bpy.data.actions:
# print(action) # print(action)
currentSkeleton.animation_data.action = action currentSkeleton.animation_data.action = action
bpy.ops.better_export.fbx(filepath= fbxExportPath+ action.name + ".fbx",my_fbx_format="binary",use_selection=False,use_visible=True) bpy.ops.better_export.fbx(filepath= fbxExportPath+ action.name + ".fbx",my_fbx_format="binary",use_selection=False,use_visible=True)
# print(currentSkeleton.animation_data.action) # print(currentSkeleton.animation_data.action)
# print(bpy.data.objects["SM_ch0100.ao"].animation_data.action) # print(bpy.data.objects["SM_ch0100.ao"].animation_data.action)
# 清空动画数据
currentSkeleton.animation_data_clear()
``` ```