Jump to content

Incremental loading and mesh clone


Hersir
 Share

Recommended Posts

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;
};

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...