bootstrap.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. # -------------------------------------------------------------------------
  9. import os
  10. import logging as _logging
  11. from DccScriptingInterface.Tools.DCC.Blender import _PACKAGENAME
  12. _MODULENAME = f'{_PACKAGENAME}.config'
  13. from DccScriptingInterface.Tools.DCC.Blender import ENVAR_PATH_DCCSI_TOOLS_DCC_BLENDER_SCRIPTS
  14. print(os.getenv(ENVAR_PATH_DCCSI_TOOLS_DCC_BLENDER_SCRIPTS, None))
  15. # get the global dccsi state
  16. from DccScriptingInterface.globals import DCCSI_GDEBUG
  17. from DccScriptingInterface.globals import DCCSI_DEV_MODE
  18. from azpy.constants import FRMT_LOG_LONG
  19. _logging.basicConfig(level=_logging.DEBUG,
  20. format=FRMT_LOG_LONG,
  21. datefmt='%m-%d %H:%M')
  22. _LOGGER = _logging.getLogger(_MODULENAME)
  23. # auto-attach ide debugging at the earliest possible point in module
  24. if DCCSI_DEV_MODE:
  25. import DccScriptingInterface.azpy.test.entry_test
  26. DccScriptingInterface.azpy.test.entry_test.connect_wing()
  27. # check access by grabbing this config from import
  28. _boot_msg = 'O3DE DccScriptingInterface BOOTSTRAP'
  29. print(_boot_msg)
  30. _LOGGER.debug(f'{_boot_msg}')
  31. try:
  32. from dynaconf import settings
  33. from DccScriptingInterface.Tools.DCC.Blender.config import blender_config
  34. except ImportError as e:
  35. print(f'ERROR: {e}')
  36. _LOGGER.exception(f'{e} , traceback =', exc_info=True)
  37. raise e
  38. settings = blender_config.get_config_settings()
  39. print('O3DE support, not implemented yet!')