Fix Shot_Builder
fails to invoke with correct project root directory
#8
@ -32,6 +32,7 @@ from blender_kitsu.shot_builder.hooks import Hooks, register_hooks
|
|||||||
|
|
||||||
from blender_kitsu.shot_builder.connectors.default import DefaultConnector
|
from blender_kitsu.shot_builder.connectors.default import DefaultConnector
|
||||||
from blender_kitsu.shot_builder.connectors.connector import Connector
|
from blender_kitsu.shot_builder.connectors.connector import Connector
|
||||||
|
import os
|
||||||
|
|
||||||
from blender_kitsu import prefs
|
from blender_kitsu import prefs
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@ -400,16 +401,16 @@ def ensure_loaded_production(context: bpy.types.Context) -> bool:
|
|||||||
Returns if the production of for the given context is loaded.
|
Returns if the production of for the given context is loaded.
|
||||||
"""
|
"""
|
||||||
global _PRODUCTION
|
global _PRODUCTION
|
||||||
production_root = get_production_root(context)
|
addon_prefs = prefs.addon_prefs_get(bpy.context)
|
||||||
if production_root is None:
|
base_path = Path(addon_prefs.project_root_dir)
|
||||||
_PRODUCTION = None
|
production_root = os.path.join(base_path, "pro")
|
||||||
return False
|
if is_valid_production_root(Path(production_root)):
|
||||||
if _PRODUCTION and (_PRODUCTION.path == production_root):
|
|
||||||
return True
|
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"loading new production configuration from '{production_root}'.")
|
f"loading new production configuration from '{production_root}'.")
|
||||||
return __load_production_configuration(context, production_root)
|
__load_production_configuration(context, Path(production_root))
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __load_production_configuration(context: bpy.types.Context,
|
def __load_production_configuration(context: bpy.types.Context,
|
||||||
|
Loading…
Reference in New Issue
Block a user