AnalyticalGraphicsInc / gltf-vscode

This is an extension for Visual Studio Code to add support for editing glTF files.
Apache License 2.0
460 stars 63 forks source link

How to use gltf animation extension in Visual Studio Code? #122

Closed pegot closed 6 years ago

pegot commented 6 years ago

Hoping someone can explain or point me in the right direction for help in getting glTF animations to play in Mixed Reality viewer and in PowerPoint. I’m using Visual Studio Code with the glTF Tools Extension (21.16) to try and add an Animation trigger to my glb file (which was exported from Blender).

However, I keep getting a glTF Validation error: Unsupported extension encountered: ‘EXT_animation_map’. I’m following the instructions from this Microsoft Mixed Reality guide: https://docs.microsoft.com/en-us/windows/mixed-reality/creating-3d-models-for-use-in-the-windows-mixed-reality-home#animation-guidelines

I also tried it using code from the FB_animation_map extension below but also got Extension not found error: https://github.com/msfeldstein/glTF/blob/04f7005206257cf97b215df5e3f469d7838c1fee/extensions/Vendor/FB_animation_map/README.md

Is there something else I need installed or configured in Visual Studio to make this work?

lexaknyazev commented 6 years ago

Validation feedback means only that the Validator doesn't support an extension. We'll refine the message in the next release.

pegot commented 6 years ago

Ok thanks for the feedback. Do you know if there is something else I need to be doing aside from adding in the referenced code to trigger the animations in Miscrosoft's Mixed Reality Viewer? Because even though I add the trigger code, when I save the glb file I edited in gltf-svcode, the animations do not appear in MRV (they do show in all three gltf viewers within gltf-svcode).

HowardWolosky commented 6 years ago

@sbtron might be able to help out with issues on integrating glTF within MS products.

pegot commented 6 years ago

Thank you. I shall contact him.

sbtron commented 6 years ago

The ext_animation_maps extension is only supported in Mixed Reality Portal and not in any other products. See some of the demos showed at SIGGRAPH. Are you having trouble with the triggers in the Mixed Reality Environment?

pegot commented 6 years ago

Is the Mixed Reality Portal different than the Mixed Reality Viewer application that comes with Windows 10? Basically, I am trying to get animated 3d glTF files into PowerPoint to take advantage of the new 3d functionality there. My workflow is creating 3d objects / animations in Blender and exporting them using the glTF Blender exporter plugin. Opening the glTF files exported from Blender with Visual Studio Code and editing them by adding in the animation extension - then saving as a glb file. Unfortunately, the animations do not show up either in the Mixed Reality Viewer or PowerPoint.

sbtron commented 6 years ago

Yes the Portal is a different application (you see it when you put on a MR headset). You don't need the ext_animation_map extension for any of the other applications.

Currently the Mixed Reality Viewer and PowerPoint don't support Node animations. So if you are using those things may not animate. Also only recent PowerPoint insider builds have support for skeleton animations, so make sure you are using the latest builds - https://support.office.com/en-us/article/animation-in-3d-ad6ade3a-be41-4cf1-b761-46dcfd14dfc8?ui=en-US&rs=en-US&ad=US

pegot commented 6 years ago

I currently do have the version of PowerPoint that can embed and play animated 3d files (Version 11809 Build 10827.201181). And animated files I import from within the application itself using the Online 3d Models work and look great. But how do I author my own models so their animation shows up in PowerPoint? How were the online 3d models created and is there a tool set or specific prodecdure to follow for that?

sbtron commented 6 years ago

Currently only skeleton (or skinned or bone) animations are supported. So samples like this should work -> https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/BrainStem

But simple node animations won't work yet -> https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/BoxAnimated

Depending on what you are trying to do if you were to "rig" you animations with bones then it should work. But if you are doing simple node transforms then it won't work yet. Hope that helps

pegot commented 6 years ago

Ah that sounds right! I have a sample glb from a completely different source that (kind of) works in the Mixed Reality Viewer (but throws an error if trying to import into PowerPoint). And that model was definitely rigged with bone animations. So thank you very much for this information and links. I now have a concrete direction in which to to continue my explorations and testing.

sbtron commented 6 years ago

If a model fails to load due to an explicit error then it would be very useful if you could share a bug report through Office feedback - https://support.office.com/en-US/article/How-do-I-give-feedback-on-Microsoft-Office-2b102d44-b43f-4dd2-9ff4-23cf144cfb11

pegot commented 6 years ago

No explicit error code on that file (which I myself did not create) but going forward in my testing I will certainly post any such errors I encounter to the provided link - again, thanks!

emackey commented 6 years ago

Thanks @sbtron, @lexaknyazev, and @HowardWolosky.