Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed convention about glTF node names? #89

Closed
thetuvix opened this issue Sep 17, 2019 · 1 comment
Closed

Fixed convention about glTF node names? #89

thetuvix opened this issue Sep 17, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@thetuvix
Copy link
Contributor

As I wrote up how #88 could simplify node references, I wanted to confirm that we really do need the indirection of allowing profiles to target model-specific node names vs. simply defining well-known names for these glTF nodes.

For example, here is a current component definition for an "xr-standard-thumbstick" component:

"xr-standard-thumbstick" : {
    "rootNodeName" : "THUMBSTICK_PRESS",
    "labelAnchorNodeName" : "thumbstick-label",
    "visualResponses": [
        {
            "rootNodeName": "THUMBSTICK_PRESS",
            "source" : "state",
            "states" : ["pressed"],
            "minNodeName": "UNPRESSED",
            "maxNodeName": "PRESSED"
        },
        {
            "rootNodeName": "THUMBSTICK_X",
            "source" : "xAxis",
            "states" : ["default", "touched", "pressed"]
        },
        {
            "rootNodeName": "THUMBSTICK_Y",
            "source" : "yAxis",
            "states" : ["default", "touched", "pressed"]
        }
    ]
},

However, imagine that the rendering library simply observes the model to have the following nodes:

  • (any name)
    • xr-standard-thumbstick-pressed-min
    • xr-standard-thumbstick-pressed-max
    • xr-standard-thumbstick-pressed-value
      • (any name)
        • xr-standard-thumbstick-xaxis-min
        • xr-standard-thumbstick-xaxis-max
        • xr-standard-thumbstick-xaxis-value
          • (any name)
            • xr-standard-thumbstick-yaxis-min
            • xr-standard-thumbstick-yaxis-max
            • xr-standard-thumbstick-yaxis-value
              • (any name)
    • xr-standard-thumbstick-label

At that point, the rendering library can know purely by convention how to articulate the "xr-standard-thumbstick" component of that input source and find its label node.

Profiles could still define custom components such as "a-button", which would then follow the same pressed naming convention:

  • (any name)
    • a-button-pressed-min
    • a-button-pressed-max
    • a-button-pressed-value

Do you see ways in which this kind of convention could limit how model authors lay out their models? For example, have you encountered cases where a thumbstick's "default", "touched" and "pressed" states won't all articulate the same glTF nodes?

If not, moving to a convention-based system could greatly simplify the asset profile schema, and remove many points of naming divergence across profiles. This could avoid bugs later on where alternate rendering libraries end up taking dependencies on what they believed to be naming conventions in the profiles they looked at (e.g. they observe the trigger is often called "SELECT") but which we'd reserved the right to indirect through the profile (e.g. they end up with a controller where it's called "TRIGGER"). We'd still reserve the right to add in any necessary overrides down the line, while avoiding indirection in advance that may not be needed.

Thoughts?

@NellWaliczek NellWaliczek added this to the October 2019 milestone Sep 19, 2019
@NellWaliczek NellWaliczek added the assets assets package label Oct 9, 2019
@NellWaliczek NellWaliczek self-assigned this Nov 21, 2019
NellWaliczek added a commit that referenced this issue Jan 3, 2020
This change is intended to address issues #88 and #89.  Standard naming
conventions are defined for all nodes named by the asset profile and are
populated by default by the asset package build step. These names can be
overridden by values in the asset's profile.json
NellWaliczek added a commit that referenced this issue Jan 3, 2020
This change is intended to address issues #88 and #89 by defining default naming conventions for all nodes necessary to utilize and associated asset.  These default names are automatically populated into the merged profile during the package build step unless overridden by asset's JSON file.
NellWaliczek added a commit that referenced this issue Jan 6, 2020
This change is intended to address issues #88 and #89 by defining default naming conventions for all nodes necessary to utilize and associated asset.  These default names are automatically populated into the merged profile during the package build step unless overridden by asset's JSON file.
@NellWaliczek
Copy link
Member

Fixed by #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants