跳到主要内容

compile_vox_to_vfp()

compile_vox_to_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]

将 MagicaVoxel 单模型转为 VFP。所有缓存和 THMB 参数与 compile_vfp() 相同。

输入仅支持 MAIN/SIZE/XYZI[/RGBA] Profile。含 PACKnTRNnGRPnSHPLAYR 的场景文件会抛出 VfpError,不会静默压平对象。

from voxelkit import compile_vox_to_vfp
report = compile_vox_to_vfp("cube.vox", "cube.vfp", include_preview=False)
print(report["solidVoxelCount"])