Add function to reload the same model again.
This commit is contained in:
parent
b60305dd19
commit
473da09052
15
source/external/three.model.loader.js
vendored
15
source/external/three.model.loader.js
vendored
@ -44,11 +44,22 @@ OV.ThreeModelLoader = class
|
||||
obj.OnFilesLoaded ();
|
||||
});
|
||||
}
|
||||
|
||||
ReloadFiles ()
|
||||
{
|
||||
if (this.inProgress) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.inProgress = true;
|
||||
this.callbacks.onLoadStart ();
|
||||
this.OnFilesLoaded ();
|
||||
}
|
||||
|
||||
OnFilesLoaded ()
|
||||
{
|
||||
let obj = this;
|
||||
this.callbacks.onFilesLoaded ();
|
||||
this.callbacks.onImportStart ();
|
||||
OV.RunTaskAsync (function () {
|
||||
obj.importer.Import ({
|
||||
success : function (importResult) {
|
||||
@ -65,7 +76,7 @@ OV.ThreeModelLoader = class
|
||||
OnModelImported (importResult)
|
||||
{
|
||||
let obj = this;
|
||||
this.callbacks.onModelImported ();
|
||||
this.callbacks.onVisualizationStart ();
|
||||
OV.ConvertModelToThreeMeshes (importResult.model, {
|
||||
onTextureLoaded : function () {
|
||||
obj.callbacks.onTextureLoaded ();
|
||||
|
||||
@ -23,10 +23,10 @@ OV.Init3DViewerElements = function ()
|
||||
element.appendChild (progressDiv);
|
||||
progressDiv.innerHTML = 'Loading model...';
|
||||
},
|
||||
onFilesLoaded : function () {
|
||||
onImportStart : function () {
|
||||
progressDiv.innerHTML = 'Importing model...';
|
||||
},
|
||||
onModelImported : function () {
|
||||
onVisualizationStart : function () {
|
||||
progressDiv.innerHTML = 'Visualizing model...';
|
||||
},
|
||||
onModelFinished : function (importResult, threeMeshes) {
|
||||
|
||||
@ -40,10 +40,10 @@ OV.InitModelLoader = function (modelLoader, callbacks)
|
||||
progressDialog = new OV.ProgressDialog ();
|
||||
progressDialog.Show ('Loading Model');
|
||||
},
|
||||
onFilesLoaded : function () {
|
||||
onImportStart : function () {
|
||||
progressDialog.SetText ('Importing Model');
|
||||
},
|
||||
onModelImported : function () {
|
||||
onVisualizationStart : function () {
|
||||
progressDialog.SetText ('Visualizing Model');
|
||||
},
|
||||
onModelFinished : function (importResult, threeMeshes) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user