Skip to main content

Editor.Assets.DracoCompressionSettings

Class

Sets Google Draco geometry compression on a mesh asset; assign to AssetImportMetadata.compressionSettings.

Index

Example

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

const draco = Editor.Assets.DracoCompressionSettings.create(scene);
draco.compressionLevel = 7;
draco.positionBits = 14;
draco.normalBits = 10;
draco.texcoordBits = 12;
draco.colorBits = 8;

const mesh = model.project.assetManager.assets.find((a) => a.isOfType('FileMesh'));
if (!Editor.isNull(mesh) && !Editor.isNull(mesh.fileMeta)) {
mesh.fileMeta.compressionSettings = draco;
}
console.log(`Draco level=${draco.compressionLevel} positionBits=${draco.positionBits}`);

Extends

Properties

colorBits

colorBits: number

Quantization precision in bits for vertex color attributes.


compressionLevel

compressionLevel: number

Compression aggressiveness, where higher values trade encoding speed for smaller output.


id

readonly id: Uuid

The unique id of the entity.

Inherited from

FileCompressionSettings.id


meta

readonly meta: Meta

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

Inherited from

FileCompressionSettings.meta


normalBits

normalBits: number

Quantization precision in bits for vertex normal attributes.


positionBits

positionBits: number

Quantization precision in bits for vertex position attributes.


texcoordBits

texcoordBits: number

Quantization precision in bits for vertex texture coordinate attributes.


type

readonly type: string

The entity's type.

Inherited from

FileCompressionSettings.type

Methods

create()

static create(scene): DracoCompressionSettings

Creates a new DracoCompressionSettings entity within the given scene.

Parameters

ParameterType
sceneScene

Returns

DracoCompressionSettings


getDirectlyReferencedEntities()

getDirectlyReferencedEntities(): Entity[]

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

Returns

Entity[]

Inherited from

FileCompressionSettings.getDirectlyReferencedEntities


getMeta()

static getMeta(): Meta

Returns metadata about this type.

Returns

Meta

Overrides

FileCompressionSettings.getMeta


getOwnedEntities()

getOwnedEntities(): Entity[]

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

Returns

Entity[]

Inherited from

FileCompressionSettings.getOwnedEntities


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

FileCompressionSettings.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

FileCompressionSettings.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

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

FileCompressionSettings.isSame