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.

Wwise Authoring API 中设置颜色无报错但无效

0 votes
"@Color": "1",与"@Color": 1,均无效
asked Dec 28, 2020 in General Discussion by cai x. (150 points)

1 Answer

+1 vote
 
Best answer

Hi, the property "OverrideColor" also should set to be True. So that the color setting will work.

"property": "OverrideColor",
"value": True

answered Dec 29, 2020 by Christopher Lou (460 points)
selected Dec 29, 2020 by cai x.
Error    11:27:44    WampInvokeError    WAMP CALL error 'ak.wwise.invalid_property' invoking 'ak.wwise.core.object.setProperty': 'Property cannot be set.'    Args:
{
    "object": "\\Actor-Mixer Hierarchy\\New Work Unit\\unit\\audio3",
    "property": "OverrideColor",
    "value": true
}
Override Color and Color Property can only be set with Wwise 2019.2.8 and above:
https://www.audiokinetic.com/fr/library/2019.2.8_7432/?source=SDK&id=releasenotes.html

Or, you can apply the following procedure:
https://www.audiokinetic.com/qa/6922/waapi-changing-color-not-working-overridecolor-property
That's weird. It did work in wwise 2019.2.5 or 2021.1.0 last week. But I can not modify OverrideColor value now, even in 2019.2.8.
And I also changed the IsVisible value in WObjects.xml.

https://www.audiokinetic.com/qa/6922/waapi-changing-color-not-working-overridecolor-property

But it seems to make the OverrideColor property be available on "All Properties" tab in Sound Property Editor. The error report in 2019.2.8:

2021-01-06T16:37:15 WaapiClientAutobahn (ERROR): ('ApplicationError(error=<ak.wwise.invalid_arguments>, args=[], '
 "kwargs={'message': 'Argument property  is unknown.', 'details': "
 "{'argumentName': 'property ', 'typeUri': "
 "'ak.wwise.schema_validation_failed', 'schemaKeyword': "
 "'additionalProperties', 'argumentPointer': '/property ', 'procedureUri': "
 "'ak.wwise.core.object.setProperty', 'schemaExpect': 'false', "
 '\'schemaPointer\': \'\', \'argumentValue\': \'"OverrideColor"\', '
 "'schemaDescription': ''}}, enc_algo=None, callee=None, callee_authid=None, "
 'callee_authrole=None, forward_for=None)')
Make sure there is no space after 'property '
I used this code for my python script and it worked:

def set_object_color_override(object_path):
    """
    Active ou désactive l'override de couleur pour un objet spécifié par son chemin.
    """
    args = {
        "object": object_path,
        "property": "OverrideColor",
        "value": True
    }
    client.call("ak.wwise.core.object.setProperty", args)

def set_object_color(object_path, color_index):
    """
    Définit la couleur d'un objet spécifié par son chemin.
    """
    args = {
        "object": object_path,
        "property": "Color",
        "value": 4  #Red color
    }
    client.call("ak.wwise.core.object.setProperty", args)
...