Blender: map texture influence to aiTextureType
Previously assimp mapped all blender image textures as aiTextureType_DIFFUSE. This change interprets the "mapto" property which corresponds to the Blender "Influence" in the properties editor. * Blender's Normal influence with "Normal Map" unchecked maps to aiTextureType_HEIGHT. * Blender's Normal influence with "Normal Map" checked maps to aiTextureType_NORMAL. * Influence scale is placed into AI_MATKEY_BUMPSCALING.
This commit is contained in:
@@ -100,6 +100,7 @@ template <> void Structure :: Convert<MTex> (
|
||||
) const
|
||||
{
|
||||
|
||||
ReadField<ErrorPolicy_Igno>((short&)dest.mapto,"mapto",db);
|
||||
ReadField<ErrorPolicy_Igno>((int&)dest.blendtype,"blendtype",db);
|
||||
ReadFieldPtr<ErrorPolicy_Igno>(dest.object,"*object",db);
|
||||
ReadFieldPtr<ErrorPolicy_Igno>(dest.tex,"*tex",db);
|
||||
@@ -126,6 +127,7 @@ template <> void Structure :: Convert<MTex> (
|
||||
ReadField<ErrorPolicy_Igno>(dest.specfac,"specfac",db);
|
||||
ReadField<ErrorPolicy_Igno>(dest.emitfac,"emitfac",db);
|
||||
ReadField<ErrorPolicy_Igno>(dest.hardfac,"hardfac",db);
|
||||
ReadField<ErrorPolicy_Igno>(dest.norfac,"norfac",db);
|
||||
|
||||
db.reader->IncPtr(size);
|
||||
}
|
||||
@@ -608,7 +610,7 @@ template <> void Structure :: Convert<Tex> (
|
||||
const FileDatabase& db
|
||||
) const
|
||||
{
|
||||
|
||||
ReadField<ErrorPolicy_Igno>((short&)dest.imaflag,"imaflag",db);
|
||||
ReadField<ErrorPolicy_Fail>((int&)dest.type,"type",db);
|
||||
ReadFieldPtr<ErrorPolicy_Warn>(dest.ima,"*ima",db);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user