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

Correctly set path for the loaded objects



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14440 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 72b52e34
......@@ -1133,36 +1133,44 @@ int FileOFFPlugin::loadObject(QString _filename) {
return -1;
}
QFileInfo file(_filename);
// Handle new PolyMeshes
PolyMeshObject* polyMeshObj = dynamic_cast< PolyMeshObject* > (object);
if ( polyMeshObj ){
if ( !importer.hasVertexNormals() )
polyMeshObj->mesh()->update_normals();
else
polyMeshObj->mesh()->update_face_normals();
backupTextureCoordinates(*(polyMeshObj->mesh()));
polyMeshObj->update();
polyMeshObj->show();
// Remember the path where we found the file
polyMeshObj->setPath(file.path());
if ( !importer.hasVertexNormals() )
polyMeshObj->mesh()->update_normals();
else
polyMeshObj->mesh()->update_face_normals();
backupTextureCoordinates(*(polyMeshObj->mesh()));
polyMeshObj->update();
polyMeshObj->show();
}
// Handle new TriMeshes
TriMeshObject* triMeshObj = dynamic_cast< TriMeshObject* > (object);
if ( triMeshObj ){
if ( !importer.hasVertexNormals() || (userReadOptions_ & OFFImporter::FORCE_NONORMALS) )
triMeshObj->mesh()->update_normals();
else
triMeshObj->mesh()->update_face_normals();
backupTextureCoordinates(*(triMeshObj->mesh()));
triMeshObj->update();
triMeshObj->show();
// Remember the path where we found the file
triMeshObj->setPath(file.path());
if ( !importer.hasVertexNormals() || (userReadOptions_ & OFFImporter::FORCE_NONORMALS) )
triMeshObj->mesh()->update_normals();
else
triMeshObj->mesh()->update_face_normals();
backupTextureCoordinates(*(triMeshObj->mesh()));
triMeshObj->update();
triMeshObj->show();
}
//general stuff
......
Markdown is supported
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