OpenUSD icon indicating copy to clipboard operation
OpenUSD copied to clipboard

Apple: Accessibility and Localization API schemas

Open dgovil opened this issue 5 months ago • 14 comments

This commit adds two applied API schemas to UsdUI as an attempt to make it a Universally Accessible Scene Description.

Disclaimer: This addition does not represent any future feature support in our products. These schemas are borne out of discussing the needs for the ecosystem to accommodate a wider range of users.

Overview

A brief overview of the two schemas:

Accessibility API

Proposal

def "Foo"(
    apiSchemas = ["AccessibilityAPI:default"]
) {
    string accessibility:label = "Short Label"
    string accessibility:description = "A longer description of this prim"
    uniform token accessibility:priority = "standard"
}

UsdUIAccessibilityAPI is a multiple apply schema. Each instance has three attributes:

label: A short description of the prim description: An extended description of the prim priority: A hint to a runtime on how this instance should be valued

The default instance does not namespace itself with the instance name as we believe it will be the only one specified in many cases, and the excess namespace doesn't add clarity.

As a convenience, the API specifies a default name so users of Apply() do not need to specify a name most of the time.

Localization API

Proposal

def "Foo" (
    apiSchemas = ["LocalizationAPI:default", "LocalizationAPI:fr_CA"]
)
{
     uniform token localization:lang = "en_US"
     string foo = "Hello"
     string foo:lang:fr_CA = "Bonjour"
     string foo:lang:hi_IN = "नमस्ते"
}

UsdUILocalizationAPI is also a multiple apply schema. However here it uses the multiple apply to denote what language are available or that a default localization is available on a prim.

It includes one attribute that doesn't use an instance name called localization:langauge which specifies the default language to assume.

All other applications are suffixed to properties with :lang:<language>

Feedback and Remaining Work

It would be greatly appreciated if feedback could be provided with a focus on the schema first so we can nail down how to represent the data in the USD.

I also haven't finished wrapping the LocalizationAPI methods in Python because I would like to first get feedback on the C++ API so that I may iterate faster. Once we feel the API looks good, I'll handle the Python bindings and write appropriate tests for them as well.

  • [X] I have verified that all unit tests pass with the proposed changes
  • [X] I have submitted a signed Contributor License Agreement

dgovil avatar Sep 04 '24 21:09 dgovil