49 lines
1.4 KiB
Markdown
49 lines
1.4 KiB
Markdown
# 高模减面与贴图烘焙
|
||
|
||
复刻自 `ClientTrunk/Tools/ModelTools`(`model_decimate` + `model_bake`)。
|
||
|
||
```text
|
||
高模(FBX / GLB / glTF)
|
||
-> model_decimate.py:合并 Mesh、清理、三角化、减面、重展 UV
|
||
-> <名称>_low.fbx
|
||
-> model_bake.py:Cycles selected-to-active 烘焙
|
||
-> 低模 FBX + color / normal / ao / metallic / roughness PNG
|
||
```
|
||
|
||
## 环境
|
||
|
||
- 安装 Blender(推荐 5.0),并满足其一:
|
||
- `blender` 在 PATH
|
||
- 环境变量 `BLENDER_EXE` 或 `BLENDER_PATH`
|
||
- 运行时 `--blender "D:\tools\Blender\blender-5.0.0-windows-x64\blender.exe"`
|
||
- 本机默认路径已写在 `mt_run.py`:`D:\tools\Blender\blender-5.0.0-windows-x64\blender.exe`
|
||
- UV 观察图需要 Pillow:`pip install Pillow`
|
||
- UVPackmaster 4 可选(已装则自动用于 UV 排布)
|
||
|
||
## 分步命令
|
||
|
||
```powershell
|
||
python Tools/model_tools/model_decimate.py D:\Assets\house.glb --tris 5000 -o D:\Assets\house_low
|
||
python Tools/model_tools/model_bake.py D:\Assets\house.glb D:\Assets\house_low\house_low.fbx -o D:\Assets\house_bake --size 2048
|
||
```
|
||
|
||
## 一键流水线(推荐 Agent 使用)
|
||
|
||
```powershell
|
||
python Tools/model_tools/model_lowpoly_bake.py D:\Assets\house.glb -o Tools/output/house --tris 5000 --size 2048
|
||
```
|
||
|
||
输出示例:
|
||
|
||
```text
|
||
Tools/output/house/house/
|
||
house.fbx
|
||
house_color.png
|
||
house_normal.png
|
||
house_ao.png
|
||
house_metallic.png
|
||
house_roughness.png
|
||
```
|
||
|
||
生成完成后请在 `Doc/ResDesc_Model.md` 登记资源。
|