MCPcopy Create free account
hub / github.com/assimp/assimp / CopyASETexture

Function CopyASETexture

code/AssetLib/ASE/ASELoader.cpp:777–789  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------ Copy a texture from the ASE structs to the output material

Source from the content-addressed store, hash-verified

775// ------------------------------------------------------------------------------------------------
776// Copy a texture from the ASE structs to the output material
777void CopyASETexture(aiMaterial &mat, ASE::Texture &texture, aiTextureType type) {
778 // Setup the texture name
779 aiString tex;
780 tex.Set(texture.mMapName);
781 mat.AddProperty(&tex, AI_MATKEY_TEXTURE(type, 0));
782
783 // Setup the texture blend factor
784 if (is_not_qnan(texture.mTextureBlend))
785 mat.AddProperty<ai_real>(&texture.mTextureBlend, 1, AI_MATKEY_TEXBLEND(type, 0));
786
787 // Setup texture UV transformations
788 mat.AddProperty<ai_real>(&texture.mOffsetU, 5, AI_MATKEY_UVTRANSFORM(type, 0));
789}
790
791// ------------------------------------------------------------------------------------------------
792// Convert from ASE material to output material

Callers 1

ConvertMaterialMethod · 0.85

Calls 3

is_not_qnanFunction · 0.85
SetMethod · 0.45
AddPropertyMethod · 0.45

Tested by

no test coverage detected