Quellcode durchsuchen

Correctly run bank_info_parser.py

Signed-off-by: Alex Peterson <[email protected]>
Alex Peterson vor 1 Jahr
Ursprung
Commit
fc85b1a4f0

+ 23 - 0
Gems/AudioEngineWwise/External/Sounds/wwise_project/Tools/WwiseAuthoringScripts/run_bank_info_parser.cmake

@@ -0,0 +1,23 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+# Include the project's EngineFinder so we can find the engine
+# This cmake script must be run from the project folder in order to work correctly
+# because EngineFinder.cmake expects CMAKE_CURRENT_SOURCE_DIR to be the project folder
+include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/EngineFinder.cmake)
+
+if(CMAKE_MODULE_PATH)
+    cmake_path(SET O3DE_ENGINE_PYTHON_PATH NORMALIZE "${CMAKE_MODULE_PATH}/../python/python.cmd")
+    message(STATUS "O3DE engine Python path is  ${O3DE_ENGINE_PYTHON_PATH}")
+
+    cmake_path(SET PYTHON_SCRIPT_PATH NORMALIZE ${CMAKE_CURRENT_SOURCE_DIR}/Sounds/wwise_project/Tools/WwiseAuthoringScripts/bank_info_parser.py)
+
+    execute_process(COMMAND ${O3DE_ENGINE_PYTHON_PATH} "${PYTHON_SCRIPT_PATH}" "${WWISE_INFO_FILE_PATH}" "${WWISE_SOUND_BANK_PATH}")
+else()
+    message(ERROR "Unable to determine O3DE engine path")
+endif()
+

+ 17 - 0
Gems/AudioEngineWwise/External/Sounds/wwise_project/Tools/WwiseAuthoringScripts/run_bank_info_parser.cmd

@@ -0,0 +1,17 @@
+@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
+
+set PROJECT_PATH=%1
+set INFO_FILE_PATH=%2
+set SOUND_BANK_PATH=%3
+
+REM In order to use cmake/EngineFinder.cmake it must be run from the project folder
+pushd %PROJECT_PATH%
+cmake  -DWWISE_INFO_FILE_PATH=%INFO_FILE_PATH% -DWWISE_SOUND_BANK_PATH=%SOUND_BANK_PATH% -P %~dp0run_bank_info_parser.cmake
+popd

+ 2 - 2
Gems/AudioEngineWwise/External/Sounds/wwise_project/wwise_project.wproj

@@ -47,9 +47,9 @@
 				<Property Name="SoundBankPostGenerateCustomCmdLines" Type="string">
 					<ValueList>
 						<Value Platform="Windows">"$(CopyStreamedFilesExePath)" -info "$(InfoFilePath)" -outputpath "$(SoundBankPath)" -banks "$(SoundBankListAsTextFile)" -languages "$(LanguageList)" 
-						"$(WwiseProjectPath)\..\..\..\python\python.cmd" "$(WwiseProjectPath)\Tools\WwiseAuthoringScripts\bank_info_parser.py" "$(InfoFilePath)" "$(SoundBankPath)"</Value>
+"$(WwiseProjectPath)/Tools/WwiseAuthoringScripts/run_bank_info_parser.cmd" "$(WwiseProjectPath)/../../" "$(InfoFilePath)" "$(SoundBankPath)"</Value>
 						<Value Platform="Linux">"$(CopyStreamedFilesExePath)" -info "$(InfoFilePath)" -outputpath "$(SoundBankPath)" -banks "$(SoundBankListAsTextFile)" -languages "$(LanguageList)" 
-						"$(WwiseProjectPath)/../../../python/python.sh" "$(WwiseProjectPath)/Tools/WwiseAuthoringScripts/bank_info_parser.py" "$(InfoFilePath)" "$(SoundBankPath)"</Value>
+"$(WwiseProjectPath)/Tools/WwiseAuthoringScripts/run_bank_info_parser.cmd" "$(WwiseProjectPath)/../../" "$(InfoFilePath)" "$(SoundBankPath)"</Value>
 					</ValueList>
 				</Property>
 				<Property Name="SoundBankPreGenerateCustomCmdDescription" Type="string">