I tried to search 3D assets. I load .blend file in Blender, export it with babylonjs plugin, but I can’t open it correctly in BabylonJS Editor. Usually it appears without textures and animations or completely invisible.
Unfortunately, I completely new in 3D tools like Blender. So, most likely I just miss some important steps. Can anyone provide step-by-step instructions how to prepare external textured and animated 3D objects to import.
I would recommend to start with simple examples. Here are some good assets:
This folder contains several scenes, where each of them a glTF 2.0 feature is introduced.
Because of their simplicity, they are also a reference on how to implement a glTF 2.0 material in Blender.
Unfortunately, provided advices didn’t help much. Some glTF-Blender-Exporter examples even failed to export. And it doesn’t explain all I need. With such simple examples without animation I hadn’t problems even on my own. I even mentioned about it here: How to attach physics to imported mesh?
What I really want to know is how to integrate blender models downloaded from free sites into Babylon projects. Especially interested in weapons for FPS games for now. Particularly texturing, firing and reloading animations are expected in those models. But Blender allows everything of it in different ways. Meshes might be animated in Object Mode or Posing Mode, might be integrated into .blender file or exist as separate files. Also there is a lot of options for textures. All of downloaded models didn’t work correctly right from the box. I tried to export it as .babylon, .gltf and .obj. Everything had different problems. Which format is preferable by the way?
I will be very grateful if someone will share a video with creating, texturing and animating of weapon and following exporting and importing of it into Babylon. Or at least a process of adaptation of 3rd party weapon model for Babylon. Or at very least if someone will share animated and textured weapon models for .blender that will work with Babylon (with 100% confidence). Blender 2.80 is preferable.
I understand that probably I am asking too much. I am not very familiar with Blender. Of course I’ve watched basic tutorial, but it doesn’t cover the whole process. It’s only about Blender itself. And I need particular practical examples specially for Babylon. I am a programmer, not an artist. I just need some working assets to train Babylon coding skills.
@splash27 : I took a look in Blender 2.76 at the file in the link you posted above. Loads into Blender fine. Then I exported it to .babylon and tried to open it in the sandbox. I got this error message 6X :
BJS - [14:50:40]: Invalid magic number in DDS header.
I have no idea what that means - maybe @Deltakosh or one of the other Microsoft folks can tell us.
It turns out that there are 20 DDS textures exported and 2 of them are 10+MB in size and 2 are 5+MB in size. That is quite a load, but I have no idea which are the six that produce that produce those 6 errors.
The geometry looks OK but 75 bones is a lot of bones.
Given the issues with the textures, I just opened the exported the file from Blender with the Babylon Exporter and then opened the . babylon file in the sandbox - just by itself - no textures. See image below.
It loads with lots of checker textures substituted for the missing textures. With the panels open, I then went Select Skeletons->Metarig (A), then in the right panel select Animation Ranges->Click on an animation (B).
The animations play fine. So the issue seems to be with those DDS textures.
From the download site, I see some comments that it was ripped from a game - probably explains all those DDS textures. You could export them all from the Blender file as .png files. Then delete all the DDS files from the Blender file and replace them with those png files and try again. A lot of work I know.
There is also a TGA file. No idea if BJS can use those.
I’m not around a lot at the moment due to family medical problems
By my experience about 50% of free 3D models lack something or have some flaws in them (that is why they are free, sometimes). So, if you are unfamiliar to Blender, sometimes it is wiser to spend a bit and buy 100% working model than spend several days trying to repair a broken one.
Thanks a lot I will try to play around it also. But please share your progress if you’ll try to continue to dig into it later. Wishing well to your family.
It is acceptable in general, but how can I be sure that bought model will work fine in Babylon?
First I need to understand the whole process and repairing of broken model might be very good for training purposes. But for now I don’t know how to do this, that’s why I started this topic.
Hello there, I have run into the same problem. Actually I have not yet found even ONE free animated 3D model that would work out of the box. Only modelst that are used in BJS examples does work offcourse. This fact prvents me from buying paid models because I am afraid that they won´t work either Usually no textures appears and animations do not work. As I am developer and not 3D modeller, this is sadly show stopper for me :-/ I could somehow edit these models in Blender, but I dont know where to start - it is everything as you said - many ways to have things done while some way work and other does not.
If someone can find simple tutorial how to implement texture and simple animation in blender that WILL work once imported into BJS - that would be massive :))
nod. i guess around 10% of our Q&A posts… involve SOME problem with a model-import… in a myriad of different ways. Sometimes I think we need a stand-alone “Model Massager” … it attempts to make ANY model… BJS-ready, and if it can’t, it explains why.
Model-massaging should be one of our highest priorities, but it’s not. The model-massager should probably be part of the BJS Sandbox.
It’s easy for me to TALK ABOUT model-converting and model-massaging, but to actually build it/them… is probably a miserable task. Still, bad model-importing REALLY hurts BJS reputation… so the quicker/better we can make that happen, the quicker/better BJS reputation… skyrockets.
Thanks for the topic, Splash. Even though it hurts, it’s still the truth. It isn’t really anyone’s “fault”… it’s just that there’s lots of model formats happening, and we haven’t found/built great tools to deal with that, yet.
I suppose that 90% model-import questions are about Blender, other DCC tools have much less problems. Also, most of the solutions of these questions should be implemented in Blender before exporting to Babylon… so they are more Blender-side questions…
Anyway I suppose we need a kind of separate tutorial for Blender users with a lot of screenshots and 2 main topics (at least):
How to correctly export static 3D model with all textures.
How to correctly export animated/rigged 3D model with all textures and animations.
How to understand that model which you’ve downloaded is bad or broken and don’t waste time trying to work with it
Plenty of SketchUp and SketchFab questions, as well. Unity, Maya, 3dsMax, others, too.
(Some-) People want plug’n’play models to populate their scenes. They want to drive “this” and fly “that” and throw “the other”. These people are not modellers, they are scene-layout and game-logic folk. They want physics and collisions possible on everything they import, and they often want to change the colors and textures… in-scene (without even SEEING the inside of a modeller program).
They HATE root nodes. They don’t want to drill-into the hierachy of the model or its subMesh… in the inspector. They JUST want it to work, and be properly lit/shadow-casting, and have ONE gizmo/parent to position/rotate/scale. They want it easy, and it’s easy to understand why.
Math/BJS-built models are cool, too - no import needed… just a code paste. All too rare.
Plug’n’play game/sim-making… I want it myself. Learning a modeller package… WHILE learning BabylonJS and geometry and all their terms… makes the game-making task just “too much”. Advanced modelling comes later… after the mock-up and proof-of-concept is tested. If the user’s dream/vision… is too big for mock-up performance, then there’s no reason to spend a half-year learning to drive a modeller and making dream-specific models. That’s my take.
I suppose the best solution would be to create DCC modeller on the basis of Babylon engine. Since Babylon goes Native soon there could be online and offline versions. I hope we shall see Babylon modeller in not very distant future…
Why not a “convert ANYTHING to BJS-plug’n’play” stand-alone program? Making a modeller is a massive task… me suspects.
Back in the old days, we had a “make a .babylon file from other formats” thing… if I rem right. Long ago… probably outdated and recycled by now.
Does anyone want to venture a guess… of how many stand-alone 3D model formats… exist across the planet, at this time? Let’s hear it. Don’t forget JSON, Collada, Renderman, Lightwave, and X3d. (vacuum tube model formats) heh
If we speak about exchange formats - their number is very small.
Below is the list of supported 3D File Formats from Sketchfab
Only FOUR formats (marked bold) are recommended…
@splash27 : Well, I had a couple of hours yesterday to poke around with your file. I created all the texture files as .png (both the .dds and .tga) files. Then replaced them all as textures in the Blender file. (I removed those textures that were assigned as normal textures - just left them blank.) Image 1 shows the result.
I also tested out the animations - the “add silencer” is weird. From the starting camera position the silencer is invisible - you see just an empty hand. If you move the camera to a side view - then it works fine No idea what is going on but see Image2 below
Anyway here is a zip file contains the exported .babylon file and all the new textures (no normal textures). Try it yourself in the sandbox - select the metarig skeleton and play the anims as I said above.
There is also a .log file included from the .babylon export. It shows 20 + warnings most of which are the lack of normal textures. A couple refer to the geometry - vertices with no faces and bone influence exceeding the standard. Let me know if you would like the .blender file - I can zip that up too.
No feedback from the Microsoft guys about what those .dds errors I mentioned above are …
Some other thoughts. For weapons alongside with first person view we also typically need to add pickable instances. I mean rifles just laying on the floor that we can grab. I suppose that in real life artists create separate low polygon models for this purpose, without any animations included (because it’s not needed). Just wondering if it’s possible to do this from the same loaded file in Babylon? We can, for example, clone every mesh of the rifle (except hands) and merge them to simplify positioning and scaling of the whole rifle. Then we can clone this merged rifle as much times as we need (I think it will be even better to create instances here instead of cloning).
However there are some things that worries me here:
I am not sure that merging of meshes will work correctly here for such complex structure. But instead we can parent all child components to invisible box, for example.
I want to be sure that cloned components will forget everything about metarig and animations (to save memory). And playback of rifle’s animations in hands will not touch these cloned instances.
Just thoughts. I will try it later and will respond here. But please share your thoughts about this if you know something.
At about 7 minutes in, he deletes all these extra bones.
There are other bones in the gun eg. “bullet”. I checked the animations and it does not seem to do anything. Is it needed? You might want to check all those bones in the gun - are they needed?
If you examine the meshes in the Edit Mode, you will find that you can “remove doubles” but it screws up the animations. You might want to consider creating your meshes and rig as described in the above video. (A quick test let me remove 5K+ vets)
If you are looking for pre-modeled low poly guns, this link might help : Ultimate Gun Pack by Quaternius.zip 7 MB. They are free to download - but make a donation if you can. All kinds of weapons.
The exporter will throw errors due to the lack of Nornal textures. You can either add those normal textures in a .png format, or go through the all the materials and delete references to normal textures.
@gryff,
Thank you a lot. I was trying to integrate it into my engine and it works.
However I tried to edit your .blend file. Removed unnecessary bones and animations (that I don’t need). I also removed all channels in all animations that was related to removed bones. And also added one new necessary for me animation (hide_unsil, just reversed version of draw_unsil actually).
Now I can’t export it correctly: