Aerion

OBJ file not loading correctly?

Recommended Posts

Hi folks. Can someone please tell me why my tree model "deciduous01.dae" is not loading correctly?

It loads, but then it gives an error "BJS - [06:39:35]: importMesh of undefined from undefined version: undefined, exporter version: undefinedimportMesh has failed JSON parse"

This is the demo : 

http://babylontesting.epizy.com/loader/main.php

This happens with the OBJ version of the Object as well.

http://babylontesting.epizy.com/loader/models/deciduous/01/deciduous01/deciduous01.obj

I also can't get the textures to load. I have them in the same folder...

http://babylontesting.epizy.com/loader/models/deciduous/01/deciduous01/

view-source:http://babylontesting.epizy.com/loader/app/main.js

line 180 is where LoadEntity ( ) is called

inside http://babylontesting.epizy.com/loader/plugins/BabylonLib/BabylonLib.js , is where the function LoadEntity ( ) is created on line 138

---------------

I just want this model to load correctly...

Thank you all so kindly! <3

Mythros

 

Share this post


Link to post
Share on other sites

Hi @Mythros,

The files seem to be unreachable (suspended domain?).

Make sure that the images in the dae file are pointing to the right path. The usual case is that the dae was exported with local paths instead of global ones. Note sure this is the case, but worth a try.

Share this post


Link to post
Share on other sites

Hi,

I just realized something, which kind'a made me feel a bit silly - we don't have any dae loader. 

The default .babylon loader is loaded when using the default version of the framework. Other than that, we have external loaders, such as the stl and the obj loader, but they must be loaded/included in your code in order to work correctly.

Try using the Babylon Exporter to export the dae to .babylon and see if it works

Share this post


Link to post
Share on other sites

Yes, @RaananW : https://mega.nz/#!cip1wILR!ltn4YJg8YMs1--RdVxg-Dj0uov1lvbQXzpQukkh6Nl4

main.php in the main directory line 60 SHOWS that I'm calling the obj loader.

inside plugins\BabylonLib\BabylonLib.js line 130, is the LoadEntity ( ) function

inside app\main.php lines 132 - 210 are where the LoadEntity ( ) function & the data for the meshes get called.

 

Share this post


Link to post
Share on other sites

My Dear Mythros, 

No, I am not kidding. And I am also not here to argue. I am here to be able to help users that have problems with Babylon. 

Don't get me wrong, but I am not going to install php on my computer, just because you "worked your ass" off compressing some files. Try actually reading the pinned document in this Q&A forum (here, a link, just in case - 

) so you can understand where I am coming from. My opinion regarding forum posts hasn't changed since.

I will be more than happy to help (as I did so far), but We both need to have the same state. Which means - providing me a zip file with some php files and a lot of unneeded information will do no good. 

Share this post


Link to post
Share on other sites

Hi @Mythros,

I just opened it - I see Babylon's skull being loaded, and a dae file being downloaded (and a 404, which I can't seem to understand where it's coming from). I don't see any .obj file being loaded.

I also noticed you are not loading the objloader javascript file, which would be the missing piece in loading a .obj file successfully. 

Share this post


Link to post
Share on other sites

@RaananW It's starting to load now, but WHY is it saying it can't load the MTL file even though it's correct in the model file : 

http://babylontesting.epizy.com

http://babylontesting.epizy.com/loader/models/deciduous/01/deciduous01/deciduous01.obj - Line 12

mtllib ./models/deciduous/01/deciduous01/deciduous01.obj.mtl

The above is the line calling the MTL

The objfileloader is now being loaded, check the "Network" tab in debug console

Share this post


Link to post
Share on other sites

Hi,

the mtl file is being loaded, the obj file is being loaded, your problem right now is that you are trying to load a mesh called "test1", which doesn't exist in your OBJ file. Try keeping the name of the object to load empty - the object will load correctly.

I did notice a small problem with the MTL loader, but you are not yet at the point of actually noticing it. 

Notice that there is also an exception being thrown in your beforeRender loop, maybe you should also make sure you fix that as well, so that the render will work correctly.

Share this post


Link to post
Share on other sites

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...

  • Recently Browsing   0 members

    No registered users viewing this page.