Project_Env.bat 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. @echo off
  2. REM
  3. REM Copyright (c) Contributors to the Open 3D Engine Project
  4. REM
  5. REM SPDX-License-Identifier: Apache-2.0 OR MIT
  6. REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
  7. REM
  8. REM
  9. :: Sets up environment for O3DE DCC tools and code access
  10. :: Set up window
  11. TITLE O3DE Asset Gem
  12. :: Use obvious color to prevent confusion (Grey with Yellow Text)
  13. COLOR 8E
  14. :: Skip initialization if already completed
  15. IF "%O3DE_PROJ_ENV_INIT%"=="1" GOTO :END_OF_FILE
  16. :: Store current dir
  17. %~d0
  18. cd %~dp0
  19. PUSHD %~dp0
  20. :: Put you project env vars and overrides in this file
  21. :: chanhe the relative path up to dev
  22. set ABS_PATH=%~dp0
  23. :: project name as a str tag
  24. IF "%O3DE_PROJECT%"=="" (
  25. for %%I in ("%~dp0.") do for %%J in ("%%~dpI.") do set O3DE_PROJECT=%%~nxJ
  26. )
  27. echo.
  28. echo _____________________________________________________________________
  29. echo.
  30. echo ~ Setting up O3DE %O3DE_PROJECT% Environment ...
  31. echo _____________________________________________________________________
  32. echo.
  33. echo O3DE_PROJECT = %O3DE_PROJECT%
  34. :: if the user has set up a custom env call it
  35. :: this should allow the user to locally
  36. :: set env hooks like O3DE_DEV or O3DE_PROJECT_PATH
  37. IF EXIST "%~dp0User_Env.bat" CALL %~dp0User_Env.bat
  38. echo O3DE_DEV = %O3DE_DEV%
  39. :: Constant Vars (Global)
  40. :: global debug flag (propogates)
  41. :: The intent here is to set and globally enter a debug mode
  42. IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=false)
  43. echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
  44. :: initiates earliest debugger connection
  45. :: we support attaching to WingIDE... PyCharm and VScode in the future
  46. IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=false)
  47. echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
  48. :: sets debugger, options: WING, PYCHARM
  49. IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
  50. echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
  51. :: Default level logger will handle
  52. :: Override this to control the setting
  53. :: CRITICAL:50
  54. :: ERROR:40
  55. :: WARNING:30
  56. :: INFO:20
  57. :: DEBUG:10
  58. :: NOTSET:0
  59. IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=20)
  60. echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
  61. :: Override the default maya version
  62. IF "%DCCSI_MAYA_VERSION%"=="" (set DCCSI_MAYA_VERSION=2020)
  63. echo DCCSI_MAYA_VERSION = %DCCSI_MAYA_VERSION%
  64. :: O3DE_PROJECT_PATH is ideally treated as a full path in the env launchers
  65. :: do to changes in o3de, external engine/project/gem folder structures, etc.
  66. IF "%O3DE_PROJECT_PATH%"=="" (
  67. for %%i in ("%~dp0..") do set "O3DE_PROJECT_PATH=%%~fi"
  68. )
  69. echo O3DE_PROJECT_PATH = %O3DE_PROJECT_PATH%
  70. :: Change to root O3DE dev dir
  71. IF "%O3DE_DEV%"=="" echo ~ You must set O3DE_DEV in a User_Env.bat to match your local engine repo!
  72. IF "%O3DE_DEV%"=="" echo ~ Using default O3DE_DEV=C:\Depot\o3de-engine
  73. IF "%O3DE_DEV%"=="" (set O3DE_DEV=C:\Depot\o3de-engine)
  74. echo O3DE_DEV = %O3DE_DEV%
  75. CALL %O3DE_DEV%\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\Tools\Dev\Windows\Env_Maya.bat
  76. :: Restore original directory
  77. popd
  78. :: Change to root dir
  79. CD /D %ABS_PATH%
  80. ::ENDLOCAL
  81. :: Set flag so we don't initialize dccsi environment twice
  82. SET O3DE_PROJ_ENV_INIT=1
  83. GOTO END_OF_FILE
  84. :: Return to starting directory
  85. POPD
  86. :END_OF_FILE