Commit 2c74fb12 authored by Dirk Wilden's avatar Dirk Wilden

request textureCoords in FilePlugins

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@8382 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 2c5ae84e
......@@ -231,28 +231,36 @@ void TextureControlPlugin::handleFileOpenTextures( MeshT*& _mesh , int _objectId
// ================================================================================
// Create a backup of the original per Vertex texture Coordinates
// ================================================================================
OpenMesh::VPropHandleT< typename MeshT::TexCoord2D > oldVertexCoords;
if ( !_mesh->get_property_handle(oldVertexCoords,"Original Per Vertex Texture Coords") )
_mesh->add_property(oldVertexCoords,"Original Per Vertex Texture Coords");
for ( TriMesh::VertexIter v_it = _mesh->vertices_begin(); v_it != _mesh->vertices_end(); ++v_it)
_mesh->property(oldVertexCoords, v_it ) = _mesh->texcoord2D( v_it );
slotTextureAdded("Original Per Vertex Texture Coords","unknown.png",2,_objectId);
slotSetTextureMode("Original Per Vertex Texture Coords","type=vertexbased",_objectId);
if ( _mesh->has_vertex_texcoords2D() ){
OpenMesh::VPropHandleT< typename MeshT::TexCoord2D > oldVertexCoords;
if ( !_mesh->get_property_handle(oldVertexCoords,"Original Per Vertex Texture Coords") )
_mesh->add_property(oldVertexCoords,"Original Per Vertex Texture Coords");
for ( TriMesh::VertexIter v_it = _mesh->vertices_begin(); v_it != _mesh->vertices_end(); ++v_it)
_mesh->property(oldVertexCoords, v_it ) = _mesh->texcoord2D( v_it );
slotTextureAdded("Original Per Vertex Texture Coords","unknown.png",2,_objectId);
slotSetTextureMode("Original Per Vertex Texture Coords","type=vertexbased",_objectId);
}
// ================================================================================
// Create a backup of the original per Face texture Coordinates
// ================================================================================
OpenMesh::HPropHandleT< typename MeshT::TexCoord2D > oldHalfedgeCoords;
if ( !_mesh->get_property_handle(oldHalfedgeCoords,"Original Per Face Texture Coords") )
_mesh->add_property(oldHalfedgeCoords,"Original Per Face Texture Coords");
for ( TriMesh::HalfedgeIter he_it = _mesh->halfedges_begin(); he_it != _mesh->halfedges_end(); ++he_it)
_mesh->property(oldHalfedgeCoords, he_it ) = _mesh->texcoord2D( he_it );
slotTextureAdded("Original Per Face Texture Coords","unknown.png",2,_objectId);
slotSetTextureMode("Original Per Face Texture Coords","type=halfedgebased",_objectId);
if ( _mesh->has_halfedge_texcoords2D() ){
OpenMesh::HPropHandleT< typename MeshT::TexCoord2D > oldHalfedgeCoords;
if ( !_mesh->get_property_handle(oldHalfedgeCoords,"Original Per Face Texture Coords") )
_mesh->add_property(oldHalfedgeCoords,"Original Per Face Texture Coords");
for ( TriMesh::HalfedgeIter he_it = _mesh->halfedges_begin(); he_it != _mesh->halfedges_end(); ++he_it)
_mesh->property(oldHalfedgeCoords, he_it ) = _mesh->texcoord2D( he_it );
slotTextureAdded("Original Per Face Texture Coords","unknown.png",2,_objectId);
slotSetTextureMode("Original Per Face Texture Coords","type=halfedgebased",_objectId);
}
}
......
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