Presence of Layered Textures no longer disables texture import from FBX files
--HG-- extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4032
This commit is contained in:
@@ -436,6 +436,10 @@ void LoadMesh(std::vector<KRResource *> &resources, KFbxGeometryConverter *pGeom
|
||||
lKFbxDouble1 =((KFbxSurfacePhong *) pMaterial)->Shininess;
|
||||
new_material->setShininess(lKFbxDouble1.Get());
|
||||
|
||||
// ShininessFactor
|
||||
lKFbxDouble1 =((KFbxSurfacePhong *) pMaterial)->SpecularFactor;
|
||||
double specular_factor = lKFbxDouble1.Get();
|
||||
|
||||
// Display the Reflectivity
|
||||
//lKFbxDouble1 =((KFbxSurfacePhong *) pMaterial)->ReflectionFactor;
|
||||
} else if(pMaterial->GetClassId().Is(KFbxSurfaceLambert::ClassId) ) {
|
||||
@@ -466,8 +470,9 @@ void LoadMesh(std::vector<KRResource *> &resources, KFbxGeometryConverter *pGeom
|
||||
// Diffuse Map Texture
|
||||
pProperty = pMaterial->FindProperty(KFbxSurfaceMaterial::sDiffuse);
|
||||
if(pProperty.GetSrcObjectCount(KFbxLayeredTexture::ClassId) > 0) {
|
||||
printf("Error! Layered textures not supported.\n");
|
||||
} else {
|
||||
printf("Warning! Layered textures not supported.\n");
|
||||
}
|
||||
|
||||
int texture_count = pProperty.GetSrcObjectCount(KFbxTexture::ClassId);
|
||||
if(texture_count > 1) {
|
||||
printf("Error! Multiple diffuse textures not supported.\n");
|
||||
@@ -483,20 +488,22 @@ void LoadMesh(std::vector<KRResource *> &resources, KFbxGeometryConverter *pGeom
|
||||
assert(pTexture->GetRotationU() == 0.0f);
|
||||
assert(pTexture->GetRotationV() == 0.0f);
|
||||
assert(pTexture->GetRotationW() == 0.0f);
|
||||
assert(pTexture->GetScaleU() == 1.0f);
|
||||
assert(pTexture->GetScaleV() == 1.0f);
|
||||
|
||||
KFbxFileTexture *pFileTexture = KFbxCast<KFbxFileTexture>(pTexture);
|
||||
if(pFileTexture) {
|
||||
new_material->setDiffuseMap(KRResource::GetFileBase(pFileTexture->GetFileName()), KRVector2(pTexture->GetScaleU(), pTexture->GetScaleV()), KRVector2(pTexture->GetTranslationU(), pTexture->GetTranslationV()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Specular Map Texture
|
||||
pProperty = pMaterial->FindProperty(KFbxSurfaceMaterial::sSpecular);
|
||||
if(pProperty.GetSrcObjectCount(KFbxLayeredTexture::ClassId) > 0) {
|
||||
printf("Error! Layered textures not supported.\n");
|
||||
} else {
|
||||
int texture_count = pProperty.GetSrcObjectCount(KFbxTexture::ClassId);
|
||||
printf("Warning! Layered textures not supported.\n");
|
||||
}
|
||||
texture_count = pProperty.GetSrcObjectCount(KFbxTexture::ClassId);
|
||||
if(texture_count > 1) {
|
||||
printf("Error! Multiple specular textures not supported.\n");
|
||||
} else if(texture_count == 1) {
|
||||
@@ -506,14 +513,14 @@ void LoadMesh(std::vector<KRResource *> &resources, KFbxGeometryConverter *pGeom
|
||||
new_material->setSpecularMap(KRResource::GetFileBase(pFileTexture->GetFileName()), KRVector2(pTexture->GetScaleU(), pTexture->GetScaleV()), KRVector2(pTexture->GetTranslationU(), pTexture->GetTranslationV()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Normal Map Texture
|
||||
pProperty = pMaterial->FindProperty(KFbxSurfaceMaterial::sNormalMap);
|
||||
if(pProperty.GetSrcObjectCount(KFbxLayeredTexture::ClassId) > 0) {
|
||||
printf("Error! Layered textures not supported.\n");
|
||||
} else {
|
||||
int texture_count = pProperty.GetSrcObjectCount(KFbxTexture::ClassId);
|
||||
printf("Warning! Layered textures not supported.\n");
|
||||
}
|
||||
|
||||
texture_count = pProperty.GetSrcObjectCount(KFbxTexture::ClassId);
|
||||
if(texture_count > 1) {
|
||||
printf("Error! Multiple normal map textures not supported.\n");
|
||||
} else if(texture_count == 1) {
|
||||
@@ -523,7 +530,6 @@ void LoadMesh(std::vector<KRResource *> &resources, KFbxGeometryConverter *pGeom
|
||||
new_material->setNormalMap(KRResource::GetFileBase(pFileTexture->GetFileName()), KRVector2(pTexture->GetScaleU(), pTexture->GetScaleV()), KRVector2(pTexture->GetTranslationU(), pTexture->GetTranslationV()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool bFound = false;
|
||||
vector<KRResource *>::iterator resource_itr = resources.begin();
|
||||
|
||||
Reference in New Issue
Block a user