Jump to content

HowTo? copy mesh animation to camera


Kingmangfx
 Share

Recommended Posts

New to babylon, learning using Blender 2.79 to babylon 3. Using the glTF 2 export / import workflows from blender to Babylon does not load in Cameras or their animations, instead the importer(glTF 2 loader ) creates a mesh for the camera data with animation. 

I thought, to overcome the limitation, to determine a method to extract the animations and hopefully "clone" them to the camera, but I am hoping someone has had some experience with this and may share the optimal method to do so. 

Link to comment
Share on other sites

Hi @Kingmangfx, welcome to the forum.  Sorry for the slow replies.  I don't have any answers, yet, but I'm going to bump and feature this topic.  I'm not sure who is/are the custodian(s) for the Blender gITF 2 importer.  Be sure to ping me in a couple of days... if nobody smarter than I... has replied by then. 

Meantime, if you are a pro at searching for github commits with 'gItf' in their title, perhaps we can determine who has done work on it.  https://github.com/BabylonJS/Babylon.js/blob/master/loaders/src/glTF/2.0/babylon.glTFLoader.ts

That url is for importer, though.  I don't know WHO is working on the Blender-side.  But I think this is an importer thing.

Just possibly, Blender treats cameras more like a mesh... than BJS does.  Thus, we cannot directly transfer Blender camera.animations... onto BJS camera.animations.  Instead, the importer provides a mesh that you should parent your camera-to, at least during the animation-playing.  After camera.parent = mesh, then play the mesh animation, and the camera should go along for the ride... maybe (if initially aimed/oriented properly).   (you might wish to set camParentMesh.visibility = 0)

I don't think our cameras can "scale", so don't try animating that.  :)  But animation that scales a (invisible?) mesh camera.parent... should be no problem.  BJS cameras likely ignore any attempts by a parent... to hand-down their .scaling.

Just speculation on my part.  (sorry).  This topic needed a bump'n'feature, so I might as well yack aimlessly, too.  :)  Talk soon, stay tuned.

Link to comment
Share on other sites

  • Wingnut unfeatured this topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...