Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

0 votes
Hi,

Is it possible to get the State Groups under the States of a Switch Container object?

Do I need to create a StateGroup object with its children State objects under the parent SwitchContainer object?

Thanks!
in General Discussion by Michelle A. (220 points)

1 Answer

0 votes

To get the switch container assignments states or switches, use: ak.wwise.core.switchContainer.getAssignments
https://www.audiokinetic.com/library/edge/?source=SDK&id=ak__wwise__core__switchcontainer__getassignments.html

To create assignments:

  1. Create the StateGroup and States in your project (under States, in project explorer game sync tab)
  2. Use ak.wwise.core.switchContainer.addAssignment to create an assignment in your switch container
To retrieve or set which switch group or state group is being used on the Switch Container:
  1. To get, use ak.wwise.core.object.get with reference name SwitchGroupOrStateGroup and DefaultSwitchOrState
     "return": [ "@SwitchGroupOrStateGroup", "@DefaultSwitchOrState" ]
  2. To set, use ak.wwise.core.object.setReference, with SwitchGroupOrStateGroup or DefaultSwitchOrState
by Bernard R. (Audiokinetic) (35.8k points)
edited by Bernard R. (Audiokinetic)
I do use getAssignments, but that only seems to get the Assigned Objects in the Contents Editor.  I'm not sure why I'm not also getting the States/StateGroups.  Would they require different WAAPI calls?  Thanks!
Thanks for the precision, I updated the answer.
Thanks for the update.  I'm able to set those references under the General Settings tab, but I'm trying to add State Groups to an object in the States tab.  Is it possible to do that with WAAPI?  When I use get/setAssignments, am I only able to assign objects for whatever switch/state is set in General Settings?  When I set the reference to a Switch, it gets and sets the switches under Assigned Objects.  Do I need to set the Group to a State before I can get/set State Groups?  Thanks!
Sorry, I misunderstood your question. No, it is not possible to set or get the State values in the States tab. I noted your request.
...