From 2489b8a10b6f67d26d691816f808c82643284e28 Mon Sep 17 00:00:00 2001 From: que01 Date: Wed, 5 Aug 2026 16:02:11 +0800 Subject: [PATCH] fix(assets): make vehicle kit verification standalone --- blender/tools/split_lowpoly_cars.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/blender/tools/split_lowpoly_cars.py b/blender/tools/split_lowpoly_cars.py index b93658b..8c172bc 100644 --- a/blender/tools/split_lowpoly_cars.py +++ b/blender/tools/split_lowpoly_cars.py @@ -1,11 +1,14 @@ #!/usr/bin/env python3 """Split the downloaded LowPoly Cars Blend into a browsable, reusable asset kit. -Run through Blender because the source Blend is not safe to open in the sandbox: +Run through Blender because an imported source Blend is not safe to open in the sandbox: blender --factory-startup --background --python blender/tools/split_lowpoly_cars.py -- \ - --source /Users/que01/Downloads/011.+LowPoly_Cars_01_blend.blend \ - --textures /Users/que01/Downloads/textures111 \ + --source /path/to/source-cars.blend \ + --textures /path/to/source-textures \ --output assets/models/custom/lowpoly_cars + +This is an optional re-import tool. Completed asset kits do not read the source +Blend during area builds or Cesium preview generation. """ import json @@ -14,10 +17,6 @@ import os import shutil import sys -import bpy -from mathutils import Matrix, Vector - - TEXTURE_NAME = "color_512x512.jpg" PREVIEW_SIZE = 640 CESIUM_ALBEDO_GAIN = 2.6 @@ -276,6 +275,12 @@ def main(): if "verify" in args: verify(os.path.abspath(args["verify"])) return + # Keep verification independent from Blender so the checked-in kit can be + # validated after the original source has been removed. + global bpy, Matrix, Vector + import bpy + from mathutils import Matrix, Vector + source = os.path.abspath(args.get("source", "")) texture_dir = os.path.abspath(args.get("textures", "")) output = os.path.abspath(args.get("output", ""))