Skip to main content

Editor.Assets.FileCompressionSettings

Class

Base type for file-backed compression strategies, assigned to AssetImportMetadata.compressionSettings to set the compression applied at import.

Index

Example

// FileCompressionSettings is the base for file-level (mesh/texture) compression.
// Concrete subclasses are DracoCompressionSettings and SizeCompressionSettings;
// assign one of them to fileMeta.compressionSettings.
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project.scene;

const meshSettings = Editor.Assets.DracoCompressionSettings.create(scene);
meshSettings.compressionLevel = 5;
const texSettings = Editor.Assets.SizeCompressionSettings.create(scene);
texSettings.level = Editor.Assets.TextureCompressionLevel.Medium;

console.log(
`FileCompression children: Draco(level=${meshSettings.compressionLevel}), Size(level=${texSettings.level})`,
);

Extends

Extended by

Properties

id

readonly id: Uuid

The unique id of the entity.

Inherited from

AssetCompressionSettings.id


meta

readonly meta: Meta

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

Inherited from

AssetCompressionSettings.meta


type

readonly type: string

The entity's type.

Inherited from

AssetCompressionSettings.type

Methods

getDirectlyReferencedEntities()

getDirectlyReferencedEntities(): Entity[]

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

Returns

Entity[]

Inherited from

AssetCompressionSettings.getDirectlyReferencedEntities


getMeta()

static getMeta(): Meta

Returns metadata about this type.

Returns

Meta

Overrides

AssetCompressionSettings.getMeta


getOwnedEntities()

getOwnedEntities(): Entity[]

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

Returns

Entity[]

Inherited from

AssetCompressionSettings.getOwnedEntities


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

AssetCompressionSettings.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

AssetCompressionSettings.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

AssetCompressionSettings.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

AssetCompressionSettings.isSame