Editor.Assets.SizeCompressionSettings
ClassSets size-prioritized texture compression at a configurable quality level; assign to AssetImportMetadata.compressionSettings.
Index
Properties
Methods
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const scene = model.project.scene;
const settings = Editor.Assets.SizeCompressionSettings.create(scene);
settings.level = Editor.Assets.TextureCompressionLevel.High;
const tex = model.project.assetManager.assets.find((a) => a.isOfType('FileTexture'));
if (!Editor.isNull(tex) && !Editor.isNull(tex.fileMeta)) {
tex.fileMeta.compressionSettings = settings;
}
console.log(`SizeCompressionSettings level=${settings.level} (High = smallest size)`);
Extends
Extended by
Properties
id
readonlyid:Uuid
The unique id of the entity.
Inherited from
level
level:
TextureCompressionLevel
Compression level controlling the quality-versus-size tradeoff.
meta
readonlymeta:Meta
Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.
Inherited from
type
readonlytype:string
The entity's type.
Inherited from
Methods
create()
staticcreate(scene):SizeCompressionSettings
Creates a new SizeCompressionSettings entity within the given scene.
Parameters
| Parameter | Type |
|---|---|
scene | Scene |
Returns
SizeCompressionSettings
getDirectlyReferencedEntities()
getDirectlyReferencedEntities():
Entity[]
A list of entities which this entity has a reference to.
Returns
Entity[]
Inherited from
FileCompressionSettings.getDirectlyReferencedEntities
getMeta()
staticgetMeta():Meta
Returns metadata about this type.
Returns
Overrides
FileCompressionSettings.getMeta
getOwnedEntities()
getOwnedEntities():
Entity[]
A list of entities which has a reference to this entity.
Returns
Entity[]
Inherited from
FileCompressionSettings.getOwnedEntities
getTypeName()
staticgetTypeName():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
| Parameter | Type |
|---|---|
type | string |
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
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean