diff --git a/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md b/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md index 5559ee8..f927274 100644 --- a/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md +++ b/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md @@ -36,6 +36,37 @@ for root, subdirs, files in os.walk(pskPath): bpy.ops.export_scene.fbx(filepath=fbx_file,add_leaf_bones=False) ``` +直接生成fbx版本 +```python +import bpy +import os +import math +from io_import_scene_unreal_psa_psk_280 import * + +pskPath = 'C:\\Users\\BlueRose\\Desktop\\ScarletNexus\\Game\\Character\\wp\\wp0100\\04_Mesh' + +for modelroot, modeldirs, modelfiles in os.walk(pskPath): + for f in modelfiles: + if f.endswith('.psk'): + psk_file = os.path.join(modelroot, f) + fbx_file = os.path.splitext(psk_file)[0] + ".fbx" + # 清空场景 + bpy.ops.object.select_all(action='SELECT') + bpy.ops.object.delete() + pskimport(psk_file, bReorientBones = False) + # 使用SmoothShading + for obj in bpy.data.objects: + if obj.type=='MESH': + obj.data.use_auto_smooth = True + obj.data.auto_smooth_angle = math.radians(180) + currentmesh = obj.data + for setting in currentmesh.polygons: + setting.use_smooth = True + + # 输出骨骼模型 + bpy.ops.object.select_all(action='SELECT') + bpy.ops.export_scene.fbx(filepath=fbx_file,add_leaf_bones=False) +``` # PSA 注意:该脚本因为Blender运行bug,会导致输出的FBX文件越来越大,越来越慢。一次转换的量不建议超过50个。建议分几个文件夹,同时开多个Blender一起转换。 ```python @@ -126,4 +157,7 @@ D:\OtherTools\GameAssets\umodel_win32\umodel_scarlet_nexus_v5.exe -path=C:\Game\ /Game/Character/ch/ch0200/05_Animation/AS_ch0200_AL_pose004_ST.uasset /Game/Character/ch/ch0200/05_Animation/AS_ch0200_AL_pose005_ST.uasset /Game/Character/ch/ch0200/05_Animation/AS_ch0200_AL_pose006_ST.uasset -/Game/Character/ch/ch0200/05_Animation/AS_ch0200_AL_pose007_ST.uasset \ No newline at end of file +/Game/Character/ch/ch0200/05_Animation/AS_ch0200_AL_pose007_ST.uasset + +# 解决Blender导出问题的根骨骼问题 +使用Blender的**Better Fbx Importer & Exporter** addon就可以解决问题。