BSS Posted August 6, 2015 Share Posted August 6, 2015 Hi guys,I have problem with babylon.sceneloader.importmesh. I tried importing mesh from .babylon file. Its importing correctly. but the problem is the callback in importmesh function is called twice.because of this i got meshes. I need to call the callback only once. Help me out, Note:This is happening only in windows store app. Not in any other application. San 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted August 6, 2015 Share Posted August 6, 2015 Hi, The callback should be called only once. Can you share your code please ? Quote Link to comment Share on other sites More sharing options...
San Posted August 7, 2015 Share Posted August 7, 2015 Hi guys,I have problem with babylon.sceneloader.importmesh. I tried importing mesh from .babylon file. Its importing correctly. but the problem is the callback in importmesh function is called twice.because of this i got meshes. I need to call the callback only once. Help me out, Note:This is happening only in windows store app. Not in any other application. Me too have the same issue, Anybody has any solution ?Code : BABYLON.SceneLoader.ImportMesh("", "scene/", "link1.babylon", scene, function (newMeshes){// , particleSystems, skeletons) { link1 = newMeshes[0]; link1.position = new BABYLON.Vector3(0, -2, 0); link1.scaling = new BABYLON.Vector3(1.5, 1.5, 1.5); }); Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 7, 2015 Share Posted August 7, 2015 Can you confirm that ImportMesh is called just once?? (by adding an alert for instance) Quote Link to comment Share on other sites More sharing options...
San Posted August 8, 2015 Share Posted August 8, 2015 Ya dude, I tried adding console.log before and inside the import mesh.Before Import mesh its calling once but inside (callback) it is calling twice. This issue is coming only in windows store app but the same is working fine in browser.Please help me. Quote Link to comment Share on other sites More sharing options...
San Posted August 10, 2015 Share Posted August 10, 2015 Finally did a bad fix This issue is coming because of the following method calling twice "importMeshFromData(data)" in bababylon.js. Don't know whats happening before this call. The fix here is as follows in babylon.2.1.debug.js Before:BABYLON.Tools.LoadFile(rootUrl + sceneFilename, function (data) { importMeshFromData(data); } }, progressCallBack, database);------------------------------------------------------------------------------------------------After : Added a new variable "scene_Filename"BABYLON.Tools.LoadFile(rootUrl + sceneFilename, function (data) { if (scene_Filename == "") { scene_Filename = rootUrl + sceneFilename; importMeshFromData(data); } }, progressCallBack, database); I know its a bad fix, can anybody help me in finding the root course ?*remember its happening only in windows store app Quote Link to comment Share on other sites More sharing options...
adam Posted August 10, 2015 Share Posted August 10, 2015 You should create a very simple windows store app that only demonstrates the issue and then post the project files for that here. Quote Link to comment Share on other sites More sharing options...
San Posted August 11, 2015 Share Posted August 11, 2015 Guys, Attaching the sample project.I have added a console.log inside import mesh in default.js. The below code is running twice and adding two meshes instead of one.Please find the default.js inside "JSUniversalAPP.shared" BABYLON.SceneLoader.ImportMesh("", "scene/", "base.babylon", scene, function (newMeshes, particleSystems, skeletons) { console.log("----------- base mesh loaded -------------"); }); JSUniversalApp.zip Quote Link to comment Share on other sites More sharing options...
Temechon Posted August 11, 2015 Share Posted August 11, 2015 The problem is in method Database.prototype.checkManifestFile.I run the demo app in debug, and here it what is done:-checkManifestFile - creating xhr request : https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.database.ts#L64 - try {xhr.send()} : https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.database.ts#L96 - Entering in the catch block : https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.database.ts#L99 - Later, entering in the 'load' event : https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.database.ts#L70 The last step should not happen. Maybe a bug only on Windows apps ? Quote Link to comment Share on other sites More sharing options...
San Posted August 12, 2015 Share Posted August 12, 2015 Ya, its a bug only in Windows app. Somebody who knows the babylon better, please take an initiative and fix this bug Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 12, 2015 Share Posted August 12, 2015 if this is a bug in windows app then the bug has to be fixed in windows adam 1 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.