-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
EXT_animation_map extension proposal #1137
Open
msfeldstein
wants to merge
16
commits into
KhronosGroup:main
Choose a base branch
from
msfeldstein:ext_animation_map
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
730df4e
Add EXT_animation_map extension spec
msfeldstein 2bb65b0
EXT -> FB
msfeldstein 6a022ac
Clarify animation play type
msfeldstein 5cf7dba
serial->sequential
msfeldstein 09ea0c8
Specify Nodes for interactive animations
msfeldstein cfa2bf7
node->nodes, specify that any node can trigger
msfeldstein 24901c3
Update to specify that it can be any nodes triggering
msfeldstein d7a5a25
number --> integer
msfeldstein 04f7005
Add unique items and min items
msfeldstein 211dd1d
Use EXT_ instead of FB_
msfeldstein 087a563
Add pointer semantics
msfeldstein 800e38d
Update README.md
msfeldstein 551b19d
Update the semantics/nodes binding wording
bb1e9fb
Update the semantics/nodes binding wording
d7761f8
formalize semantic names
955ec8b
Add glTF property schemas to animation map schema
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Add EXT_animation_map extension spec
- Loading branch information
commit 730df4e94f2b7e0cee5c4e0e3166bd8f52fa4932
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# EXT_animation_map | ||
|
||
## Contributors | ||
|
||
* Michael Feldstein, Facebook, [@msfeldstein](https://twitter.com/msfeldstein) | ||
* Ocean Quigley, Facebook, [@oceanquigley](https://twitter.com/oceanquigley) | ||
|
||
## Status | ||
|
||
Draft | ||
|
||
## Dependencies | ||
|
||
Written against the glTF draft 2.0 spec. | ||
|
||
## Overview | ||
|
||
This extensions maps optional semantic meaning to animations so that client applications can attach interactive and reactive behaviors to the 3d models and scenes. This can be useful to let a client know to play a certain animation when the model first enters a scene, or when a model is about to leave. | ||
|
||
Facebook uses it to play animations when a model enters/leaves the feed, or scrubs an animation as the user scrolls the model through the screen. | ||
It is also used to respond to user events, such as tapping, or horizontal panning | ||
|
||
It maps a semantic, which can be any string a client wishes to bind, to an array of animation indices, pointing to a list of gltf Animation. | ||
|
||
##### Example Semantics | ||
|
||
* **ENTER**: Trigger a single shot animation when the object first enters the scene or viewport | ||
* **LEAVE**: Trigger a single shot animation as the object is leaving the scene or viewport | ||
* **ALWAYS**: Constantly loop an animation | ||
* **TRIGGER**: A user triggering a single shot animation on Touch, Tap, Click, or any other way of activating | ||
* **GRAB**: Triggered when an object is picked up, for example grabbed in vr, or dragged in WebGL. | ||
* **HELD**: Looped during the entire duration an object is grabbed. | ||
* **RELEASED**: Triggered when an object is released from a grab. | ||
* **GAZE_ENTER**: Triggered when an object is first looked at | ||
* **GAZE**: Looped while an object is being looked at | ||
* **GAZE_LEAVE**: Triggered when an object stops being looked at | ||
* **PROXIMITY_ENTER**: Triggered when a viewer gets close to an object | ||
* **PROXIMITY**: Looped while a viewer is near to an object | ||
* **PROXIMITY_LEAVE**: Triggered when a viewer gets further from an object | ||
|
||
## glTF Schema Updates | ||
|
||
The new EXT_animation_map property is a root glTF level optional extension object. The **bindings** array is a list of objects with a semantic, and an array of animations mapped to that semantic. | ||
|
||
**Listing 1**: An animation map that binds animations 0 and 3 to the ENTER event, 1 to the LEAVE event, and 2 to loop continuously for the life of the object. | ||
|
||
```javascript | ||
{ | ||
"extensionsUsed": { | ||
"EXT_animation_map" | ||
}, | ||
"extensions" : { | ||
"EXT_animation_map" : { | ||
"bindings": [ | ||
{ | ||
"semantic": "ENTER", | ||
"animations": [0, 3] | ||
}, | ||
{ | ||
"semantic": "LEAVE", | ||
"animations": [1] | ||
}, | ||
{ | ||
"semantic": "ALWAYS", | ||
"animations": [2] | ||
} | ||
] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
### JSON Schema | ||
|
||
TODO: Links to the JSON schema for the new extension properties. | ||
|
||
## Known Implementations | ||
|
||
* None yet, will be implemented in Facebook 3d Posts | ||
|
||
## Resources | ||
|
||
* |
30 changes: 30 additions & 0 deletions
30
extensions/Vendor/EXT_animation_map/schema/EXT_animation_map.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"$schema" : "http://json-schema.org/draft-04/schema", | ||
"title" : "EXT_animation_map extension", | ||
"type" : "object", | ||
"definitions": { | ||
"semanticBinding": { | ||
"type": "object", | ||
"properties": { | ||
"semantic": { | ||
"type": "string" | ||
}, | ||
"animations": { | ||
"type": "array", | ||
"items": { | ||
"type": "number", | ||
"minimum": 0 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"properties" : { | ||
"bindings" : { | ||
"type" : "array", | ||
"description" : "A list of bindings between event or state semantics and animation indexes", | ||
"items": { "$ref": "#/definitions/semanticBinding" } | ||
} | ||
}, | ||
"required" : ["bindings"] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how to read these schema definitions so I'll just ask... can a bindings object have
extras
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe anything in a gltf schema can have extras right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case,
semanticBinding
definition needs to containThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks