Commit 1aa86d0c authored by Jan Möbius's avatar Jan Möbius
Browse files

Made color casts more flexible

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8387 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f6fe9e34
......@@ -504,12 +504,10 @@ void OBJImporter::addMaterial(std::string _materialName){
for (uint i=0; i < addedFacesTri_.size(); i++){
if ( mat.has_Kd() ) {
Vec3uc color = OpenMesh::color_cast<Vec3uc, Vec3f>(mat.Kd());
bool colorAllowed = ! ( objectOptions_[ currentObject() ] & FORCE_NOCOLOR );
if ( currentTriMesh()->has_face_colors() && colorAllowed ){
currentTriMesh()->set_color(addedFacesTri_[i], color);
currentTriMesh()->set_color(addedFacesTri_[i], OpenMesh::color_cast< TriMesh::Color >(mat.Kd() ) );
objectOptions_[ currentObject() ] |= FACECOLOR;
}
}
......@@ -554,12 +552,10 @@ void OBJImporter::addMaterial(std::string _materialName){
}
if ( mat.has_Kd() ) {
Vec3uc color = OpenMesh::color_cast<Vec3uc, Vec3f>(mat.Kd());
bool colorAllowed = ! ( objectOptions_[ currentObject() ] & FORCE_NOCOLOR );
if ( currentPolyMesh()->has_face_colors() && colorAllowed ){
currentPolyMesh()->set_color(addedFacePoly_, color);
currentPolyMesh()->set_color(addedFacePoly_, OpenMesh::color_cast< PolyMesh::Color >(mat.Kd() ));
objectOptions_[ currentObject() ] |= FACECOLOR;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment