vault backup: 2024-02-13 23:02:30
This commit is contained in:
parent
c6ab3c7902
commit
1be66ebe1d
@ -138,6 +138,44 @@ for root, subdirs, files in os.walk(psaDirPath):
|
||||
bpy.ops.object.delete()
|
||||
```
|
||||
|
||||
**绯红结系批量转换代码**:
|
||||
```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\\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\\'
|
||||
|
||||
# 清空并且设置为60fps
|
||||
bpy.ops.scene.new(type='EMPTY')
|
||||
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)
|
||||
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)
|
||||
```
|
||||
|
||||
|
||||
## 添加平滑组
|
||||
```python
|
||||
import bpy
|
||||
@ -161,6 +199,7 @@ import math
|
||||
|
||||
for action in bpy.data.actions:
|
||||
print(action)
|
||||
action.name
|
||||
|
||||
bpy.data.actions["AS_ch0100_016_AL_walk"].name = "AS_ch0100_016_AL_walk"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user