mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-22 11:50:53 +00:00
refactor(Blenvy): minor re-orgs
This commit is contained in:
parent
8b76a34bec
commit
4f742e7735
@ -7,7 +7,7 @@ from ...core.scene_helpers import get_main_and_library_scenes
|
|||||||
|
|
||||||
from .get_blueprints_to_export import get_blueprints_to_export
|
from .get_blueprints_to_export import get_blueprints_to_export
|
||||||
from .get_levels_to_export import get_levels_to_export
|
from .get_levels_to_export import get_levels_to_export
|
||||||
from .get_standard_exporter_settings import get_standard_exporter_settings
|
from .export_gltf import get_standard_exporter_settings
|
||||||
|
|
||||||
from .export_main_scenes import export_main_scene
|
from .export_main_scenes import export_main_scene
|
||||||
from .export_blueprints import export_blueprints
|
from .export_blueprints import export_blueprints
|
||||||
|
@ -2,7 +2,11 @@ import json
|
|||||||
import os
|
import os
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
from .get_standard_exporter_settings import get_standard_exporter_settings
|
from ...settings import load_settings
|
||||||
|
|
||||||
|
def get_standard_exporter_settings():
|
||||||
|
standard_gltf_exporter_settings = load_settings(".blenvy_gltf_settings")
|
||||||
|
return standard_gltf_exporter_settings if standard_gltf_exporter_settings is not None else {}
|
||||||
|
|
||||||
def generate_gltf_export_preferences(settings):
|
def generate_gltf_export_preferences(settings):
|
||||||
# default values
|
# default values
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
import bpy
|
|
||||||
import json
|
|
||||||
|
|
||||||
def get_standard_exporter_settings():
|
|
||||||
standard_gltf_exporter_settings = bpy.data.texts[".blenvy_gltf_settings"] if ".blenvy_gltf_settings" in bpy.data.texts else None
|
|
||||||
if standard_gltf_exporter_settings != None:
|
|
||||||
try:
|
|
||||||
standard_gltf_exporter_settings = json.loads(standard_gltf_exporter_settings.as_string())
|
|
||||||
except:
|
|
||||||
standard_gltf_exporter_settings = {}
|
|
||||||
else:
|
|
||||||
standard_gltf_exporter_settings = {}
|
|
||||||
|
|
||||||
return standard_gltf_exporter_settings
|
|
@ -14,8 +14,11 @@ def upsert_settings(name, data):
|
|||||||
|
|
||||||
def load_settings(name):
|
def load_settings(name):
|
||||||
stored_settings = bpy.data.texts[name] if name in bpy.data.texts else None
|
stored_settings = bpy.data.texts[name] if name in bpy.data.texts else None
|
||||||
if stored_settings != None:
|
if stored_settings is not None:
|
||||||
return json.loads(stored_settings.as_string())
|
try:
|
||||||
|
return json.loads(stored_settings.as_string())
|
||||||
|
except:
|
||||||
|
return None
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# checks if old & new settings (dicts really) are identical
|
# checks if old & new settings (dicts really) are identical
|
||||||
|
Loading…
Reference in New Issue
Block a user