Index: GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoSubMesh.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoSubMesh.h	(revision 1009)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoSubMesh.h	(revision 2341)
@@ -49,4 +49,5 @@
 		MeshType	mType;	///<	Type of mesh
 
+		char			mName[255];					///<	Submesh name.
 		char			mMaterialName[255];	///<	Material name
 
Index: GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshLoader.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshLoader.h	(revision 1788)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshLoader.h	(revision 2341)
@@ -53,4 +53,8 @@
 	const unsigned	short M_EDGE_LIST_LOD								=	0xB100;
 	const unsigned	short M_EDGE_GROUP									= 0xB110;
+	const unsigned	short M_POSES												= 0xC000;
+	const unsigned	short M_ANIMATIONS									= 0xD000;
+	const unsigned	short M_LODSTRIPS										= 0xABCD;
+	const unsigned	short M_LODTREES										= 0xDCBA;
 	const	unsigned	short	SUBMESH_COUNT									=	0;
 	const	unsigned	short	GEOMESH_BUILD									=	1;
Index: GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshStripifier.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshStripifier.h	(revision 1559)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshStripifier.h	(revision 2341)
@@ -1,12 +1,12 @@
-/*==========================================================================
+/*=======================================================================
  *	(C) 2005 Universidad Jaime I de Castellón
- *==========================================================================
+ *=======================================================================
  *	PROYECT:	GAME TOOLS
- *==========================================================================*/
-/*	CONTENT:	Make triangle strips meshes from triangle list meshes.
+ *=======================================================================
+ *	CONTENT:	Make triangle strips meshes from triangle list meshes.
  *
  *
  *	@file	GeoMeshStripifier.h
- *==========================================================================*/
+ *=======================================================================*/
 
 #ifndef __GEO_STRIPIFIER__
Index: GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshSaver.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshSaver.h	(revision 1136)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/include/GeoMeshSaver.h	(revision 2341)
@@ -1,12 +1,12 @@
-/*	==========================================================================
+/*=======================================================================
  *	(C) 2005 Universitat Jaume I
- *	==========================================================================
+ *=======================================================================
  *	PROYECT:	GAME TOOLS
- *	========================================================================*/
-/*	CONTENT:	
+ *=======================================================================
+ *	CONTENT:	
  *
  *
  *	@file	GeoMeshSaver.h
- *	========================================================================*/
+ *=======================================================================*/
 
 #ifndef	__GEO_MESH_SAVER__
@@ -21,4 +21,5 @@
 	{
 		private:
+
 			//	The mesh to write.
 			Mesh	*mGeoMesh;
@@ -48,5 +49,8 @@
 			//	Write Mesh Bounds.
 			void	writeMeshBounds(Mesh	*geoMesh);
-			
+
+			// Write submesh name table.
+			void	writeSubMeshNameTable(Mesh	*geoMesh);
+	
 			//	Calculate the mesh size in bytes.
 			size_t	calcMeshSize(const Mesh	*geoMesh);
Index: GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoSubMesh.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoSubMesh.cpp	(revision 1009)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoSubMesh.cpp	(revision 2341)
@@ -15,4 +15,5 @@
 	mType(GEO_TRIANGLE_LIST)
 {
+	strcpy(mName,"");
 	strcpy(mMaterialName,"");
 }
Index: GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshLoader.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshLoader.cpp	(revision 2127)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshLoader.cpp	(revision 2341)
@@ -14,4 +14,6 @@
 #include	<cctype>
 #include	<map>
+#include "GeoLodStripsLibrary.h"
+#include "GeoLodStripsConstructor.h"
 
 using namespace Geometry;
@@ -165,5 +167,4 @@
 	unsigned	short	headerID;
 	size_t					i;
-	//float						aux;
 	size_t					k;
 	bool						found;
@@ -462,5 +463,4 @@
 	}
 	
-
 	if (idx32bit)
 	{
@@ -561,5 +561,4 @@
 		}
 	}
-
 }
 
@@ -597,5 +596,4 @@
 		
 		jumpChunk(f);
-
 	}
 }
@@ -606,36 +604,47 @@
 void GeoMeshLoader::readSubMeshNameTable(FILE	*f, Mesh	*geoMesh)
 {
-		unsigned	short	chunkID;
-		unsigned	short	subMeshIndex;
-		char						string[255];
-
+	unsigned	short	chunkID;
+	unsigned	short	subMeshIndex;
+	char						string[255];
+
+	if (!feof(f))
+	{
+		chunkID	=	readChunk(f);
+
+		while	(!feof(f) && (chunkID == M_SUBMESH_NAME_TABLE_ELEMENT))
+		{
+			//	Debug.
+			cout	<<	"		M_SUBMESH_NAME_TABLE_ELEMENT"
+				<<	endl;
+
+			//	Read in the index of the submesh.
+			fread(&subMeshIndex,sizeof(unsigned short),1,f);
+
+			//	Read in the String and map it to its index.
+			fgets(string,255,f);
+
+			string[strlen(string) - 1]	=	'\0';
+
+			//	Gets the submesh name.
+			strcpy(geoMesh->mSubMesh[subMeshIndex].mName,string);
+
+			cout	<<	"--> SubMesh "
+				<<	subMeshIndex
+				<<	": "
+				<<	string
+				<<	endl;
+
+			// If we're not end of file get the next chunk ID.
+			if (!feof(f))
+			{
+				chunkID = readChunk(f);
+			}
+		}
 		if (!feof(f))
 		{
-			chunkID	=	readChunk(f);
-			
-			while	(!feof(f) && (chunkID == M_SUBMESH_NAME_TABLE_ELEMENT ))
-			{
-				//	Debug.
-				cout	<<	"		M_SUBMESH_NAME_TABLE_ELEMENT"
-							<<	endl;
-				
-				// Read in the index of the submesh.
-				fread(&subMeshIndex,sizeof(unsigned short),1,f);
-				
-				// Read in the String and map it to its index.
-				fgets(string,255,f);
-
-				// If we're not end of file get the next chunk ID.
-				if (!feof(f))
-				{
-					chunkID = readChunk(f);
-				}
-			}
-			if (!feof(f))
-			{
-				// Backpedal back to start of chunk.
-				fseek(f,-(long)CHUNK_OVERHEAD_SIZE,1);
-			}
-		}
+			// Backpedal back to start of chunk.
+			fseek(f,-(long)CHUNK_OVERHEAD_SIZE,1);
+		}
+	}
 }
 
@@ -643,8 +652,4 @@
 //	Read a mesh file.
 //-------------------------------------------------------------------------
-
-#include "GeoLodStripsLibrary.h"
-#include "GeoLodStripsConstructor.h"
-
 void GeoMeshLoader::readMesh(FILE	*f, Mesh	*geoMesh, int option)
 {
@@ -667,19 +672,21 @@
 		chunkID	=	readChunk(f);
 
-		while(!feof(f) &&
-				(chunkID == M_GEOMETRY ||
-				 chunkID == M_SUBMESH ||
-				 chunkID == M_MESH_SKELETON_LINK ||
-				 chunkID == M_MESH_BONE_ASSIGNMENT ||
-				 chunkID == M_MESH_LOD ||
-				 chunkID == M_MESH_BOUNDS ||
-				 chunkID == M_SUBMESH_NAME_TABLE ||
-				 chunkID == M_EDGE_LISTS ||
-				 chunkID == 0xabcd || 
-				 chunkID == 0xdcba))
+		while	(!feof(f) &&
+				(chunkID == M_GEOMETRY							||
+				 chunkID == M_SUBMESH								||
+				 chunkID == M_MESH_SKELETON_LINK		||
+				 chunkID == M_MESH_BONE_ASSIGNMENT	||
+				 chunkID == M_MESH_LOD							||
+				 chunkID == M_MESH_BOUNDS						||
+				 chunkID == M_SUBMESH_NAME_TABLE		||
+				 chunkID == M_EDGE_LISTS						||
+				 chunkID == M_LODSTRIPS							||
+				 chunkID == M_LODTREES							||
+				 chunkID == M_POSES									||
+				 chunkID == M_ANIMATIONS))
 		{
 			switch(chunkID)
 			{
-				case 0xabcd:
+				case M_LODSTRIPS:
 					
 					//	Debug.
@@ -741,5 +748,6 @@
 					break;
 
-				case 0xdcba:
+				case M_LODTREES:
+
 					cout << "LODTREES_Chunk" << endl;
 					treesimpseq = new Geometry::TreeSimplificationSequence;
@@ -761,5 +769,4 @@
 					break;
 
-
 				case M_GEOMETRY:
 
@@ -792,5 +799,4 @@
 					cout	<<	"		M_MESH_SKELETON_LINK  "
 								<<	endl;
-								
 
 					readSkeletonLink(f, geoMesh, option);
@@ -799,8 +805,4 @@
 
 				case M_MESH_BONE_ASSIGNMENT:
-
-					//	Debug.
-					//cout	<<	"		M_MESH_BONE_ASSIGNMENT  "
-					//			<<	endl;
 
 					readMeshBoneAssignment(f, geoMesh, option);
@@ -823,5 +825,4 @@
 								<<	endl;
 
-					//jumpChunk(f);
 					readMeshBounds(f, geoMesh, option);
 					break;
@@ -844,4 +845,22 @@
 					jumpChunk(f);
 					break;
+
+				case M_POSES:
+
+					//	Debug.
+					cout	<<	"		M_POSES "
+								<<	endl;
+
+					jumpChunk(f);
+					break;
+
+				case M_ANIMATIONS:
+
+					//	Debug.
+					cout	<<	"		M_ANIMATIONS "
+								<<	endl;
+
+					jumpChunk(f);
+					break;
 			}
 
@@ -866,7 +885,5 @@
 		}
 	}
-
-}
-
+}
 
 //-------------------------------------------------------------------------
@@ -879,5 +896,4 @@
 	size_t	strip_count;
 	size_t	tailIndex;
-	//size_t	tail;
 
 	head_found							=	false;
@@ -1476,4 +1492,6 @@
 	{
 		fgets(geoMesh->mSkeletonName,255,f);
+
+		geoMesh->mSkeletonName[strlen(geoMesh->mSkeletonName) - 1]	=	'\0';
 		
 		geoMesh->hasSkeleton	=	true;
Index: GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMesh.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMesh.cpp	(revision 2322)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMesh.cpp	(revision 2341)
@@ -59,4 +59,5 @@
 		mSubMesh[i].mType												=	mesh.mSubMesh[i].mType;
 
+		strcpy(mSubMesh[i].mName,mesh.mSubMesh[i].mName);
 		strcpy(mSubMesh[i].mMaterialName,mesh.mSubMesh[i].mMaterialName);
 		
@@ -202,4 +203,6 @@
 		mSubMesh[i].mVertexBuffer->mVertexInfo	=	mesh.mSubMesh[i].mVertexBuffer->mVertexInfo;
 		mSubMesh[i].mType												=	mesh.mSubMesh[i].mType;
+
+		strcpy(mSubMesh[i].mName,mesh.mSubMesh[i].mName);
 		strcpy(mSubMesh[i].mMaterialName,mesh.mSubMesh[i].mMaterialName);
 
@@ -515,4 +518,5 @@
 		mesh->mSubMesh[i].mType								=	mSubMesh[i].mType;
 		
+		strcpy(mesh->mSubMesh[i].mName,mSubMesh[i].mName);
 		strcpy(mesh->mSubMesh[i].mMaterialName,mSubMesh[i].mMaterialName);
 		
Index: GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshStripifier.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshStripifier.cpp	(revision 1559)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshStripifier.cpp	(revision 2341)
@@ -1,12 +1,12 @@
-/*	==========================================================================
+/*	=====================================================================
  *	(C) 2005 Universitat Jaume I
- *	==========================================================================
+ *	=====================================================================
  *	PROYECT:	GAME TOOLS
- *	==========================================================================*/
-/**	CONTENT:	Make triangle strip meshes from triangle list meshes.
-	*
-	*
-	*	@file	GeoMeshStripifier.cpp
-/*===========================================================================*/
+ *	=====================================================================
+ *	CONTENT:	Make triangle strip meshes from triangle list meshes.
+ *
+ *
+ *	@file	GeoMeshStripifier.cpp
+ *	=====================================================================*/
 
 #include "GeoMeshStripifier.h"
@@ -15,11 +15,11 @@
 using	namespace	std;
 
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 //	Private.
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-///	InitList.
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
+
+//-------------------------------------------------------------------------
+//	InitList.
+//-------------------------------------------------------------------------
 BOOL CustomStripifier::InitList(PLISTHEAD LHead)
 {
@@ -35,7 +35,7 @@
 }
 
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 //	AddHead.
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 BOOL CustomStripifier::AddHead(PLISTHEAD LHead, PLISTINFO LInfo)
 {
@@ -8062,47 +8062,47 @@
 void CustomStripifier::Save_Walks(int numfaces)
 {
-  int x,y,numverts;
-  int front_walk, back_walk;
-  ListHead *pListHead;
-  PF_FACES temp = NULL;
-  
-  for (x=0; x<numfaces; x++)
-    { 
-      /* for each face, get the face */
-      pListHead = PolFaces[x];
-      temp = (PF_FACES) PeekList(pListHead,LISTHEAD,0);
-      numverts = temp->nPolSize;
-      front_walk = 0; 
-      back_walk = 0;
-      
-      /* we are finding patches only for quads */
-      if (numverts == 4)
-	{
-	  /* 	for each face not seen yet, do North and South together
-		and East and West together
-	  */
-	  for (y=0;y<2;y++)
-	    {
-	      /*   Check if the opposite sides were seen already from another
-		   starting face, if they were then there is no need to do 
-		   the walk again
-	      */
-	      
-	      if 	( ((*(temp->walked+y) == -1) &&
-			   (*(temp->walked+y+2) == -1) ))
+	int x,y,numverts;
+	int front_walk, back_walk;
+	ListHead *pListHead;
+	PF_FACES temp = NULL;
+
+	for (x=0; x<numfaces; x++)
+	{ 
+		/* for each face, get the face */
+		pListHead = PolFaces[x];
+		temp = (PF_FACES) PeekList(pListHead,LISTHEAD,0);
+		numverts = temp->nPolSize;
+		front_walk = 0; 
+		back_walk = 0;
+
+		/* we are finding patches only for quads */
+		if (numverts == 4)
 		{
-		  /* Find walk for the first edge */
-		  front_walk = Calculate_Walks(x,y,temp);
-		  /* Find walk in the opposite direction */
-		  back_walk = Calculate_Walks(x,y+2,temp);
-		  /* 	Now put into the data structure the numbers that
-			we have found
-		  */
-		  Assign_Walk(x,temp,front_walk,y,back_walk);
-		  Assign_Walk(x,temp,back_walk,y+2,front_walk);
+			/* 	for each face not seen yet, do North and South together
+					and East and West together
+					*/
+			for (y=0;y<2;y++)
+			{
+				/*   Check if the opposite sides were seen already from another
+						 starting face, if they were then there is no need to do 
+						 the walk again
+						 */
+
+				if 	( ((*(temp->walked+y) == -1) &&
+							(*(temp->walked+y+2) == -1) ))
+				{
+					/* Find walk for the first edge */
+					front_walk = Calculate_Walks(x,y,temp);
+					/* Find walk in the opposite direction */
+					back_walk = Calculate_Walks(x,y+2,temp);
+					/* 	Now put into the data structure the numbers that
+							we have found
+							*/
+					Assign_Walk(x,temp,front_walk,y,back_walk);
+					Assign_Walk(x,temp,back_walk,y+2,front_walk);
+				}
+			}
 		}
-	    }
-	}
-    }
+	}
 }
 
@@ -8557,7 +8557,7 @@
 }
 
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 //	Constructors.
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 
 MeshStripifier::MeshStripifier()
@@ -8584,7 +8584,7 @@
 }
 
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 //	Destroyers.
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 CustomStripifier::~CustomStripifier()
 {	
@@ -8596,11 +8596,11 @@
 }
 
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 //	Public.
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
+
+//-------------------------------------------------------------------------
 //	Stripify.
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 int CustomStripifier::Stripify()
 {
@@ -8620,7 +8620,7 @@
 }
 
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 //	GetMesh: Return de current Mesh.
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 Mesh*	CustomStripifier::GetMesh()
 {
@@ -8633,7 +8633,7 @@
 }
 
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 //	Set the progress bar function.
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 void	CustomStripifier::SetProgressFunc(TIPOFUNC upb)
 {
@@ -8642,7 +8642,7 @@
 }
 
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 // Sets what is the submesh that stores the leaves.
-//-----------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 void CustomStripifier::SetSubMeshLeaves(size_t	submesh)
 {
Index: GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshSaver.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshSaver.cpp	(revision 2127)
+++ GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshSaver.cpp	(revision 2341)
@@ -181,4 +181,6 @@
 	if (geoMesh->hasSkeleton)
 	{
+		strcat(geoMesh->mSkeletonName,"\n");
+
 		// Write skeleton link
 		writeSkeletonLink(geoMesh->mSkeletonName);
@@ -199,4 +201,7 @@
 	writeMeshBounds(geoMesh);
 
+	// Write submesh name table.
+	writeSubMeshNameTable(geoMesh);
+
 	/*
 	// Write LOD data if any
@@ -212,9 +217,4 @@
 	writeBoundsInfo(pMesh);
 	LogManager::getSingleton().logMessage("Bounds information exported.");
-
-	// Write submesh name table
-	LogManager::getSingleton().logMessage("Exporting submesh name table...");
-	writeSubMeshNameTable(pMesh);
-	LogManager::getSingleton().logMessage("Submesh name table exported.");
 
 	// Write edge lists
@@ -414,5 +414,5 @@
 
 	//	Write the vertex declaration header.
-	writeChunkHeader(	M_GEOMETRY_VERTEX_DECLARATION,size);
+	writeChunkHeader(M_GEOMETRY_VERTEX_DECLARATION,size);
 
 	//	Debug.
@@ -425,5 +425,5 @@
 	//	Positions.
 	//	Write the vertex element header for position.
-	writeChunkHeader(	M_GEOMETRY_VERTEX_ELEMENT,size);
+	writeChunkHeader(M_GEOMETRY_VERTEX_ELEMENT,size);
 
 	//	Debug.
@@ -448,5 +448,5 @@
 	//	Normals.
 	//	Write the vertex element header for position.
-	writeChunkHeader(	M_GEOMETRY_VERTEX_ELEMENT,size);
+	writeChunkHeader(M_GEOMETRY_VERTEX_ELEMENT,size);
 	
 	//	Debug.
@@ -528,5 +528,5 @@
 
 	//	Write the vertex buffer header.
-	writeChunkHeader(	M_GEOMETRY_VERTEX_BUFFER,	size);
+	writeChunkHeader(M_GEOMETRY_VERTEX_BUFFER,	size);
 
 	//	Debug.
@@ -613,4 +613,47 @@
 	writeFloats(geoMesh->mMeshBounds.maxZ,1);
 	writeFloats(geoMesh->mMeshBounds.radius,1);
+}
+
+//-------------------------------------------------------------------------
+// Write submesh name table.
+//-------------------------------------------------------------------------
+void	GeoMeshSaver::writeSubMeshNameTable(Mesh	*geoMesh)
+{
+	size_t	size;
+	size_t	names_size;
+
+	//	Size of the names of the submeshes.
+	names_size	=	0;
+
+	//	For each submesh.
+	for (size_t	i = 0; i < geoMesh->mSubMeshCount;	i++)
+	{
+		names_size	=	strlen(geoMesh->mSubMesh[i].mName);
+	}
+
+	size	=	CHUNK_OVERHEAD_SIZE
+					+
+					names_size
+					+
+					(CHUNK_OVERHEAD_SIZE + sizeof(short)) * geoMesh->mSubMeshCount;
+
+	writeChunkHeader(M_SUBMESH_NAME_TABLE, (unsigned long)size);
+
+	//	For each submesh.
+	for (size_t	i = 0;	i < geoMesh->mSubMeshCount;	i++)
+	{
+		size	=	CHUNK_OVERHEAD_SIZE
+						+
+						sizeof(short)
+						+
+						strlen(geoMesh->mSubMesh[i].mName);
+
+		writeChunkHeader(M_SUBMESH_NAME_TABLE_ELEMENT, (unsigned long)size);
+
+		writeShorts(i, 1);
+
+		strcat(geoMesh->mSubMesh[i].mName,"\n");
+		mSerializer->WriteData(geoMesh->mSubMesh[i].mName);
+	}
 }
 
@@ -751,5 +794,4 @@
 
 	writeString(mesh_version);
-
 }
 
Index: GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h	(revision 2127)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/include/GeoMeshViewUI.h	(revision 2341)
@@ -307,4 +307,7 @@
 	size_t	getTriangleCount(Mesh	*geoMesh);
 
+	//	Get the number of degenerated triangles.
+	size_t	getDegeneratedCount(Mesh	*geoMesh);
+
 	//	Get the number of strips.
 	size_t	getStripCount(Mesh	*geoMesh);
@@ -340,5 +343,8 @@
 
 	//	Set textures to mesh model.
-	void setTextures();
+	void	setTextures();
+
+	//	Write strips into a file.
+	void	writeStrips(Mesh	*geomesh);
 
 	public:
@@ -400,4 +406,5 @@
 	fltk::Widget				*mVertices;
 	fltk::Widget				*mTriangles;
+	fltk::Widget				*mDegenerated;
 	fltk::Widget				*mStrips;
 	fltk::Widget				*mQuads;
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp	(revision 2323)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp	(revision 2341)
@@ -104,6 +104,4 @@
 }
 
-
-
 //-------------------------------------------------------------------------
 //	Repaint the FPS label.
@@ -156,4 +154,5 @@
 										cb_menuFileSave_i(o,v);
 }
+
 
 //-------------------------------------------------------------------------
@@ -1086,4 +1085,7 @@
 				stripify();
 
+				//	Debug.
+				//writeStrips(mGeoMesh);
+
 				break;
 
@@ -1298,6 +1300,9 @@
 {
 	char					*file_name	=	NULL;
+	char					*ptr;
+	char					message[255];
 	GeoMeshSaver	*mesh_saver;
 	Serializer		*oSerializer;
+	int						answer_yes;
 
 	//	Sets the progress bar to process bar.
@@ -1320,52 +1325,82 @@
 			if (file_name)
 			{
-				//	Undo the simplification changes.
-				undo();
-
-				//	Stripify the mesh object.
-				stripify();
-
-				//	Reset the build bar.
-				mBuildBar->position(0);
-
-				//	Simplification sequence.
-				oMeshSimpSequence =	mMeshSimplifier->GetSimplificationSequence();
-
-				//	If the simplification sequence and the mesh exist.
-				if (oMeshSimpSequence && mGeoMesh)
-				{
-					oLodStrip	=	new LodStripsConstructor(	mGeoMesh,
-																								oMeshSimpSequence,
-																								idMeshLeaves,
-																								progress_function);
-
-					oLodStrip->UpdateMesh();
-
-					//	Deletes the previous mesh.
-					delete mUndoMesh;
-
-					mUndoMesh	=	new Mesh();
-
-					//	Sets the undo mesh.
-					*mUndoMesh	=	*mGeoMesh;
-
-					delete	mGeoMesh;
-
-					mGeoMesh	=	oLodStrip->GetMesh();
-
-					geoMeshView->setMesh(mGeoMesh);
-
-					mesh_saver	=	new	GeoMeshSaver();
-
-					mesh_saver->leavesSubMesh	=	idMeshLeaves;
-					mesh_saver->leavesVB			=	origSubMeshVB;
-					mesh_saver->numindices		=	orig_numindices;
-					mesh_saver->indices				=	orig_indices;
-
-					mesh_saver->save(mGeoMesh,file_name);
-
-					delete	mesh_saver;
-
-					oLodStrip->Save(file_name);
+				//	Cut extension.
+				ptr	=	strtok(file_name,".");
+
+				//	If has extension.
+				if (ptr)
+				{
+					strcpy(file_name,ptr);
+				}
+
+				//	Adds mesh extension.
+				strcat(file_name,".mesh");
+
+				//	If File Exists.
+				if (fileExists(file_name))
+				{
+					//	Compose message.
+					strcpy(message,"Do you want to replace ");
+					strcat(message,filename_name(file_name));
+					strcat(message,"?");
+
+					//	Question.
+					answer_yes	=	fltk::ask(message);
+				}
+
+				//	If answer yes to replace question
+				//	or if file not exists.
+				if (answer_yes)
+				{
+
+					//	Undo the simplification changes.
+					undo();
+
+					//	Stripify the mesh object.
+					stripify();
+
+					//	Reset the build bar.
+					mBuildBar->position(0);
+
+					//	Simplification sequence.
+					oMeshSimpSequence =	mMeshSimplifier->GetSimplificationSequence();
+
+					//	If the simplification sequence and the mesh exist.
+					if (oMeshSimpSequence && mGeoMesh)
+					{
+						oLodStrip	=	new LodStripsConstructor(	mGeoMesh,
+								oMeshSimpSequence,
+								idMeshLeaves,
+								progress_function);
+
+						oLodStrip->UpdateMesh();
+
+						//	Deletes the previous mesh.
+						delete mUndoMesh;
+
+						mUndoMesh	=	new Mesh();
+
+						//	Sets the undo mesh.
+						*mUndoMesh	=	*mGeoMesh;
+
+						delete	mGeoMesh;
+
+						mGeoMesh	=	oLodStrip->GetMesh();
+
+						geoMeshView->setMesh(mGeoMesh);
+
+						mesh_saver	=	new	GeoMeshSaver();
+
+						mesh_saver->leavesSubMesh	=	idMeshLeaves;
+						mesh_saver->leavesVB			=	origSubMeshVB;
+						mesh_saver->numindices		=	orig_numindices;
+						mesh_saver->indices				=	orig_indices;
+
+						mesh_saver->save(mGeoMesh,file_name);
+
+						delete	mesh_saver;
+
+						oLodStrip->Save(file_name);
+					}
 				}
 				else
@@ -1837,7 +1872,9 @@
 {
 	char						type[10];
+
 	unsigned	int		group_index;
 	unsigned	int		group_count;
 	unsigned	int		bone_count;
+
 	fltk::ItemGroup **info_group;
 	
@@ -1867,4 +1904,5 @@
 			char	*skel_name		=	new char[256];
 			char	*bone_assig		=	new char[256];
+
 			sprintf(group_name,"Skeleton");
 			info_group[group_index]	= new fltk::ItemGroup(group_name);
@@ -1879,4 +1917,5 @@
 				bone_count	+=	mGeoMesh->mSubMesh[i].mBones.size();
 			}
+
 			sprintf(bone_assig,"Bone assignamets: %d",bone_count);
 			new fltk::Item(bone_assig);
@@ -1886,5 +1925,5 @@
 		}
 
-		for(int i=0; i<mGeoMesh->mSubMeshCount;i++)
+		for(int i	=	0; i < mGeoMesh->mSubMeshCount;	i++)
 		{
 			char	*group_name	=	new char[256];
@@ -1907,9 +1946,14 @@
 
 			//	Submesh identifier.
-			sprintf(group_name,"SubMesh %d %s",i,type);
+			sprintf(group_name,
+							"SubMesh %d %s:%s",
+							i,
+							type,
+							mGeoMesh->mSubMesh[i].mName);
 			
 			info_group[group_index] = new fltk::ItemGroup(group_name);
 			info_group[group_index]->begin();
 			fltk::Item *sharedGeometry;
+
 			if (mGeoMesh->mSubMesh[i].mSharedVertexBuffer)
 			{
@@ -1922,47 +1966,59 @@
 
 			//	Adds material name.
-			char *cadena2=new char[100];
+			char *cadena2	=	new char[100];
 			sprintf(cadena2, "Material: %s",mGeoMesh->mSubMesh[i].mMaterialName);
 			
 			fltk::Item	*geomaterial	=	new fltk::Item(cadena2);
 			
-			char *cadena3=new char[100];
+			char *cadena3	=	new char[100];
 			
-			sprintf(cadena3, "Number of indexes: %d",mGeoMesh->mSubMesh[i].mIndexCount);
+			sprintf(cadena3,
+							"Number of indexes: %d",
+							mGeoMesh->mSubMesh[i].mIndexCount);
+
 			fltk::Item *numberIndex = new fltk::Item(cadena3);
+
 			if (mGeoMesh->mSubMesh[i].mType==Geometry::GEO_TRIANGLE_LIST)
 			{
-				fltk::Item *type = new fltk::Item("Triangle List");
+				fltk::Item	*type	=	new fltk::Item("Triangle List");
 			}
 			else
 			{
-				fltk::Item *type = new fltk::Item("Triangle Strips");
+				fltk::Item	*type	=	new fltk::Item("Triangle Strips");
 			}
 
-			char *cadenavertex=new char[30];
-			sprintf(cadenavertex, "Number of vertices: %d",mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexCount);
-			fltk::Item *numberVertex = new fltk::Item(cadenavertex);
-
-			if (mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexInfo & Geometry::VERTEX_NORMAL)
+			char *cadenavertex	=	new char[30];
+
+			sprintf(cadenavertex,
+							"Number of vertices: %d",
+							mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexCount);
+
+			fltk::Item	*numberVertex	=	new fltk::Item(cadenavertex);
+
+			if (mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexInfo
+					&
+					Geometry::VERTEX_NORMAL)
 			{
-				fltk::Item *normals = new fltk::Item("Normals: Yes");
+				fltk::Item	*normals	=	new fltk::Item("Normals: Yes");
 			}
 			else
 			{
-				fltk::Item *normals = new fltk::Item("Normals: No");
+				fltk::Item *normals	=	new fltk::Item("Normals: No");
 			}
 
-			if (mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexInfo & Geometry::VERTEX_TEXCOORDS)
+			if (mGeoMesh->mSubMesh[i].mVertexBuffer->mVertexInfo
+					&
+					Geometry::VERTEX_TEXCOORDS)
 			{
-				fltk::Item *textures = new fltk::Item("Textures: Yes");
+				fltk::Item	*textures	=	new fltk::Item("Textures: Yes");
 			}
 			else
 			{
-				fltk::Item *textures = new fltk::Item("Textures: No");
+				fltk::Item	*textures	=	new fltk::Item("Textures: No");
 			}
 
-
 			info_group[group_index]->end();
 		}
+
 		ogeometry->end();
 		this->mMeshInfo->add(ogeometry);
@@ -2057,5 +2113,7 @@
 					break;
 				case	GEO_TRIANGLE_STRIPS:
-					triangle_count	+=	geoSubMesh->mIndexCount - 2;
+					triangle_count	+=	geoSubMesh->mIndexCount
+															-
+															2;
 					break;
 			}
@@ -2064,4 +2122,57 @@
 
 	return	triangle_count;
+}
+
+//-------------------------------------------------------------------------
+//	Get the number of degenerated triangles.
+//-------------------------------------------------------------------------
+size_t	GeoMeshViewUI::getDegeneratedCount(Geometry::Mesh	*geoMesh)
+{
+	size_t	degenerated;
+	size_t	same_index;
+	SubMesh	*geoSubMesh;
+
+	//	Initialize the degenerated count.
+	degenerated	=	0;
+
+	//	Initiazlize same index count.
+	same_index = 1;
+
+	//	For each submesh.
+	for (size_t	submesh	=	0; submesh < geoMesh->mSubMeshCount; submesh++)
+	{
+		//	Gets the actual submesh.
+		geoSubMesh	=	&geoMesh->mSubMesh[submesh];
+
+		if (geoSubMesh->mType == GEO_TRIANGLE_STRIPS)
+		{
+			//	Find degenerated triangles.
+			for (size_t	i = 0; i < (geoSubMesh->mIndexCount - 1); i++)
+			{
+				if (geoSubMesh->mIndex[i] == geoSubMesh->mIndex[i + 1])
+				{
+					same_index++;
+				}
+				else
+				{
+					if (same_index > 1)
+					{
+						degenerated	+=	same_index;
+					}
+					else if (i < (geoSubMesh->mIndexCount - 2))
+					{
+						if (geoSubMesh->mIndex[i] == geoSubMesh->mIndex[i + 2])
+						{
+							degenerated++;
+						}
+					}
+
+					same_index	= 1;
+				}
+			}
+		}
+	}
+
+	return	degenerated;
 }
 
@@ -2460,4 +2571,5 @@
 	static char	vertices_value[50];
 	static char	triangles_value[50];
+	static char	degenerated_value[50];
 	static char	strips_value[50];
 	
@@ -2471,4 +2583,9 @@
 
 	mTriangles->label(triangles_value);
+
+	//	Translate the degenerated count to a char value.
+	sprintf(degenerated_value,"Degenerated %d",getDegeneratedCount(mGeoMesh));
+
+	mDegenerated->label(degenerated_value);
 
 	//	Translate the triangle count to a char value.
@@ -2679,5 +2796,7 @@
 }
 
+//-------------------------------------------------------------------------
 //	Set textures to mesh model.
+//-------------------------------------------------------------------------
 void GeoMeshViewUI::setTextures()
 {
@@ -3241,5 +3360,13 @@
 			{
 				fltk::Widget* o;
-				o = mStrips = new fltk::Widget(354, 3, 30, 15, "Strips");
+				o = mDegenerated = new fltk::Widget(354, 3, 30, 15, "Degenerated");
+				o->box(fltk::NO_BOX);
+				o->labelfont(fltk::HELVETICA_BOLD);
+				o->color((fltk::Color)0xe0dfe300);
+			}
+
+			{
+				fltk::Widget* o;
+				o = mStrips = new fltk::Widget(454, 3, 30, 15, "Strips");
 				o->box(fltk::NO_BOX);
 				o->labelfont(fltk::HELVETICA_BOLD);
@@ -3320,2 +3447,50 @@
 }
 
+//-------------------------------------------------------------------------
+//	Write file of strips.
+//-------------------------------------------------------------------------
+void	GeoMeshViewUI::writeStrips(Mesh	*geomesh)
+{
+	Index			*index;
+	Index			*indexBegin;
+	Index			*indexEnd;
+	SubMesh		*geosubmesh;
+
+	ofstream	out ("strips.txt");
+
+	//	For each submesh.
+	for	(size_t	submesh	=	0;	submesh < geomesh->mSubMeshCount;	submesh++)
+	{
+		geosubmesh	=	&geomesh->mSubMesh[submesh];
+
+		//	For each one of the strips.
+		for (size_t strip = 0; strip < geosubmesh->mStripCount; strip++)
+		{
+			//	First index of the strip.
+			indexBegin	=	geosubmesh->mStrip[strip];
+
+			//	If is the final strip
+			if (strip	== (geosubmesh->mStripCount - 1))
+			{
+				//	The end of the index array.
+				indexEnd	=	&geosubmesh->mIndex[geosubmesh->mIndexCount];
+			}
+			else
+			{
+				//	The beginning of the next strip.
+				indexEnd	= geosubmesh->mStrip[strip + 1];
+			}
+
+			for (index = indexBegin; index < indexEnd; index++)
+			{
+				out <<	index[0]
+						<<	" ";
+			}
+
+			out	<<	endl;
+		}
+	}
+
+	out.close();
+}
+
Index: GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp
===================================================================
--- GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp	(revision 2324)
+++ GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshView.cpp	(revision 2341)
@@ -37,5 +37,4 @@
 			y				=	fltk::event_y();
 			
-
 			switch (button)
 			{
@@ -139,7 +138,7 @@
 }
 
-//---------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 //	Get the number of frames per second.
-//---------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 size_t	GeoMeshView::getFPS()
 {
@@ -147,7 +146,7 @@
 }
 
-//---------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 //	Calculate the number of frames per second.
-//---------------------------------------------------------------------------
+//-------------------------------------------------------------------------
 void	GeoMeshView::calcFPS()
 {
@@ -643,6 +642,6 @@
 		{
 			//	The end of the index array.
-			indexEnd	= &geosubmesh->mIndex[geosubmesh->mIndexCount];
-			size= indexEnd - indexBegin;
+			indexEnd	=	&geosubmesh->mIndex[geosubmesh->mIndexCount];
+			size			=	indexEnd - indexBegin;
 		}
 		else
@@ -678,5 +677,5 @@
 		}
 
-		//VERTEX ARRAYS
+		//	VERTEX ARRAYS.
 		glEnableClientState(GL_VERTEX_ARRAY);
 		glEnableClientState(GL_NORMAL_ARRAY);
@@ -938,5 +937,5 @@
 		//	For each one of the strips.
 		int indices_to_render = lodTreeLib->GetValidTrunkIndexCount(submesh);
-        		
+ 
 		glBegin(GL_TRIANGLE_STRIP);
 
