Is anyone getting collision to work with Blender?

I can import a model and get move with collisions to work on a model imported from blender .glb against a model created with meshbuilder, but on another model imported from Blender.glb, it goes right through it. If I import a model in obj format, the same code and first model doesn’t go through the second model this time, but the texture isn’t right on the object import. The babylon model loader on a blender export .babylon just shows an error and null with the same code. Stl doesn’t show the texture, but the collision works on it also against the glb model like with the obj model. It’s all the same code, so there seems to be some weird problem with the glb where it partially works on some models, but not against another glb imported model.

You should provide a repro in the Playground so that we can have a look on what’s going on.

Would I be able to get the models in there from google drive or something? I don’t know how that works. I’ve changed the code in playground, that’s all.
Anyway, the same code acts differently when all I do is change the model type in the sceneloader function. What else could it be? It has to be doing something different to the model. It’s the same model exported from Blender in different formats.

This doc may help: https://doc.babylonjs.com/resources/external_pg_assets

As for models behaving differently, maybe it’s because they don’t have the same bounding boxes / spheres depending on the exported format. You should try to display the bounding boxes in each case and see if they are the same.

In any case, a repro will be most helpful.

1 Like

OK, so a repo is a repository. Would a gitLab page work, or would I need to do a github repository? I know virtually nothing about this. Would the gitLab page hold the code and the models so you could look at it? Is it simpler or would it be just as easy to use github? Are they separate servers so I just have to upload without using my machine as a server?

How about if I zip the directory and put it on google drive and post the address?

It is a “repro”, not “repo” :wink:

It is an example you make in https://playground.babylonjs.com/: put your code there, when it is working click on the “save” button and copy/paste the generated url in this thread.

You can use this doc to help you hosting your assets for use in the Playground: Using External Assets - Babylon.js Documentation

OK, my dropbox account is still active so I’ll try using that and get back to you.

OK, I saved it and it showed this as an address:
https://www.babylonjs-playground.com/#4HUQQ#899

Your crate is really the 2nd mesh in the mesh list, not the first:

https://www.babylonjs-playground.com/#4HUQQ#900

I don’t understand how there could be two meshes when there is only one in the project. It works. I’ll try it with some other models, but it seems a little strange that there are two meshes that look the same but the second one works. I guess if it’s consistent, it will be all right.

The first one is not a mesh per see as it has no geometry, it is there to account for the handness of gltf files being different from Babylon. It is named __root__ in the node graph:
image

Well, thanks for your help. I don’t think I would have thought of that. I did actually test the length of the mesh object array and saw it was two instead of one, but since I saw the mesh and it looked the same, I figured the other one was for something else.

There is no error in the console when I run your code, but if I download it and try it on my wamp server, I get this error:
Uncaught TypeError: fr.GLTFLoaderAnimationStartMode is undefined
e https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:26
Qa https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:26
https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:26
n https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:1
https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:26
https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:26
n https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:1
https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:1
https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:1
https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:1
https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js:1

Make sure the version of the different packages (babylon, inspector, loaders, etc) you use are the same.

This topic seems off the rails, a little. One thing you might look at in the 2 different Blends is double check what the settings for physics properties on each of the meshes.

A check for Rigid body is required for the .babylon / JSON exporter. The shapes to correspond to BJS imposter equivalents.

Do not know any requirements for .GLB. You also might want to look that up if documented, unless this is all fixed up by the importer. I seem to remember that in the past .GLB did not support that. Could have changed.

I just downloaded the playground and put it in a folder in wamp and ran it, so the versions should all be the same, I would think. I’ll try to look, I guess.

I’ll check that out and see if it makes a difference, but there does seem to be a collision box around it, it just works on models other than glb unless I use the second mesh, but that seems to cause positioning problems unless I do the asset thing like Evgeni did in the playground, but then I get this error for some reason.

I seem to get that error on everything now. How do I find out line 26 of the inspector bundle. I looked at it and it’s in minified style. BTW, the program still runs normally in every way. It just ignores it. I’ll probably go on to other things, I was just wondering how someone actually reads the code where they get an error in a babylon file. Where is line 26?

In chrome you can “unminify” a source by clicking on “{}”:
image
Look at the bottom left of the screenshot.

OK, thanks.