버전
menu_open
Wwise SDK 2023.1.3
명령어 추가 정의하기

명령어 추가 개요

명령어 추가는 Wwise Authoring의 새로운 명령어를 정의할 수 있도록 합니다. 각 명령어는 Wwise에 의해 트리거되는 외부 프로그램과 연결돼있습니다. 실행되는 프로그램은 현재 선택된 오브젝트에서 파생된 미리 정의된 여러 인자를 받을 수 있습니다.

추가 명령을 트리거하는 방법은 다양합니다.

추가 명령은 여러 레벨에서 정의할 수 있습니다.

    • Windows: "%APPDATA%\\Audiokinetic\\Wwise\\Add-ons\\Commands"
    • macOS: "$HOME/Library/Application Support/Audiokinetic/Wwise/Add-ons/Commands"
  • In the installation folder, under:
    • Windows: "%WWISEROOT%\\Authoring\\Data\\Add-ons\\Commands"
    • macOS: "/Library/Application Support/Audiokinetic/Wwise <version>/Authoring/Data/Add-ons/Commands"
  • 프로젝트 폴더 안의 "Add-ons\\Commands"
  • ak.wwise.ui.commands.register 사용
참고: ID끼리 충돌할 경우, 맨 처음으로 로딩된 명령어만 등록됩니다. 명령어는 위에서 지정한 순서로 로딩됩니다.
참고: 설치 폴더나 사용자 데이터 디렉터리에 지정된 명령어 추가는 Wwise가 시작될 때 로딩됩니다. 프로젝트 내 지정된 명령어 추가는 프로젝트가 로딩될 때 함께 로딩됩니다.

또한, Wwised에서 명령어가 실행될 때마다, WAAPI가 구독자에게 ak.wwise.ui.commands.executed 을(를) 통보하게 되는데, 선택된 오브젝트를 전달하며 WAAPI 반환 옵션을 줍니다. 추가 명령어는 어떠한 프로그램도 실행되지 않게 정의할 수 있어서 발행 이벤트를 사용하여 WAAPI 클라이언트에서 자신의 코드를 실행할 수 있습니다.

명령어 추가의 정의

정의 입력란

명령어는 다음과 같은 입력란으로 설명할 수 있습니다.

  • id: 해당 명령어에 대해 사람이 읽을 수 있는 고유 ID를 정의합니다. ID 충돌로 인한 위험을 줄이기 위해서는, 저작자 이름과 제품 이름, 명령 이름을 연속으로 이어붙여 사용하세요.
  • displayName: 사용자 인터페이스에 표시할 이름을 정의합니다.
  • program: 해당 명령이 실행될 때 작동시킬 프로그램이나 스크립트를 정의합니다. 전달인자는 'args'에 지정됩니다.
  • args: 전달인자를 정의합니다. 지원되는 내장 변수를 보시려면 Wwise 문서를 확인하세요. 여러 개를 선택하는 경우 startMode 에 따라 변수가 확장됩니다.
  • cwd: 프로그램을 실행시킬 현재 작업중인 디렉터리를 정의합니다.
  • defaultShortcut: 이 명령에 대해 기본으로 사용할 단축키를 정의합니다. 단축키가 충돌할 경우, 사용되지 않습니다. 이 단축키는 Keyboard Shortcut Manager에서 변경할 수 있습니다.
  • redirectOutputs: (Windows only) Defines if the standard output streams of the program (stdout + stderr) should be redirected and logged to Wwise on termination. This also prevents the window from displaying. Note that this feature should only be used for programs that will run briefly. 해당 값은 boolean 타입이며 기본값은 false입니다.
  • startMode: Wwise 사용자 인터페이스에서 복수 선택을 할 경우 인자 입력란의 변수를 어떻게 확장할 지를 지정합니다. 다음은 가능한 값의 목록입니다.
    • SingleSelectionSingleProcess: 단일 선택만 지원하며 프로그램을 한 번 실행합니다.
    • MultipleSelectionSingleProcessSpaceSeparated: 큰따옴표로 감싸여 공백으로 구분되는 인자들로 확장된 변수와 함께 프로그램을 한 번 실행합니다.
    • MultipleSelectionMultipleProcesses: 프로그램이 선택된 요소별로 동시에 한 번씩 실행됩니다. 각 실행 인스턴스는 하나의 선택된 요소를 받습니다.
  • contextMenu: 명령어가 콘텍스트 메뉴의 어디에서 나타날 지 지정하며, 오브젝트 타입인 명령어를 사용할 수 있게 됩니다. 이 입력란에는 다음 요소 중 어느 것이든 적용할 수 있습니다.
    • basePath: 부모의 하위 메뉴에 대해 슬래시로 구분된 경로를 정의합니다. 비어있을 경우, 해당 메뉴가 맨 첫 단계에 삽입됩니다.
    • enabledFor: 해당 요소가 활성화된 오브젝트 타입 이름의 쉼표로 구분된 목록을 정의합니다. 지원되는 타입 이름의 목록은 Wwise 오브젝트 레퍼런스 을(를) 참고하세요. 비어있을 경우, 어느 타입이든 가능합니다.
    • visibleFor: 해당 요소가 출력된 오브젝트 타입 이름의 쉼표로 구분된 목록을 정의합니다. 지원되는 타입 이름의 목록은 Wwise 오브젝트 레퍼런스 을(를) 참고하세요. 비어있을 경우, 어느 타입이든 가능합니다.
  • mainMenu: 명령어가 Wwise 메뉴의 어디에서 나타날 지 지정합니다.
    • basePath: 부모의 하위 메뉴에 대해 슬래시로 구분된 경로를 정의합니다. 최소 한 단계를 정의해줘야 하며, 이는 최상위 메뉴와 연결돼있습니다.

공용 디렉터리

다음 미리 정의된 디렉터리는 특정 기기에 국한된 절대 경로를 피하기 위해 program 입력란에 사용돼야 합니다. 이 디렉터리는 또한 args 입력란에 사용해 경로를 인자로서 프로그램에 보내거나 cwd 입력란에 사용해 현재의 작업 디렉터리를 정의할 수 있습니다.

VariableReferenced Location
${CurrentCommandDirectory}The directory where the current command is defined. As mentioned above, it should be "Add-ons\\Commands".
${WwiseInstallRoot}The Wwise installation directory.
${WwiseInstallBin}The Wwise.exe directory.
${WwiseInstallAddons}Windows: "${WwiseInstallRoot}\\Authoring\\Data\\Add-ons"
macOS: "/Library/Application Support/Audiokinetic/Wwise <version>/Authoring/Data/Add-ons/Commands"
${WwiseUserAddons}Windows: "%APPDATA%\\Audiokinetic\\Wwise\\Add-ons"
macOS: "$HOME/Library/Application Support/Audiokinetic/Wwise/Add-ons/Commands"
${WwiseProjectRoot}The Wwise project directory.
${WwiseProjectAddons}"${WwiseProjectRoot}\\Add-ons"
${WwiseProjectOriginals}"${WwiseProjectRoot}\\Originals"
${WwiseProjectSoundbanks}Platform-specific generated soundbanks directory.

전달인자 변수

Zero to many variables can be used in the args field (program arguments). Variables provide a way to access information from the selected objects. For example, you could retrieve an object id and pass it as an argument. Variables also provide a way to access property values from the selected objects, including Custom Properties values. To learn more about Custom Properties, refer to Defining 사용자 지정 속성 정의하기.

For a complete list of possible expressions in variables, refer to the Object Expressions and Value Expressions sections in Wwise Authoring Query Language (WAQL) Reference.

When the selection is multiple, refer to startMode to learn how these variables are resolved.

Examples:

VariableTypeDescription
${id}stringThe object ID (GUID).
${name}stringThe object name.
${notes}stringThe object notes.
${type}stringThe object type. 사용 가능한 타입에 대한 더 자세한 정보는 Wwise 오브젝트 레퍼런스 을(를) 참고하세요.
${path}string프로젝트 루트에서의 오브젝트 경로 Ex: '\\Actor-Mixer Hierarchy\\Default Work Unit\\Sound1'
${filePath}stringThe path to the file containing the object. The path can be a Work Unit file, or a project file.
${originalWavFilePath}stringAbsolute path to the original WAV file. Only valid for Sound and Audio Source objects.
${convertedWemFilePath}stringAbsolute path to the converted WEM file. 옵션에 플랫폼을 지정함. Only valid for Sound and Audio Source objects.
${soundbankBnkFilePath}stringAbsolute path to the generated SoundBank file associated with the SoundBank object. Only valid for SoundBank objects.
${workunitIsDirty}booleanTrue if a Work Unit or a Project (wproj file) is dirty, meaning it is modified but not saved.
${Volume}stringThe Voice Volume.
${OutputBus.name}stringThe Output Bus name.

명령어 추가 예제

명령어 정의 파일 사용 예제

새로운 명령어를 생성하기 위해서는 명령어 추가 정의하기 목록에 있는 디렉터리 중 하나에 JSON 파일을 생성하고 버전을 2로 지정합니다. 이 디렉터리에는 여러 서드 파티에서 파일을 생성할 수 있다는 점에 주의하세요. 파일 이름끼리 충돌하는 것을 방지하기 위해 '회사이름_프로젝트이름.json'의 파일명 규정을 따르기를 권장합니다.

예: mycompany_myproduct.json

{
"version":2,
"commands":[
{
"id":"ak.edit_in_vscode",
"displayName":"Edit in Visual Studio Code",
"defaultShortcut":"C",
"program":"code",
"startMode":"MultipleSelectionSingleProcessSpaceSeparated",
"args":"${filePath}",
"cwd":"",
"contextMenu":{
"basePath":"Editors",
"enabledFor":"Sound,ActorMixer,SwitchContainer,RandomSequenceContainer"
},
"mainMenu":{
"basePath":"Extra"
}
},
{
"id":"ak.open_in_wavosaur",
"displayName":"Edit in My Wav Editor",
"defaultShortcut":"W",
"program":"c:\\MyWavEditor\\WavEditor.exe",
"args":"${originalWavFilePath}",
"cwd":"",
"contextMenu":{}
}
]
}

WAAPI 사용 예제

위에 나온 것과 똑같은 JSON 명령어 코드는 현재 Wwise 프로세스에 새로운 명령어를 추가하도록 WAAPI ak.wwise.ui.commands.register 로 전달될 수 있습니다.

ak.wwise.ui.commands.register로 추가된 명령어는 유지되지 않는다는 점에 유의하세요. Wwise 처리 과정이 종료될 때까지 남아있게 됩니다. 다음번에 이 명령어들을 다시 등록해야 합니다.

WAAPI와 함께 추가 명령 사용하기

추가 명령어는 WAAPI 스크립트나 프로그램을 실행하는 데 사용할 수 있습니다. 그러면 Wwise 기능과 프로젝트 데이터에 접근할 수 있습니다. WAAPI로 할 수 있는 작업에 대한 정보는 Wwise Authoring API (WAAPI, Wwise 저작 API) 사용하기 를 참고하세요.

Using Add-on Mac에서의 명령어

Mac에서 추가 명령어는 다음을 이용해 실행합니다.

/bin/sh -c

. Any app, executable or script can be directly specified in program.

예: mycompany_myproduct_forMac.json

{
"version":2,
"commands":[
{
"id":"ak.edit_in_audacity",
"displayName":"Open wav in Audacity",
"defaultShortcut":"A",
"program":"/Applications/Audacity.app",
"startMode":"SingleSelectionSingleProcess",
"args":"${sound:originalWavFilePath}",
"cwd":"",
"contextMenu": {
"basePath":"Editors",
"enabledFor":"Sound"
}
},
{
"id":"ak.edit_in_script",
"displayName":"Open in script",
"defaultShortcut":"B",
"program":"/path/to/folder with spaces/myScript.sh",
"startMode":"SingleSelectionSingleProcess",
"args":"${sound:originalWavFilePath}",
"cwd":"",
"contextMenu": {
"basePath":"Editors",
"enabledFor":"Sound"
}
}
]
}

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요