From e38e27bac6ec06cd384b61cd739443de9fb7ffa9 Mon Sep 17 00:00:00 2001 From: BlueRose <378100977@qq.com> Date: Wed, 14 Feb 2024 22:48:39 +0800 Subject: [PATCH] vault backup: 2024-02-14 22:48:39 --- .../导出PSK_PSA脚本 & 部分UModel AES Key.md | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md b/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md index 821e09a..3995ec3 100644 --- a/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md +++ b/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md @@ -146,9 +146,14 @@ import math from io_import_scene_unreal_psa_psk_280 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' -psaPath = 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\ch\\ch0100\\05_Animation\\000_BM_N\\SK_ch0100.psa' -fbxExportPath = 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\ch\\ch0100\\05_Animation\\000_BM_N\\' +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\\25_SpAttack\\Battle\\c04\\' # 清空并且设置为60fps bpy.ops.scene.new(type='EMPTY') @@ -156,26 +161,25 @@ bpy.ops.object.select_all(action='SELECT') bpy.ops.object.delete() bpy.context.scene.render.fps = 60 + # 导入骨骼以及动画(所有NLA) pskimport(pskPath, bReorientBones = False, bImportmesh = False, bImportbone = True) psaimport(psaPath, bActionsToTrack = True) for obj in bpy.data.objects: - print(obj.type) + print(obj.type) if obj.type=='ARMATURE': currentSkeleton = obj print(currentSkeleton.animation_data.action) for action in bpy.data.actions: - # print(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) - # print(currentSkeleton.animation_data.action) - # print(bpy.data.objects["SM_ch0100.ao"].animation_data.action) + # print(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) + # print(currentSkeleton.animation_data.action) + # print(bpy.data.objects["SM_ch0100.ao"].animation_data.action) -# 清空动画数据 -currentSkeleton.animation_data_clear() ```