Clear importer data after import.

This commit is contained in:
Viktor Kovacs 2021-04-20 11:48:08 +02:00
parent 2e85bf20b5
commit ddec4bd898
3 changed files with 9 additions and 0 deletions

View File

@ -344,6 +344,9 @@ OV.Importer = class
onError : function () {
let message = importer.GetMessage ();
callbacks.onError (new OV.ImportError (OV.ImportErrorCode.ImportFailed, message));
},
onComplete : function () {
importer.Clear ();
}
});
}

View File

@ -36,17 +36,20 @@ OV.ImporterBase = class
{
if (this.error) {
callbacks.onError ();
callbacks.onComplete ();
return;
}
if (OV.IsModelEmpty (this.model)) {
this.error = true;
callbacks.onError ();
callbacks.onComplete ();
return;
}
OV.FinalizeModel (this.model, this.callbacks.getDefaultMaterial);
callbacks.onSuccess ();
callbacks.onComplete ();
}
CanImportExtension (extension)

View File

@ -84,6 +84,9 @@ module.exports =
},
onError : function () {
onReady (model);
},
onComplete : function () {
}
});
}