New glTF Model Importer - Beta Test

The tangent data and 2 tex coord channels are half-way done.
The data is carried to the engine, but we haven’t added the final part yet, where we put the data into the vertex buffer. It should take any effort really to do that, and I’ll add it next.

1 Like

No problems. I’ll get it stable (broke a few things) and send it to you.

1 Like

Back again. Quick animation test. And wow, its soooo much easier animation wise. Glb seems to be a good way to do this.


I think the import time may be due to the PBR Simple shader I have and its compiling it for each material (thus each object). Im not sure, but that could be why importing is a bit slow.
Anyway… really like it. Release for Defender will be available on Saturday with anin, and multi-object looking pretty good.
Defold rocks :slight_smile:

9 Likes

By the way, how many polygons this model have? It amazes me to see it in Defold! :grin:

1 Like

Its from Sketchfab:
https://skfb.ly/6QT9L - says 77K. Will check though, because via import/export that can often change.

Hi!
I just tried it myself, but couldn’t reproduce it.
Is that another SketchFab model? Could you share the link?

Sorry, the cars I sent you were purchased by myself and are restricted IP. If you try the Mira animation above the import of that is also reasonably slow as well. I havent tried the original gltf and glb which I’ll do tonight - its likely something the shader/gos/collection( that I generate) has in it that is cause slowdown.

< update >
Ive had some issues getting the original Mira into Defold using the source fbx and gltf (Without using Defender). I think there are some settings in the export I dont have right. So I cant really check the above. Will have a look next week. Want to get the Defender updated to to support this new feature.

I have updated the build with some fixes, the download links have been updated.

5 Likes

Tested collada support again and all is working well , static non animated models are rendering and the animations are translating correctly, nice and smooth like butter.

I cannot seem to import multiple meshes from blender export or at least they do not seem to render. I tested my exported files to make sure they have correct data outside of defold. I usually export by selected objects only, I get this error when exporting the whole scene instead of selected only and then running a build -

Image shows the result in editor before build error. The scene contains 49 seperate meshes | 4,480 verts total. The editor shows 2 meshes, one vehicle and wheels, exported with up-axis correction btw that’s why the car is correct. All transforms are applied before export shouldn’t have this strange issue.

ERROR: Assertion failed: size <= Capacity(), file D:\a\defold\defold\tmp\dynamo_home\sdk\include\dmsdk/dlib/array.h, line 505


I found another issue when exporting glTF as a single mesh with an armature(single animation) from blender and setting up a model in defold adding it to a collection , without a skeleton - animation or default animation set in the model properties at all (no animationset file either) , when running a build the model will play the animation anyway. The model properties below are set this way and the model still plays animation.
animation_issue


In my test project I have imported .dea models as well as single object .glb exports for a car and wheels (not animated). I placed these models next to each other in the editor with a shadow sprite underneath each of the cars. As you can see in the image below the cop car is .dea and the red flame car is .glb in the editor placement is fine but when I build the project the .glb model is off position ( shown to the left ).


Update: added more glTF models and there are inconsistencies between what the editor shows and what you see when the project is built. - More testing I think the models might be offsetting due to the meshes origin point from the zero world position in blender (The origin point should be respected as the pivot?) This would mean that all single meshes that need to be exported as glTF would have to be set to world position xyz(0,0,0) before exporting in order for the origin/pivot to be preserved.


I have found a bug as well in Animation Set / editor :
To reproduce you set a skeleton and you add animation(s) , if you select an animation then press the ( - ) minus button, instead of removing the selected animation it duplicates the list of animations. If you do it to many times it creates a big duplicate list and causes the editor to bug out and not work.


@Mathias_Westerdahl I would like to share my test project with you it comes with the blender file assets I’ve created for this test, you have my permission to use it for testing purposes and see these issues first hand if you’d like.
Test_importer_Agustin.zip (408.9 KB)

3 Likes

THanks for testing, and thanks for the test data!
I’ll check these issues out!

I’ve added this animation set ticket. Hopefully the editor can help me out there.
The rest of the issues are on me I believe :slight_smile:

2 Likes

I have updated the build with some fixes, the download links have been updated.

2 Likes

Quick feedback -

Confirmed animation set bug has been fixed.


Models are no longer rendered in editor , confirmed by viewing collections in several 3d projects.

Image below has 4 3d projects showing 3d models not rendering in editor.

Would this be the cause for models not rendering in editor?

The RenderCam .dae no longer displays in the editor(I think neither does the glb version), but now both versions display in engine.

Hmm, ues Im guessing the tangent+color PR broke something in the editor.
I’ll have look at that as well.

3 Likes

We currently only import the first model from the scene.
We do however import all the meshes from that model.

In the future, we may support importing the whole scene with lots of models in it, but it’s not something we’ve planned or designed for yet.

3 Likes

I’ve updated the download links with a fixed version that now displays the models in the editor again.

I also have a fix for the pivots of the model coming up (currently building on CI)
And also a fix for the car being animated, even though it shouldn’t be.

4 Likes

Yes, I’m currently looking into this now. It seems that somehow, the animation of the other collada car is applied to this car also.

@MasterMind Another problem I see is the CopCar, which doesn’t get a proper transform from the Blender export, but instead, the vertices are in “world space”.
The other cars get proper transform matrices at export.
I suggest rearranging the CopCar to have the same structure as the other cars.

2 Likes

I’ve updated the download links once again.

Currently, I’m not sure there are any outstanding issues.
Please let me know if I’ve missed anything or if you find some new issue.

4 Likes

Tested - (9e91f7c)

Finally have the time to give some feedback. Models are rendering in editor once again , nice. Pivots seem to be fine , I may have found one issue though will elaborate below. I can now focus on testing the animation side of things, this took a lot more testing and so more time to gather details and test export settings combinations.

Ah I see , so a single model object with combined meshes. This makes sense. I tested with both .dea and glTF exports.


Top layer is .dea and the bottom row is .glb, both working just fine.


I didn’t clean up the file as I should have and left over modifiers and vertex groups on the non animated models and for the copcar is in local space the only difference is the armature structure. I did however find a possible issue, I think it may be converting space when exporting with skinned setting , this setting has to be used when exporting animation in order for it to work in defold. Exporting skinned model does create an offset like before, non skinned models are fine now.


The non animated wheels are the now corrected pivot showing in correct position and the cop car is a .glTF skinned model now showing offset however when project is built the position is correct when playing an animation. If no animation is playing the offset is visible .


I found that when trying to setup single animations in model properties like you can with dea, it does not work and in “Default Animation” section does not display the animation.

Single_animation_setting


When setting up an .animationset with glTF multiple animations and setting it to the model only one of the animations will play no matter what is set in “Default Animation” property. I believe it only plays the first animation in the list. I will test playing from code and report if that also doesn’t work soon!

Here is the updated project if you wanted to take a look.
Test_importer_Agustin.zip (1.0 MB)

I have set the Animation.collection to default collection in project settings > bootstrap for testing animation.

2 Likes

I too wanted to play a bit with those lovely cars in @mastermind `s test file - on a mac mini m1.

I ran into a couple of probs:

nothing there when clicking on one of the models in the animation folder .

Also nothing there when clicking on these models in the model folder:
image832

Don’t know if this is to be expected, but clicking on the animation sets produces this:
Screenshot 2022-09-06 at 07.46.47
Screenshot 2022-09-06 at 07.46.54

So, I can’t run the animation collection at all:
Screenshot 2022-09-06 at 07.48.31

Trying to run the main collection with the above mentioned models in it produces this error:

java.util.concurrent.ExecutionException: com.google.protobuf.UninitializedMessageException: Message missing required fields: mesh_set
com.google.protobuf.UninitializedMessageException: Message missing required fields: mesh_set

This collection only runs when these models are all removed. None of these models is visible in the viewport anyway. The remaining cars render fine and the animation works smoothly, too.

EDIT:
sorry, my fault, I haven’t used the editor version @Mathias_Westerdahl has linked at the top (see posts below)