__init__.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. """! @brief
  10. <DCCsi>/Tools/DCC/__init__.py
  11. This init allows us to treat the DCCsi Tools DCC folder as a package.
  12. """
  13. # -------------------------------------------------------------------------
  14. # standard imports
  15. import os
  16. import site
  17. from pathlib import Path
  18. import logging as _logging
  19. # -------------------------------------------------------------------------
  20. # -------------------------------------------------------------------------
  21. # global scope
  22. from DccScriptingInterface.Tools import _PACKAGENAME
  23. _PACKAGENAME = f'{_PACKAGENAME}.DCC'
  24. __all__ = ['Blender',
  25. 'Maya',
  26. 'Substance'] # to do: add others when they are set up
  27. #'3dsMax',
  28. #'Houdini',
  29. #'Marmoset',
  30. # 'Foo',
  31. _LOGGER = _logging.getLogger(_PACKAGENAME)
  32. # set up access to this DCC folder as a pkg
  33. _MODULE_PATH = Path(__file__) # To Do: what if frozen?
  34. from DccScriptingInterface import add_site_dir
  35. from DccScriptingInterface import PATH_DCCSIG
  36. from DccScriptingInterface.Tools import PATH_DCCSI_TOOLS
  37. from DccScriptingInterface.globals import *
  38. from DccScriptingInterface.constants import ENVAR_PATH_DCCSI_TOOLS_DCC
  39. # the path to this < dccsi >/Tools pkg
  40. PATH_DCCSI_TOOLS_DCC = Path(_MODULE_PATH.parent)
  41. # this allows the Tool location to be overriden in the external env
  42. PATH_DCCSI_TOOLS_DCC = Path(os.getenv(ENVAR_PATH_DCCSI_TOOLS_DCC,
  43. PATH_DCCSI_TOOLS_DCC.as_posix()))
  44. add_site_dir(PATH_DCCSI_TOOLS_DCC.as_posix())
  45. _LOGGER.debug(f'{ENVAR_PATH_DCCSI_TOOLS_DCC}: {PATH_DCCSI_TOOLS_DCC}')
  46. _LOGGER.debug(STR_CROSSBAR)