dpanzo Posted April 29, 2014 Share Posted April 29, 2014 Greetings to the community, Has anyone succeded creating their own file importer? From the tutorial, I've tried setting up and registering a dummy importer for a random file extension (it doesn't matter at this stage) but it doesn't work at all. Obviously I'm doing something wrong. I'll be pleased if someone could show me the right way. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 29, 2014 Share Posted April 29, 2014 Hellocould tell me more about the bug? or perhaps share your app somewhere? Quote Link to comment Share on other sites More sharing options...
dpanzo Posted April 30, 2014 Author Share Posted April 30, 2014 There's not much to share really. Here's the code :var canvas = document.getElementById("renderCanvas");var engine = new BABYLON.Engine(canvas, true);var scene = new BABYLON.Scene(engine); BABYLON.SceneLoader.RegisterPlugin({ extensions: ".dummy", importMesh: function (meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons) { return true; }, load: function (scene, data, rootUrl) { return true; }}); BABYLON.SceneLoader.Load(scene, "file.dummy", "./");It yields an "Uncaught TypeError: undefined is not a function" on line 32 (first line of the RegisterPlugin call) Thanks a lot Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 30, 2014 Share Posted April 30, 2014 You must complete the following: importMesh: function (meshesNames, scene, data, rootUrl, meshes, particleSystems, skeletons) { ?????},load: function (scene, data, rootUrl) { ????} Quote Link to comment Share on other sites More sharing options...
Maxence Posted April 30, 2014 Share Posted April 30, 2014 Hi, Dad72, thank you for trying to help but your answer does not make sense, the "return true" cannot cause this error, so even if you put some other code into the two function the error still be there. As dpanzo said, his error was "Uncaught TypeError: undefined is not a function" on line 32. For me it means that your are trying to call the .RegisterPlugin function which is not defined. Could you please check in your "babylon.sceneLoader.js" file if you have the registerPlugin method, if not it means you do not have the latest version on babylonJS. Else sorry i have no other idea. Hope it was helful. Thanks for reading. Quote Link to comment Share on other sites More sharing options...
dpanzo Posted April 30, 2014 Author Share Posted April 30, 2014 ok thanks I'll do that and keep you posted. edit : Ok, I see my mistake. I included babylon.js and thought I had everything I needed. Actually, just as you suggested., the "RegisterPlugin" function is nowhere to be found in my babylon.1.11.js, which I thought was a complete release. Does that mean I must include one by one every library I intend to use? In my case, adding "babylon.sceneLoader.js" did not work well unfortunately, but for another reason perhaps. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 30, 2014 Share Posted April 30, 2014 babylon.1.11.js should be complete and from my point of view it is When I search for registerPlugin here:https://raw.githubusercontent.com/BabylonJS/Babylon.js/master/babylon.1.11.js I can find it Quote Link to comment Share on other sites More sharing options...
dpanzo Posted May 12, 2014 Author Share Posted May 12, 2014 Indeed, the babylon.js file contains everything needed. My mistake was elsewhere : There was a problem with node.js (that i wasn't able to solve). The issue is therefore not related to the babylon.js library 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.