From ef745a6a0a4f006a3480dfd2e2d2dc03705e611c Mon Sep 17 00:00:00 2001 From: BlueRose <378100977@qq.com> Date: Fri, 9 Feb 2024 18:27:03 +0800 Subject: [PATCH] vault backup: 2024-02-09 18:27:03 --- .../导出PSK_PSA脚本 & 部分UModel AES Key.md | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md b/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md index d0d7370..4546e6e 100644 --- a/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md +++ b/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md @@ -70,6 +70,39 @@ for modelroot, modeldirs, modelfiles in os.walk(pskPath): bpy.ops.object.select_all(action='SELECT') bpy.ops.export_scene.fbx(filepath=fbx_file,add_leaf_bones=False) ``` + +使用BetterExport的版本: +```python +import bpy +import os +import math +from io_import_scene_unreal_psa_psk_280 import * +from better_fbx 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.better_export.fbx(filepath=fbx_file,my_fbx_format="binary",use_selection=True,use_visible=True,use_only_root_empty_node=False) +``` + # PSA 注意:该脚本因为Blender运行bug,会导致输出的FBX文件越来越大,越来越慢。一次转换的量不建议超过50个。建议分几个文件夹,同时开多个Blender一起转换。 ```python