ModelImportSettings class final
How a model file is imported: what an editor saves beside it as
<model>.import.json (see ModelImportSettings.sidecarOf) and what
cooking it (cookModel) applies.
Constructors
-
ModelImportSettings({double scale = 1.0, int maxTextureSize = 4096, bool mipmaps = true, TextureCompression textureCompression = TextureCompression.none, Map<
String, MaterialOverride> materials = const {}}) -
Settings; the defaults import the file as it is.
const
-
ModelImportSettings.fromJson(Map<
String, dynamic> json) -
Reads settings saved by toJson; anything missing or wrong keeps its
default.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDefault → bool
-
Whether these are the defaults: the file as it is.
no setter
-
materials
→ Map<
String, MaterialOverride> -
Changes to the file's materials, by name (or
#<index>for one without a name).final - maxTextureSize → int
-
The widest a texture may be, in pixels; larger ones are halved until
they fit. 0 for no limit.
final
- mipmaps → bool
-
Whether textures keep their smaller levels (mipmaps).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale → double
-
Every length multiplied by this: a file made in centimetres imports
at 0.01.
final
- textureCompression → TextureCompression
-
How textures are stored once cooked.
final
Methods
-
apply(
ModelData data) → ModelData -
datawith scale and the material changes applied. -
copyWith(
{double? scale, int? maxTextureSize, bool? mipmaps, TextureCompression? textureCompression, Map< String, MaterialOverride> ? materials}) → ModelImportSettings - These settings with some changed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - The settings as saved.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
cookedOf(
String modelPath) → String -
Where the cooked form of the model at
modelPathis kept; a game loads it in place of the file when it is there. -
materialKey(
ModelData data, int index) → String -
What materials calls the material at
indexofdata. -
scaled(
ModelData data, double s) → ModelData -
datawith every length multiplied bys: vertex positions, node and joint translations, animated translations, bounds and light ranges. -
sidecarOf(
String modelPath) → String -
Where the settings of the model at
modelPathare kept.
Constants
- cookedExtension → const String
- How a cooked model's file name ends.
- formatVersion → const int
- The format written; a file of a newer one is refused.