A mesh asset to be used with a "Lens Scripting".Built-In.RenderMeshVisual

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

// Locate the mesh we want to import
const resourceLoc = import.meta.resolve('Resources/myMesh.mesh');
const absGraphPath = new Editor.Path(resourceLoc);

// Import the mesh
const meta = await assetManager.importExternalFileAsync(absolutePath, new Editor.Path(''), Editor.Model.ResultType.Packed);
// You can set meta.primary on a Mesh Component to use it.
interface RenderMesh {
    fileMeta: AssetImportMetadata;
    id: Uuid;
    name: string;
    type: string;
    getDirectlyReferencedEntities(): Entity[];
    getOwnedEntities(): Entity[];
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    remapReferences(referenceMapping: object): void;
}

Hierarchy (view full)

Properties

id: Uuid

The unique id of the entity.

name: string

The name of the asset.

type: string

The entity's type.

Methods

  • Beta

    Parameters

    • type: string

    Returns boolean

  • Beta

    Swap this entity for another one based on a JSON of the current entity id and the target entity id.

    Parameters

    • referenceMapping: object

    Returns void