Preparing search index...

    An asset for textures.

        const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;

    // Find FileTexture assets and read their dimensions
    const fileTextures = model.project.assetManager.assets.filter(
    a => a.isOfType('FileTexture')
    ) as Editor.Assets.FileTexture[];

    for (const ft of fileTextures) {
    if (Editor.isNull(ft)) continue;
    const info = ft.fileInfo;
    console.log(`${ft.name}: ${info.width} x ${info.height}`);
    }

    // Assign the first FileTexture to the camera's input texture
    if (fileTextures.length > 0) {
    const camera = model.project.scene.mainCamera;
    camera.inputTexture = fileTextures[0];
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cacheFile: Path

    Path to the cached asset file.

    fileInfo: FileTextureInfo

    Holds metadata about the texture file.

    Import metadata for the asset.

    id: Uuid

    The unique id of the entity.

    meta: Meta

    Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.

    name: string

    The name of the asset.

    type: string

    The entity's type.

    Methods

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object refers to the same instance as the given object.

      Parameters

      Returns boolean