kinometal Posted December 7, 2018 Share Posted December 7, 2018 Hello to all Im noob with Babylon and i have a problem when i try to test one object exported from Blender. I will use the viewer for simply 3D rotation in online shop for see the product. The official test from viewer (boombox.glb) works fine in my computer without problem. When I try to test my 3D objects exported from Blender in Babylon Editor or in SandBox i dont have a problem, I can see the object correctly, but when I try to execute in local or in website, no run, no work the viewer, freeze the screen in the square pre loader Im reading and try a lot of configs but i dont solve it. The code im using is the example of the test viewer, and I change the "boombox.glb" for my object exported from Blender in stl, glb or .babylon extension, but not work in any: <html> <head> <title>Babylon.js Viewer - Display a 3D model</title> <script src="https://preview.babylonjs.com/viewer/babylon.viewer.js"></script> </head> <body> <babylon model="https://models.babylonjs.com/boombox.glb" templates.main.params.fill-screen="true"></babylon> </body> </html> In the debug appear this error: babylon.viewer.js:19 BJS - [16:59:48]: No URL provided t._ErrorEnabled @ babylon.viewer.js:19 Thank you for your help, Kino Quote Link to comment Share on other sites More sharing options...
Guest Posted December 7, 2018 Share Posted December 7, 2018 What is the URL of your object? Where is it saved? Quote Link to comment Share on other sites More sharing options...
kinometal Posted December 7, 2018 Author Share Posted December 7, 2018 Hello, The file is this: http://www.carpas.net/3d/brezza.stl And the index: http://www.carpas.net/3d/ In sandbox and editor work fine, but in the viewer no run. Thank you. Quote Link to comment Share on other sites More sharing options...
droggam Posted December 7, 2018 Share Posted December 7, 2018 im not expert in standalone html js usage with babylonjs but.... it says clearly that u didnt specify the correct url in the js file u want html to load... so show us the viewer.js file instead on line 19 u find the error? i checked fast to just check i found this <script src="https://cdn.babylonjs.com/viewer/babylon.viewer.js"></script> Quote Link to comment Share on other sites More sharing options...
kinometal Posted December 7, 2018 Author Share Posted December 7, 2018 I need modify the babylon.viewer.js for this? the line 19 really is not a only line.. is a lot of lines if you open with editor Quote Link to comment Share on other sites More sharing options...
kinometal Posted December 7, 2018 Author Share Posted December 7, 2018 Is rare because the 3D file exported i upload in Sandbox and works, and in Babylonjs Editor, but not in the Viewer Quote Link to comment Share on other sites More sharing options...
droggam Posted December 7, 2018 Share Posted December 7, 2018 no everything works for me in localhost. Your problem is that u give us 2 files that doesnt even belong in the code u need to change the model url to ur file. and it should work ur files doesnt work i tested it try a glb file the example works though i tried babylon file with a skull it works perfecet ur file is either not accible or corrupt Quote Link to comment Share on other sites More sharing options...
kinometal Posted December 7, 2018 Author Share Posted December 7, 2018 Thank you for your time. About the url of the file i need change is in viewer.js? One example? And about my file, why in editor and in sandbox work fine? In this testers i can see correct the object. Thank you Quote Link to comment Share on other sites More sharing options...
droggam Posted December 8, 2018 Share Posted December 8, 2018 try have the file locally on the server and make model object point to the correct path... the line code 19 is on babulon server and not accesible i guess. I think ur case u need to have a valid file. Quote Link to comment Share on other sites More sharing options...
kinometal Posted December 8, 2018 Author Share Posted December 8, 2018 I updated the path and now appears this error: "Error loading the model". In the debugger appears now: Access to XMLHttpRequest at 'http://carpas.net/3d/brezza.stl' from origin 'http://www.carpas.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Quote Link to comment Share on other sites More sharing options...
Guest Posted December 8, 2018 Share Posted December 8, 2018 This is on your server side now Quote Link to comment Share on other sites More sharing options...
kinometal Posted December 8, 2018 Author Share Posted December 8, 2018 But when i put the original code of the example with boombox.gld 3d file works fine... I think if was the server the problem is in all files, not only in my file. Quote Link to comment Share on other sites More sharing options...
Guest Posted December 8, 2018 Share Posted December 8, 2018 Nope this is by extension you have to authorize .STL files Quote Link to comment Share on other sites More sharing options...
kinometal Posted December 8, 2018 Author Share Posted December 8, 2018 I authorise the server trhough mime types .stl and still have the error loading the model...im crazy Quote Link to comment Share on other sites More sharing options...
Guest Posted December 8, 2018 Share Posted December 8, 2018 Cors are managed by server only so it must be in your server Quote Link to comment Share on other sites More sharing options...
kinometal Posted December 9, 2018 Author Share Posted December 9, 2018 You have another .glb and stl file for test? Or url for can download? Is for proof if is not my file, thank you. Quote Link to comment Share on other sites More sharing options...
Guest Posted December 9, 2018 Share Posted December 9, 2018 Try to store your assets following this guide: https://doc.babylonjs.com/resources/external_pg_assets Quote Link to comment Share on other sites More sharing options...
droggam Posted December 9, 2018 Share Posted December 9, 2018 yea follow deltakosh i dont think u know very much if u have cors problem its not really related to babylonjs..... i think u need easiest way is to upload file somewhere else. i doubt u can easy fix problem on ur own cor problem is fixed by sending headers in ur request or by allowing loxalhost42000 in server file Quote Link to comment Share on other sites More sharing options...
kinometal Posted December 11, 2018 Author Share Posted December 11, 2018 Deltakosh! thaaaank youuuuuuuuuu was the SSL! now under SSL in other domain in my server works fine, thank you very much :) I have problem with textures in the export, the model 3D is perfect but without textures, is a problem of the exporter? Quote Link to comment Share on other sites More sharing options...
Guest Posted December 11, 2018 Share Posted December 11, 2018 Can you post that question to the new forum: forum.babylonjs.com ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.