バージョン

menu_open
Wwise SDK 2019.1.11
Python (Waapi-Client) - Remote Procedure Call

プロジェクトの初期化

注釈: Python Waapi-Clientは、Python 3.6+と合わせて使用することを前提としています。

依存関係をインストールするには、任意のディレクトリから次のコマンドを実行します。

py -3 -m pip install waapi-client

プロジェクトコード

このファイルには、Wwise Authoring APIに接続できる次のコードが含まれています。

#!/usr/bin/env python3
from waapi import WaapiClient, CannotConnectToWaapiException
from pprint import pprint
try:
# Connecting to Waapi using default URL
with WaapiClient() as client:
# NOTE: client will automatically disconnect at the end of the scope
# == Simple RPC without argument
print("Getting Wwise instance information:")
result = client.call("ak.wwise.core.getInfo")
pprint(result)
# == RPC with arguments
print("Query the Default Work Unit information:")
object_get_args = {
"from": {
"path": ["\\Actor-Mixer Hierarchy\\Default Work Unit"]
},
"options": {
"return": ["id", "name", "type"]
}
}
result = client.call("ak.wwise.core.object.get", object_get_args)
pprint(result)
except CannotConnectToWaapiException:
print("Could not connect to Waapi: Is Wwise running and Wwise Authoring API enabled?")

プロジェクトの実行

Wwiseでプロジェクトを1つ開き、以下のコマンドで、スクリプトを端末で実行します。

py rpc.py

アウトプットに以下のようなものがあるはずです:

Getting Wwise instance information:
[Wwise Information Dictionary dump]
Query the Default Work Unit information:
{'return': [{'id': '{CDF62889-48AA-436C-B7DD-5B6B1DF5050D}',
'name': 'Default Work Unit',
'type': 'WorkUnit'}]}

このページはお役に立ちましたか?

サポートは必要ですか?

ご質問や問題、ご不明点はございますか?お気軽にお問い合わせください。

サポートページをご確認ください

あなたのプロジェクトについて教えてください。ご不明な点はありませんか。

プロジェクトを登録していただくことで、ご利用開始のサポートをいたします。

Wwiseからはじめよう