I'm having trouble importing mesh and animations from Blender into BabylonJS

I have used .glb files to upload into sandbox but I haven’t been able to find a way to open the file in playground to edit the code. I tried using github raw with this code:

BABYLON.SceneLoader.Append(“https://raw.githubusercontent.com/jordane101/BabylonMailer/main/Mailer.babylon/”, “Mailer.babylon”, scene);

but nothing loads in when I run it. I’m very new to Babylon so I feel like the answer is pretty simple.

Hello Eli and welcome to the forum!

There is the small error in your code. It should look like:

BABYLON.SceneLoader.Append("https://raw.githubusercontent.com/jordane101/BabylonMailer/main/", "Mailer.babylon", scene);

The first parameter is the folder of your file, and the second - your file itself. Also, make sure that you are using usual quotes, not these - ”””””””””””””””””” (like in your example).

There can be also other options in this function, which are decribed in API - SceneLoader | Babylon.js Documentation

3 Likes

Ok i fixed that code but i still can’t see anything in the viewport when I run the code.

Here it is - https://playground.babylonjs.com/#UKNERM#286

3 Likes

Awesome that’s just what I was looking for. Do you have any tips for getting animations into the file as well?

@Eli_Jordan, this guide may help: Mixamo to Blender to Babylon.js | Babylon.js Documentation

Unfortunately, the images are no longer showing up, so here’s a copy we could use temporarily

There are different types of animations which you can use.

  1. BABYLON.Animation - there are different types of it, more info here: Designing Animations | Babylon.js Documentation
  2. Animation Using the Render Loop - Animation Using the Render Loop | Babylon.js Documentation
  3. Skeleton animations - Animating Characters | Babylon.js Documentation
3 Likes

Adding @RaananW and @PirateJC for the doc pictures

1 Like

You might want to check out this thread Help needed with Blender export to Babylon - Questions - Babylon.js where I have been documenting my struggles with exporting from Blender and the workarounds that I found.

2 Likes

Looking into the images. A different thread had the same issues, so it seems to be a wide-spread issue I missed.