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

Add option to import animations only #7252

Merged
merged 29 commits into from
Dec 5, 2019
Merged

Add option to import animations only #7252

merged 29 commits into from
Dec 5, 2019

Conversation

noalak
Copy link
Contributor

@noalak noalak commented Dec 3, 2019

This PR is resolving issue BabylonJS/Exporters#537 (linked to BabylonJS/Exporters#525).

This is the import part of the process. See PR BabylonJS/Exporters#702 for the export part.

@Drigax, @elpie89, @Selmar are invited to test the export and import process. Samples are provided in the exporter AnimationsOnly samples folder or can be downloaded via WeTransfer here.

The idea is to first load a scene file and then any animation file.
The node names and hierarchy must be identical to be able to link animation and scene files.

You can import animation files through:

  1. The Inspector > Tools tab
  2. The babylon sandbox bottom menu, once a first file has been loaded

ImportAnimationsUI

@noalak
Copy link
Contributor Author

noalak commented Dec 3, 2019

Next are TECHNICAL notes.

USE CASES

The import animation button in bottom menu of the sandbox will perform 2 operations:

  • load animations
  • update the sandbox bottom bar (animation progress bar and animation group dropdown).

The import animation button in the inspector will only load animations. There are not callbacks available by the sandbox.

The use cases are expected to be:

  • in the sandbox, use the sandbox button
  • outside of the sandbox, use the inspector window

EDIT: No import animation button in bottom menu of the sandbox. A callback will be added when animation merge is complete.

CONSECUTIVE LOADS OF ANIMATIONS

The simple animations are always discarded between 2 consecutive loads of animation files.

The group animations are appended between 2 consecutive loads of animation files. An animation group with same name as one previously loaded will override the previous one.

Note that from the 3dsMax and Maya exporters, all animations are exported in glTF as group animations, even the simpliest ones.
Thus in glTF, simple animations are exported as a animation group named "All animations". Consecutive loads of such simple animations will result in discarding previous animations since the animation group name is always the same.

EDIT: Add an option to choose between 'append' and 'overwrite' modes.

@deltakosh
Copy link
Contributor

So overall:

  • Please do not change sandbox UI at all (use the observable for instance to keep it in sync)
  • The API should provide an option to merge instead of overwrite animations

@deltakosh
Copy link
Contributor

You must run npm run build anyway to make sure the PR is correct :) That will update the d.ts for you but yeah please ignore the dist files for the PR itself

@deltakosh
Copy link
Contributor

deltakosh commented Dec 4, 2019

Well! now you need to check why the CI is failing :D

@noalak
Copy link
Contributor Author

noalak commented Dec 4, 2019

I still need to build successfully on my PC :)

@deltakosh
Copy link
Contributor

Good luck ;D

@noalak
Copy link
Contributor Author

noalak commented Dec 5, 2019

Build -> successful!
TODO -> done!

@deltakosh
Copy link
Contributor

Yeah Congrats!!! Do you mind updating the doc and provide some examples files for the doc?
https://doc.babylonjs.com/how_to/load_from_any_file_type

@deltakosh deltakosh merged commit 34751f6 into BabylonJS:master Dec 5, 2019
@noalak
Copy link
Contributor Author

noalak commented Dec 5, 2019

Sure

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

Successfully merging this pull request may close these issues.

3 participants