fix(assets): make vehicle kit verification standalone
This commit is contained in:
@@ -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", ""))
|
||||
|
||||
Reference in New Issue
Block a user