// ImportResult is returned by AssetManager.importExternalFile(). // It cannot be constructed directly. constmodel = this.pluginSystem.findInterface(Editor.Model.IModel) asEditor.Model.IModel; constassetManager = model.project.assetManager;
// Import an external file into the project constsourcePath = newEditor.Path('/tmp/my_model.fbx'); constresult: Editor.Model.ImportResult = assetManager.importExternalFile(sourcePath);
// Access the primary asset created by the import if (!Editor.isNull(result.primary)) { console.log('Primary asset name:', result.primary.name); }
// The path where the file was imported console.log('Import path:', result.path.toString());
// Iterate all imported file metadata entries for (constfileMetaofresult.files) { console.log('Imported file assets:', fileMeta.assets.length); }
The result of Editor.Model.AssetManager.importExternalFile and Editor.Model.AssetManager.importExternalFileAsync.
Example