> For the complete documentation index, see [llms.txt](https://help.transmutr.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.transmutr.com/v2-zh-tw/hui-chu/command-line-interface.md).

# 命令列介面

{% hint style="success" icon="rocket-launch" %}
**Studio／Creator** 功能。命令列介面需要有效的 Studio 或 Creator 授權。
{% endhint %}

命令列介面可不開啟圖形介面即轉換模型。它適合素材庫、類似 CI 的指令碼，以及 LOD 流程。

## 找到執行檔

開啟終端機，並以 `convert` 子命令執行 Transmutr 執行檔。

一般位置：

<table><thead><tr><th width="200">平台</th><th>一般路徑</th></tr></thead><tbody><tr><td>Windows（每位使用者）</td><td><code>%LOCALAPPDATA%\Transmutr\current\Transmutr.exe</code></td></tr><tr><td>macOS</td><td><code>/Applications/Transmutr.app/Contents/MacOS/Transmutr</code></td></tr></tbody></table>

{% hint style="info" %}
將安裝資料夾加入 `PATH`，即可輸入簡短命令，而不必輸入完整路徑。執行執行檔時**不加** `convert` 會開啟圖形介面。
{% endhint %}

## 基本用法

在輸入檔旁邊轉換模型（相同名稱、`.skp`）：

```bash
Transmutr.exe convert C:/models/tree.obj
```

選擇輸出路徑：

```bash
Transmutr.exe convert --output C:/sketchup/mytree.skp C:/models/tree.fbx
```

列出所有旗標：

```bash
Transmutr.exe convert --help
```

## 常用選項

| 選項                                                                                                    | 說明                                                                                                                             |
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `-o, --output <path>`                                                                                 | 輸出檔案；轉換多個模型時則為目錄                                                                                                               |
| `-p, --preset <path>`                                                                                 | 載入圖形介面的預設集 `.json`                                                                                                             |
| `--copyMaps`                                                                                          | 將紋理貼圖複製到輸出檔旁邊                                                                                                                  |
| `--prefixMaterialsWithModelName`                                                                      | 在材質名稱前加上模型名稱                                                                                                                   |
| `--sketchupFileVersion <version>`                                                                     | 目標 SketchUp `.skp` 版本                                                                                                          |
| `--scale <x>`                                                                                         | 縮放倍數                                                                                                                           |
| `--sourceUnit <m\|cm\|mm\|f\|i>`                                                                      | 來源單位                                                                                                                           |
| `--up <x\|y\|z\|nx\|ny\|nz>`                                                                          | 向上軸                                                                                                                            |
| `--origin <initial\|center\|bottomCenter\|topCenter>`                                                 | 輸出原點                                                                                                                           |
| `--simplificationLevel <0–1>`                                                                         | 簡化程度                                                                                                                           |
| `--simplificationAuto`                                                                                | 魔術棒自動等級                                                                                                                        |
| `--simplificationPreserveNormals` / `--simplificationPreserveUvs` / `--simplificationPreserveBorders` | 保留旗標                                                                                                                           |
| `--simplificationTarget <n>`                                                                          | 目標面數（僅命令列）                                                                                                                     |
| `--overwriteInputEdges` / `--normalAngle` / `--softenCoplanar` / `--hideAllEdges`                     | 邊線選項                                                                                                                           |
| `--smoothAllEdges` / `--unsmoothAllEdges`                                                             | 僅命令列的邊線捷徑                                                                                                                      |
| `--exportVrayProxy` / `--vrayConverterPath`                                                           | V-Ray 代理                                                                                                                       |
| `--exportEnscapeProxy` / `--enscapeConverterPath`                                                     | Enscape 代理                                                                                                                     |
| `--proxy <type>`                                                                                      | 佔位類型（`billboardCross`、`billboardFaceMe`、`blobs`、`boundingBoxWireframe`、`boundingBoxFaces`、`faceSkipping`、`simplifiedGeometry`） |
| `--proxyFaceSkippingRatio` / `--proxySimplificationLevel`                                             | 代理專用控制項                                                                                                                        |
| `--skipRendererMaterials`                                                                             | 停用 V-Ray／Enscape 材質資料                                                                                                          |

範例：

```bash
Transmutr.exe convert --simplificationLevel 0.25 statue.skp
Transmutr.exe convert --scale 5 --origin bottomCenter models/car.gltf
Transmutr.exe convert --preset C:/presets/studio.json --output C:/out C:/models/*.fbx
```

## 多個模型與萬用字元

傳入多個路徑：

```bash
Transmutr.exe convert C:/models/tree.fbx C:/models/sofa.obj
```

使用萬用字元（`*`、`**`、範圍）。Transmutr 會自行展開模式，讓 Windows 終端機的行為與 Unix shell 相同：

```bash
Transmutr.exe convert C:/models/trees/*.obj
Transmutr.exe convert C:/models/**/tree.fbx
Transmutr.exe convert C:/models/*.@(obj|fbx)
```

{% hint style="warning" %}
路徑與模式會**區分大小寫**。`.fbx` 不會比對到 `.FBX`。
{% endhint %}

轉換多個模型時，選項會套用到全部模型，且 `--output` 必須是**目錄**。
