Numa Posted June 24, 2016 Share Posted June 24, 2016 Hi there, If you try to use one of the loaders (for .obj files for instance) and you are loading your scene from a data string, not a file, babylon will use the default load function and fail. SceneLoader._getPluginForFilename = function (sceneFilename) { var dotPosition = sceneFilename.lastIndexOf("."); var queryStringPosition = sceneFilename.indexOf("?"); if (queryStringPosition === -1) { queryStringPosition = sceneFilename.length; } var extension = sceneFilename.substring(dotPosition, queryStringPosition).toLowerCase(); for (var index = 0; index < this._registeredPlugins.length; index++) { var plugin = this._registeredPlugins[index]; if (plugin.extensions.indexOf(extension) !== -1) { return plugin; } } return this._registeredPlugins[0]; }; It can't find the extension of course, as the fileName variable contains the scene data. In 2.3 this use to work accidentally because the function would return _registeredPlugins[this._registeredPlugins.length - 1], which if you had an extra loader registered wold return it. How do you guys want to go about fixing that one? optional Extension parameter? LoadFromData overload? Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 24, 2016 Share Posted June 24, 2016 Like the idea of optional extension parameter 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.