TextureImporter

Struct TextureImporter 

Source
pub struct TextureImporter {
Show 81 fields pub m_BorderMipMap: i32, pub m_ConvertToNormalMap: i32, pub m_EnableMipMap: i32, pub m_ExternalNormalMap: i32, pub m_FadeOut: i32, pub m_GenerateCubemap: i32, pub m_GrayScaleToAlpha: i32, pub m_HeightScale: f32, pub m_IsReadable: i32, pub m_Lightmap: i32, pub m_MaxTextureSize: i32, pub m_MipMapFadeDistanceEnd: i32, pub m_MipMapFadeDistanceStart: i32, pub m_MipMapMode: i32, pub m_NPOTScale: i32, pub m_Name: String, pub m_NormalMapFilter: i32, pub m_TextureFormat: i32, pub m_TextureSettings: GLTextureSettings, pub m_TextureType: i32, pub correctGamma: Option<i32>, pub m_Alignment: Option<i32>, pub m_AllowsAlphaSplitting: Option<i32>, pub m_AlphaIsTransparency: Option<i32>, pub m_AlphaTestReferenceValue: Option<f32>, pub m_AlphaUsage: Option<i32>, pub m_ApplyGammaDecoding: Option<i32>, pub m_AssetBundleName: Option<String>, pub m_AssetBundleVariant: Option<String>, pub m_BuildTargetSettings: Option<Vec<BuildTargetSettings>>, pub m_CompressionQuality: Option<i32>, pub m_CompressionQualitySet: Option<i32>, pub m_CookieLightType: Option<i32>, pub m_CorrectGamma: Option<i32>, pub m_CubemapConvolution: Option<i32>, pub m_CubemapConvolutionExponent: Option<f32>, pub m_CubemapConvolutionSteps: Option<i32>, pub m_ExternalObjects: Option<Vec<(SourceAssetIdentifier, PPtr)>>, pub m_FileIDToRecycleName: Option<Vec<(i64, String)>>, pub m_FlipGreenChannel: Option<i32>, pub m_FlipbookColumns: Option<i32>, pub m_FlipbookRows: Option<i32>, pub m_IgnoreMasterTextureLimit: Option<i32>, pub m_IgnoreMipmapLimit: Option<i32>, pub m_IgnorePngGamma: Option<Enum_i32__bool>, pub m_InternalIDToNameTable: Option<Vec<((i32, i64), String)>>, pub m_LinearTexture: Option<i32>, pub m_MaxTextureSizeSet: Option<i32>, pub m_MipMapsPreserveCoverage: Option<i32>, pub m_MipmapLimitGroupName: Option<String>, pub m_NewHashIdentity: Option<MdFour>, pub m_OldHashIdentity: Option<MdFour>, pub m_Output: Option<TextureImportOutput>, pub m_PSDRemoveMatte: Option<bool>, pub m_PSDShowRemoveMatteOption: Option<bool>, pub m_PlatformSettings: Option<Vec<Enum_PlatformSettings__TextureImporterPlatformSettings>>, pub m_PushPullDilation: Option<i32>, pub m_RGBM: Option<i32>, pub m_RecommendedTextureFormat: Option<i32>, pub m_SeamlessCubemap: Option<i32>, pub m_SingleChannelComponent: Option<i32>, pub m_SourceTextureInformation: Option<SourceTextureInformation>, pub m_SpriteBorder: Option<Vector4f>, pub m_SpriteExtrude: Option<u32>, pub m_SpriteGenerateFallbackPhysicsShape: Option<i32>, pub m_SpriteMeshType: Option<i32>, pub m_SpriteMode: Option<i32>, pub m_SpritePackingTag: Option<String>, pub m_SpritePivot: Option<Vector2f>, pub m_SpritePixelsToUnits: Option<f32>, pub m_SpriteSheet: Option<SpriteSheetMetaData>, pub m_SpriteTessellationDetail: Option<f32>, pub m_StreamingMipmaps: Option<i32>, pub m_StreamingMipmapsPriority: Option<i32>, pub m_Swizzle: Option<u32>, pub m_TextureFormatSet: Option<i32>, pub m_TextureShape: Option<i32>, pub m_UsedFileIDs: Option<Vec<i64>>, pub m_UserData: Option<String>, pub m_VTOnly: Option<i32>, pub m_sRGBTexture: Option<i32>,
}
Expand description

TextureImporter is a class of the Unity engine since version 3.4.0. Exert from Unity’s scripting documentation: Texture importer lets you modify Texture2D import settings from editor scripts. Settings of this class cover most of the settings exposed in Texture Import Settings. Some settings require you to use TextureImporterSettings. Refer to TextureImporter.SetTextureSettings).

Fields§

§m_BorderMipMap: i32

Keeps texture borders the same when generating mipmaps.

§m_ConvertToNormalMap: i32

Convert heightmap to normal map

§m_EnableMipMap: i32§m_ExternalNormalMap: i32§m_FadeOut: i32

Fade out mip levels to gray color.

§m_GenerateCubemap: i32

Cubemap generation mode.

§m_GrayScaleToAlpha: i32§m_HeightScale: f32§m_IsReadable: i32

Whether Unity stores an additional copy of the imported texture’s pixel data in CPU-addressable memory.

§m_Lightmap: i32§m_MaxTextureSize: i32

Maximum texture size.

§m_MipMapFadeDistanceEnd: i32

Mip level where texture is faded out completely.

§m_MipMapFadeDistanceStart: i32

Mip level where texture begins to fade out.

§m_MipMapMode: i32§m_NPOTScale: i32

Scaling mode for non power of two textures.

§m_Name: String

The name of the object.

§m_NormalMapFilter: i32

Normal map filtering mode.

§m_TextureFormat: i32§m_TextureSettings: GLTextureSettings§m_TextureType: i32

Which type of texture are we dealing with here.

§correctGamma: Option<i32>

i32: (3.5.0 - 5.4.6f3)

§m_Alignment: Option<i32>

i32: (4.3.0 - 2022.3.2f1)

§m_AllowsAlphaSplitting: Option<i32>

i32: (5.2.0f2 - 5.4.3f1)

§m_AlphaIsTransparency: Option<i32>

If the alpha channel of your texture represents transparency, enable this property to dilate the color channels of visible texels into fully transparent areas. This effectively adds padding around transparent areas that prevents filtering artifacts from forming on their edges. Unity does not support this property for HDR textures.This property makes the color data of invisible texels undefined. Disable this property to preserve invisible texels’ original color data. i32: (4.2.0 - 2022.3.2f1)

§m_AlphaTestReferenceValue: Option<f32>

Returns or assigns the alpha test reference value. f32: (2017.1.0b1 - 2022.3.2f1)

§m_AlphaUsage: Option<i32>

i32: (5.5.0f3 - 2022.3.2f1)

§m_ApplyGammaDecoding: Option<i32>

i32: (2019.3.6f1 - 2022.3.2f1)

§m_AssetBundleName: Option<String>

Get or set the AssetBundle name. String: (5.0.0f4 - 2022.3.2f1)

§m_AssetBundleVariant: Option<String>

Get or set the AssetBundle variant. String: (5.0.0f4 - 2022.3.2f1)

§m_BuildTargetSettings: Option<Vec<BuildTargetSettings>>

Vec: (3.4.0 - 5.4.6f3)

§m_CompressionQuality: Option<i32>

The quality of Crunch texture compression. The range is 0 through 100. A higher quality means larger textures and longer compression times. i32: (3.5.0 - 2022.3.2f1)

§m_CompressionQualitySet: Option<i32>

i32: (5.5.0f3 - 2022.3.2f1)

§m_CookieLightType: Option<i32>

i32: (2020.3.38f1 - 2022.3.2f1)

§m_CorrectGamma: Option<i32>

i32: (3.4.0 - 3.4.2)

§m_CubemapConvolution: Option<i32>

i32: (5.0.0f4 - 2022.3.2f1)

§m_CubemapConvolutionExponent: Option<f32>

f32: (5.0.0f4 - 5.4.6f3)

§m_CubemapConvolutionSteps: Option<i32>

i32: (5.0.0f4 - 5.4.6f3)

§m_ExternalObjects: Option<Vec<(SourceAssetIdentifier, PPtr)>>

Vec<(SourceAssetIdentifier, PPtr<[Object]>)>: (2017.2.0b2 - 2022.3.2f1)

§m_FileIDToRecycleName: Option<Vec<(i64, String)>>

Vec<(i32, String)>: (3.4.0 - 4.7.2); Vec<(i64, String)>: (5.0.0f4 - 2018.4.36f1)

§m_FlipGreenChannel: Option<i32>

Indicates whether to invert the green channel values of a normal map. i32: (2022.1.0b1 - 2022.3.2f1)

§m_FlipbookColumns: Option<i32>

i32: (2020.2.0b1 - 2022.3.2f1)

§m_FlipbookRows: Option<i32>

i32: (2020.2.0b1 - 2022.3.2f1)

§m_IgnoreMasterTextureLimit: Option<i32>

i32: (2021.2.0b1 - 2022.2.0a18)

§m_IgnoreMipmapLimit: Option<i32>

Enable this flag for textures that should ignore mipmap limit settings. i32: (2022.2.0f1 - 2022.3.2f1)

§m_IgnorePngGamma: Option<Enum_i32__bool>

Ignore the Gamma attribute in PNG files. This property does not effect other file formats. i32: (2020.1.0b1 - 2022.3.2f1); bool: (2020.1.0a3 - 2020.1.0a9)

§m_InternalIDToNameTable: Option<Vec<((i32, i64), String)>>

Vec<((i32, i64), String)>: (2019.1.0b1 - 2022.3.2f1)

§m_LinearTexture: Option<i32>

i32: (3.5.0 - 2022.3.2f1)

§m_MaxTextureSizeSet: Option<i32>

i32: (5.5.0f3 - 2022.3.2f1)

§m_MipMapsPreserveCoverage: Option<i32>

Enables or disables coverage-preserving alpha mipmapping. i32: (2017.1.0b1 - 2022.3.2f1)

§m_MipmapLimitGroupName: Option<String>

Name of the texture mipmap limit group to which this texture belongs. String: (2022.2.0f1 - 2022.3.2f1)

§m_NewHashIdentity: Option<MdFour>

MdFour: (3.4.0 - 3.4.2)

§m_OldHashIdentity: Option<MdFour>

MdFour: (3.4.0 - 3.4.2)

§m_Output: Option<TextureImportOutput>

TextureImportOutput: (4.0.0 - 2022.3.2f1)

§m_PSDRemoveMatte: Option<bool>

bool: (2018.2.1f1 - 2022.3.2f1)

§m_PSDShowRemoveMatteOption: Option<bool>

bool: (2018.2.1f1 - 2022.1.0a12)

§m_PlatformSettings: Option<Vec<Enum_PlatformSettings__TextureImporterPlatformSettings>>

Vec: (5.5.0f3 - 2017.2.5f1); Vec: (2017.3.0b1 - 2022.3.2f1)

§m_PushPullDilation: Option<i32>

i32: (2018.2.0b2 - 2018.2.0b2)

§m_RGBM: Option<i32>

i32: (5.0.0f4 - 5.4.6f3)

§m_RecommendedTextureFormat: Option<i32>

i32: (3.4.0 - 3.5.7)

§m_SeamlessCubemap: Option<i32>

i32: (4.0.0 - 2022.3.2f1)

§m_SingleChannelComponent: Option<i32>

i32: (2018.1.0b2 - 2022.3.2f1)

§m_SourceTextureInformation: Option<SourceTextureInformation>

SourceTextureInformation: (3.4.0 - 3.5.7)

§m_SpriteBorder: Option<Vector4f>

Border sizes of the generated sprites. Vector4f: (4.5.0 - 2022.3.2f1)

§m_SpriteExtrude: Option<u32>

u32: (4.3.0 - 2022.3.2f1)

§m_SpriteGenerateFallbackPhysicsShape: Option<i32>

i32: (2017.4.1f1 - 2022.3.2f1)

§m_SpriteMeshType: Option<i32>

i32: (4.3.0 - 2022.3.2f1)

§m_SpriteMode: Option<i32>

i32: (4.3.0 - 2022.3.2f1)

§m_SpritePackingTag: Option<String>

String: (4.3.0 - 2022.1.24f1)

§m_SpritePivot: Option<Vector2f>

The point in the Sprite object’s coordinate space where the graphic is located. Vector2f: (4.3.0 - 2022.3.2f1)

§m_SpritePixelsToUnits: Option<f32>

f32: (4.3.0 - 2022.3.2f1)

§m_SpriteSheet: Option<SpriteSheetMetaData>

SpriteSheetMetaData: (4.3.0 - 2022.3.2f1)

§m_SpriteTessellationDetail: Option<f32>

f32: (5.4.0f3 - 2022.3.2f1)

§m_StreamingMipmaps: Option<i32>

Enable mipmap streaming for this texture. i32: (2018.2.0b1 - 2022.3.2f1)

§m_StreamingMipmapsPriority: Option<i32>

Relative priority for this texture when reducing memory size in order to hit the memory budget. i32: (2018.2.0b1 - 2022.3.2f1)

§m_Swizzle: Option<u32>

u32: (2022.1.0b1 - 2022.3.2f1)

§m_TextureFormatSet: Option<i32>

i32: (5.5.0f3 - 2022.3.2f1)

§m_TextureShape: Option<i32>

The shape of the imported texture. i32: (5.5.0f3 - 2022.3.2f1)

§m_UsedFileIDs: Option<Vec<i64>>

Vec: (2019.1.0b1 - 2022.3.2f1)

§m_UserData: Option<String>

Get or set any user data. String: (4.0.0 - 2022.3.2f1)

§m_VTOnly: Option<i32>

When enabled, this texture can solely be used in combination with a Texture Stack for Virtual Texturing. When enabled the texture is not guaranteed to be available as a Texture2D in the Player (e.g., not accessible from a script). When disabled, the Player includes the texture both as a Texture2D (e.g., accessible from script) and as a streamable texture in a Texture Stack. i32: (2020.1.0b1 - 2022.3.2f1)

§m_sRGBTexture: Option<i32>

Whether this texture stores data in sRGB (also called gamma) color space. i32: (5.5.0f3 - 2022.3.2f1)

Trait Implementations§

Source§

impl Debug for TextureImporter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TextureImporter

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for TextureImporter

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,