-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_python_path.bat
More file actions
33 lines (25 loc) · 1.06 KB
/
get_python_path.bat
File metadata and controls
33 lines (25 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
:: Retreives the path to the O3DE python executable(s)
:: Skip initialization if already completed
IF "%O3DE_PYTHONHOME_INIT%"=="1" GOTO :END_OF_FILE
SET CMD_DIR=%~dp0
:: Note, many DCC tools (like Maya) include thier own versioned python interpretter.
:: Some apps may not operate correctly if PYTHONHOME is set/propogated.
:: This is definitely the case with Maya, doing so causes Maya to not boot.
FOR /F "tokens=* USEBACKQ" %%F IN (`%CMD_DIR%\python.cmd %CMD_DIR%\get_python_path.py`) DO (SET O3DE_PYTHONHOME=%%F)
echo O3DE_PYTHONHOME - is now the folder containing O3DE python executable
echo O3DE_PYTHONHOME = %O3DE_PYTHONHOME%
SET PYTHON=%O3DE_PYTHONHOME%\python.exe
:: Set flag so we don't initialize dccsi environment twice
SET O3DE_PYTHONHOME_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE