glTF support camera animations?

blender-exporter
gltf-exporter

#1

I have added camera animations in blender and the animation works perfect when run in blender. When I export the animation through glTF exporter, camera animation is exported but not animating.

While exporting I have checked ‘export camera’ option too.

Please help @donmccurdy

(Forgive me for not sharing the model here as I do not have permissions for that !!)


#2

Have you tried viewing the glTF model in https://gltf-viewer.donmccurdy.com/, and could you confirm the following?

  1. The UI in the upper right shows a “Cameras” dropdown with your camera.
  2. The UI in the upper right shows an “Animations” list with at least 1 animation.

#3

Yes https://gltf-viewer.donmccurdy.com/ I am using this more often to check the models.

I do see ‘Animations’ option on upper right corner but not ‘Cameras’


#4

Hm ok. If you’re checking “export camera” but not seeing cameras in that list, it sounds like something is going wrong during export and it’s not a three.js issue. If you can’t share your model, are you able to make a simpler example .blend with no private data that reproduces the problem?


#5

Sure I will try to to make a simple model and give it a try.


#6

I have attached a sample model where I have added a very basic camera animation.
Animation looks fine in blender but when I export it as glTF binary I don’t see any camera movement in https://gltf-viewer.donmccurdy.com/ . I do see ‘Cameras’ in upper right corner.

I guess I might be doing something wrong in belnder. Please have a look and let me know the issue.

cam-anim-1.blend (458.8 KB)
cam-anim-1.glb (2.4 KB)


#7

@donmccurdy Did you get a chance to look at above sample models? If you need a detailed sample model than I can ask my design team to provide a better one.

My requirement is, the way camera animation is happening in blender same should happen when exported as .glb file.


#8

It looks like you’ll need to bake keyframes from the NURBs curve before exporting, see https://blender.stackexchange.com/questions/23713/bake-path-animation. Object -> Animation -> Bake Action.


#9

@donmccurdy sorry for delayed response, yes baking of keyframes worked for me. Thanks!