// Import built in helpers
import * as Utils from 'LensStudio:Utils@1.0.js';

// In the plugin create function
const model = pluginSystem.findInterface(Editor.Model.IModel);
const assetManager = model.project.assetManager;
const destination = destination;

const material = const assetManager.createNativeAsset('Material', 'Material Name', destination);

const absGraphPath = new Editor.Path(params.graph_path);
const pass = await Utils.findOrCreateAsync(assetManager, absGraphPath, destination);
const passInfo = material.addPass(pass);
interface PassInfo {
    blendMode: Editor.Assets.BlendMode;
    colorMask: bvec4;
    cullMode: Editor.Assets.CullMode;
    defines: string[];
    depthFunction: DepthFunction;
    depthTest: boolean;
    depthWrite: boolean;
    frustumCulling: Editor.Assets.FrustumCullMode;
    id: Uuid;
    instanceCount: number;
    polygonOffset: vec2;
    twoSided: boolean;
    type: string;
    getDirectlyReferencedEntities(): Entity[];
    getOwnedEntities(): Entity[];
    getPropertyNames(): string[];
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    remapReferences(referenceMapping: object): void;
}

Hierarchy (view full)

Properties

colorMask: bvec4
defines: string[]
depthFunction: DepthFunction
depthTest: boolean
depthWrite: boolean
frustumCulling: Editor.Assets.FrustumCullMode
id: Uuid

The unique id of the entity.

instanceCount: number
polygonOffset: vec2
twoSided: boolean
type: string

The entity's type.

Methods

  • Beta

    Returns string[]

  • 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