Hersir Posted April 13, 2017 Share Posted April 13, 2017 Hi, after loading incremental scene file on load finish I cloned one of mesh BABYLON.SceneLoader.Load("", scenePath, this.engine, (scene) => { scene.meshes.forEach((mesh) => { if(mesh.name === "m1") { mesh.clone("m2", mesh.parent, false, false); mesh.clone("m3", mesh.parent, false, false); } }); }); Probably it was not designed to work like that but every thing works as expected but I get console errors _this._delayLoadingFunction is not a function inside: Mesh.prototype._queueLoad = function (mesh, scene) { var _this = this; scene._addPendingData(mesh); var getBinaryData = (this.delayLoadingFile.indexOf(".babylonbinarymeshdata") !== -1); BABYLON.Tools.LoadFile(this.delayLoadingFile, function (data) { if (data instanceof ArrayBuffer) { _this._delayLoadingFunction(data, _this); } else { _this._delayLoadingFunction(JSON.parse(data), _this); } _this.instances.forEach(function (instance) { instance._syncSubMeshes(); }); _this.delayLoadState = BABYLON.Engine.DELAYLOADSTATE_LOADED; scene._removePendingData(_this); }, function () { }, scene.database, getBinaryData); return this; }; Quote Link to comment Share on other sites More sharing options...
jschwuch Posted April 13, 2017 Share Posted April 13, 2017 Are you sure this only occurs when you are cloning the mesh? I'd have done the cloning exactly that way and don't see why it would cause this error Quote Link to comment Share on other sites More sharing options...
Hersir Posted April 13, 2017 Author Share Posted April 13, 2017 @jschwuch Yes it related to cloning. I think that as mesh is loaded separately by time it is cloned file still loads and it tries to load it one more time for each clone and than have some collision. Quote Link to comment Share on other sites More sharing options...
jschwuch Posted April 13, 2017 Share Posted April 13, 2017 @Hersir you could maybe try copying the ._delayLoadingFunction over to the new mesh, but I don't know if that would create any new problems... I'll sniff around the source a bit later today... really wouldn't expect this to happen. Quote Link to comment Share on other sites More sharing options...
Hersir Posted April 13, 2017 Author Share Posted April 13, 2017 @jschwuch No hurry I added clone just to debug some position changes, I don't need it for my final app, just found error and wanted to share it 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.