InterfaceIEntityPickerBeta

Popup window that allows the user to choose specific objects in the Scene hierarchy, or assets in the Asset Browser.

// Get access to the project's model component 
const model = this.pluginSystem.findInterface(Editor.IModel);
const project = model.project;

// Get access to the picker component
const refPicker = this.pluginSystem.findInterface(Editor.IEntityPicker);

// Open a picker
const type = "SceneObject"

// or Asset, etc.
refPicker.requestPicker(type, (pickedReplacementUid) => {
Editor.print(pickedReplacementUid);
})

// List assets in project
const assetManager = project.assetManager;
assetManager.assets.forEach( asset => {
Editor.print(asset.id);
})

// List objects in project's scene
const scene = project.scene;
scene.sceneObjects.forEach( obj => {
Editor.print(obj.id);
})
interface IEntityPicker {
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    requestPicker(entityType: string, callback: ((arg1: Entity) => void)): void;
}

Hierarchy (view full)

Methods

  • Beta

    Parameters

    • entityType: string
    • callback: ((arg1: Entity) => void)
        • (arg1): void
        • Parameters

          Returns void

    Returns void