fix: 支持 Linux 本机构建环境
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
| | `generate_scene.py` | `export_cesium.py` |
|
||||
|---|---|---|
|
||||
| 行数 | 895 | 647 |
|
||||
| 调用 | `--background --factory-startup --python` | `--background --python` |
|
||||
| 调用 | `--background --factory-startup --python` | `--background --factory-startup --python` |
|
||||
| 输入 | `--osm` + `--geojson`(可选) | `--blend` |
|
||||
| 输出 | `--output`(.blend)、`--render`(.png) | `--glb`、`--metadata`(.json) |
|
||||
| 完成标记 | `SCENE_DONE` | `CESIUM_EXPORT_DONE` |
|
||||
@@ -70,9 +70,9 @@
|
||||
两个 stdout 标记是 [parity 契约](../guides/artifact-parity-guide.md)的一部分
|
||||
(`scripts/parity.js:121` 解析它们),**改动打印格式等于改动契约**。
|
||||
|
||||
### `--factory-startup` 只在 generate 阶段用
|
||||
### 后台阶段使用 `--factory-startup`
|
||||
|
||||
它屏蔽本机 Blender 的 preferences 和 addon,保证场景生成不受用户配置影响。
|
||||
它屏蔽本机 Blender 的 preferences 和 addon,保证场景生成与 Cesium 导出不受用户配置影响。
|
||||
副作用是脚本自己的目录不在 `sys.path` 上,所以两个入口开头都有那段
|
||||
`sys.path.insert` 样板 + `# noqa: E402`——**不是可以整理掉的坏味道**。
|
||||
|
||||
|
||||
@@ -125,10 +125,10 @@ SCENE_LAYERS.forEach((layer, index) => {
|
||||
| 阶段 | 参数 | 出处 |
|
||||
|---|---|---|
|
||||
| `blender` | `--background --factory-startup --python generate_scene.py --` | `build-area.js:242-247` |
|
||||
| `cesium` | `--background --python export_cesium.py --` | `build-area.js:276-280` |
|
||||
| `cesium` | `--background --factory-startup --python export_cesium.py --` | `build-area.js:276-280` |
|
||||
|
||||
**`--factory-startup` 只在 generate 阶段用**:它屏蔽用户的 preferences 和 addon,
|
||||
保证场景生成不受本机 Blender 配置影响。export 阶段不带,因为它要读已经建好的 `.blend`。
|
||||
**两个后台阶段都使用 `--factory-startup`**:它屏蔽用户的 preferences 和 addon,
|
||||
保证场景生成与导出不受本机 Blender 配置影响。export 阶段仍会显式读取已经建好的 `.blend`。
|
||||
|
||||
`--` 之后才是脚本自己的参数,Blender 不解析它们。脚本侧用
|
||||
`sys.argv[sys.argv.index("--") + 1:]` 取。
|
||||
|
||||
Reference in New Issue
Block a user