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_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_blueprints import export_blueprints
|
||||
|
|
|
@ -2,7 +2,11 @@ import json
|
|||
import os
|
||||
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):
|
||||
# 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):
|
||||
stored_settings = bpy.data.texts[name] if name in bpy.data.texts else None
|
||||
if stored_settings != None:
|
||||
return json.loads(stored_settings.as_string())
|
||||
if stored_settings is not None:
|
||||
try:
|
||||
return json.loads(stored_settings.as_string())
|
||||
except:
|
||||
return None
|
||||
return None
|
||||
|
||||
# checks if old & new settings (dicts really) are identical
|
||||
|
|
Loading…
Reference in New Issue