compile_vfp()
compile_vfp(input_path, output_path, *, chunk_size=16, include_preview=True,
include_runtime_caches=True, include_render_cache=False,
include_animation_cache=True, include_thumbnail=True,
thumbnail_size=256, thumbnail_background="transparent") -> dict[str, object]
JSON → VFP 的完整 Writer API。input_path、output_path 应传 pathlib.Path;字符串调用场景推荐使用 compile_json()。
| 额外开关 | 默认值 | 作用 |
|---|---|---|
include_preview | True | 写入 PRVW GLB。 |
include_runtime_caches | True | 写入 VBUF、PMSH。 |
include_render_cache | False | 写入 RND0。 |
include_animation_cache | True | 写入 ANM0。 |
include_thumbnail | True | 写入 THMB。 |
缓存开关不改变 VOX0/PAL0 或 source hash。输出统计中的各 *Bytes 字段可用于测量文件组成。
from pathlib import Path
from voxelkit import compile_vfp
compile_vfp(Path("source.json"), Path("asset.vfp"), include_preview=False, include_render_cache=True)