Commit 868c1faf authored by Jan Möbius's avatar Jan Möbius

Store original texture coordinates as a texture

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5798 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e52c21a9
......@@ -196,16 +196,22 @@ void TextureControlPlugin::addedEmptyObject( int _id ) {
template< typename MeshT >
void TextureControlPlugin::handleFileOpenTextures( MeshT*& _mesh , int _objectId ) {
OpenMesh::VPropHandleT< typename MeshT::TexCoord2D > oldVertexCoords;
_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 );
emit addTexture("Original Per Vertex Texture Coords","Unknown",_objectId);
OpenMesh::HPropHandleT< typename MeshT::TexCoord2D > oldHalfedgeCoords;
_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 );
emit addTexture("Original Per Face Texture Coords","Unknown",_objectId);
emit setTextureMode("Original Per Face Texture Coords","type=halfedgebased",_objectId);
// If this property is available we have a mapping between face_index_property and
// available textures stored in the map
......
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