2024-05-15 11:25:30 +00:00
|
|
|
|
|
|
|
import os
|
|
|
|
import json
|
|
|
|
import bpy
|
2024-07-07 20:06:16 +00:00
|
|
|
from pathlib import Path
|
2024-07-21 22:29:41 +00:00
|
|
|
import posixpath
|
2024-07-07 20:06:16 +00:00
|
|
|
|
2024-05-15 11:25:30 +00:00
|
|
|
def find_blueprints_not_on_disk(blueprints, folder_path, extension):
|
|
|
|
not_found_blueprints = []
|
|
|
|
for blueprint in blueprints:
|
|
|
|
gltf_output_path = os.path.join(folder_path, blueprint.name + extension)
|
|
|
|
# print("gltf_output_path", gltf_output_path)
|
|
|
|
found = os.path.exists(gltf_output_path) and os.path.isfile(gltf_output_path)
|
|
|
|
if not found:
|
|
|
|
not_found_blueprints.append(blueprint)
|
|
|
|
return not_found_blueprints
|
|
|
|
|
|
|
|
def check_if_blueprint_on_disk(scene_name, folder_path, extension):
|
|
|
|
gltf_output_path = os.path.join(folder_path, scene_name + extension)
|
|
|
|
found = os.path.exists(gltf_output_path) and os.path.isfile(gltf_output_path)
|
|
|
|
return found
|
|
|
|
|
2024-07-07 20:06:16 +00:00
|
|
|
def inject_export_path_into_internal_blueprints(internal_blueprints, blueprints_path, gltf_extension, settings):
|
2024-05-15 11:25:30 +00:00
|
|
|
for blueprint in internal_blueprints:
|
2024-07-21 22:29:41 +00:00
|
|
|
blueprint_exported_path = posixpath.join(blueprints_path, f"{blueprint.name}{gltf_extension}")
|
2024-06-25 16:27:52 +00:00
|
|
|
# print("injecting blueprint path", blueprint_exported_path, "for", blueprint.name)
|
2024-05-15 11:25:30 +00:00
|
|
|
blueprint.collection["export_path"] = blueprint_exported_path
|
2024-07-27 14:59:57 +00:00
|
|
|
"""if export_materials_library:
|
|
|
|
blueprint.collection["materials_path"] = materials_exported_path"""
|