Skip to main content

Editor.Assets.PerformanceCompressionSettings

Class

Sets runtime-performance-tuned texture compression with optional mipmaps; assign to AssetImportMetadata.compressionSettings.

Index

Example

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

const perf = Editor.Assets.PerformanceCompressionSettings.create(scene);
perf.mipmap = true;
perf.level = Editor.Assets.TextureCompressionLevel.Medium;

const tex = model.project.assetManager.assets.find((a) => a.isOfType('FileTexture'));
if (!Editor.isNull(tex) && !Editor.isNull(tex.fileMeta)) {
tex.fileMeta.compressionSettings = perf;
}
console.log(`PerformanceCompression mipmap=${perf.mipmap} level=${perf.level}`);

Extends

Properties

id

readonly id: Uuid

The unique id of the entity.

Inherited from

SizeCompressionSettings.id


level

level: TextureCompressionLevel

Compression level controlling the quality-versus-size tradeoff.

Inherited from

SizeCompressionSettings.level


meta

readonly meta: Meta

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

Inherited from

SizeCompressionSettings.meta


mipmap

mipmap: boolean

Whether mipmaps are generated and stored alongside the compressed texture.


type

readonly type: string

The entity's type.

Inherited from

SizeCompressionSettings.type

Methods

create()

static create(scene): PerformanceCompressionSettings

Creates a new PerformanceCompressionSettings entity within the given scene.

Parameters

ParameterType
sceneScene

Returns

PerformanceCompressionSettings

Overrides

SizeCompressionSettings.create


getDirectlyReferencedEntities()

getDirectlyReferencedEntities(): Entity[]

A list of entities which this entity has a reference to.

Returns

Entity[]

Inherited from

SizeCompressionSettings.getDirectlyReferencedEntities


getMeta()

static getMeta(): Meta

Returns metadata about this type.

Returns

Meta

Overrides

SizeCompressionSettings.getMeta


getOwnedEntities()

getOwnedEntities(): Entity[]

A list of entities which has a reference to this entity.

Returns

Entity[]

Inherited from

SizeCompressionSettings.getOwnedEntities


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

SizeCompressionSettings.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

SizeCompressionSettings.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

SizeCompressionSettings.isOfType


isSame()

isSame(other): boolean

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

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

SizeCompressionSettings.isSame