Index: trunk/src/formats/assimp_loader.cc
===================================================================
--- trunk/src/formats/assimp_loader.cc	(revision 285)
+++ trunk/src/formats/assimp_loader.cc	(revision 287)
@@ -79,7 +79,13 @@
 {
 	if ( index >= m_mesh_count ) return nullptr;
-	mesh_data* result = new mesh_data();
+	mesh_data* result = new mesh_data;
+	load_mesh_data( result, index );
+	return result;
+}
+void nv::assimp_loader::load_mesh_data( mesh_data* data, size_t index )
+{
 	const aiScene* scene = (const aiScene*)m_scene;
 	const aiMesh*  mesh  = scene->mMeshes[ index ];
+	data->set_name( mesh->mName.data );
 
 	vec3 vertex_offset     = glm::vec3(); 
@@ -94,5 +100,5 @@
 		channel = mesh_raw_channel::create< assimp_plain_vtx >( mesh->mNumVertices );
 
-	result->add_channel( channel );
+	data->add_channel( channel );
 	for (unsigned int i=0; i<mesh->mNumVertices; i++)
 	{
@@ -139,5 +145,5 @@
 
 	mesh_raw_channel* ichannel = mesh_raw_channel::create_index( USHORT, mesh->mNumFaces * 3 );
-	result->add_channel( ichannel );
+	data->add_channel( ichannel );
 	uint16* indices = (uint16*)ichannel->data;
 	for (unsigned int i=0; i<mesh->mNumFaces; i++)
@@ -149,6 +155,4 @@
 		}
 	}
-
-	return result;
 }
 
@@ -322,9 +326,18 @@
 	const aiAnimation* anim = scene->mAnimations[0]; // if implemented, change in load_node also
 
-	result->fps            = (float)anim->mTicksPerSecond;
+	result->frame_rate     = (uint16)anim->mTicksPerSecond;
 	result->duration       = (float)anim->mDuration;
-	result->pretransformed = pre_transform;
+	result->flat           = pre_transform;
+	result->max_frames     = 0;
 
 	load_node( result, root, 0, -1 );
+
+	// DAE pre_transform hack
+	if ( result->flat && result->frame_rate == 1 )
+	{
+		result->frame_rate = 32;
+		result->duration   = (float)result->max_frames;
+	}
+
 	return result;
 }
@@ -371,5 +384,5 @@
 	if (anode) 
 	{
-		if ( data->pretransformed )
+		if ( data->flat )
 		{
 			create_transformed_keys( &a_data, anode, parent_id >= 0 ? &(data->nodes[ parent_id ]) : nullptr );
@@ -379,4 +392,5 @@
 			create_direct_keys( &a_data, anode );
 		}
+		data->max_frames = glm::max<uint32>( a_data.data->get_channel(0)->count, data->max_frames );
 	}
 
@@ -386,4 +400,5 @@
 		next = load_node( data, node->mChildren[i], next, this_id );
 	}
+
 	return next;
 }
@@ -432,11 +447,11 @@
 	key_raw_channel* raw_pchannel = key_raw_channel::create<assimp_key_p>( node->mNumPositionKeys );
 	key_raw_channel* raw_rchannel = key_raw_channel::create<assimp_key_r>( node->mNumRotationKeys );
-	key_raw_channel* raw_schannel = key_raw_channel::create<assimp_key_s>( node->mNumScalingKeys );
+	//key_raw_channel* raw_schannel = key_raw_channel::create<assimp_key_s>( node->mNumScalingKeys );
 	data->data->add_channel( raw_pchannel );
 	data->data->add_channel( raw_rchannel );
-	data->data->add_channel( raw_schannel );
+	//data->data->add_channel( raw_schannel );
 	assimp_key_p* pchannel = ((assimp_key_p*)(raw_pchannel->data));
 	assimp_key_r* rchannel = ((assimp_key_r*)(raw_rchannel->data));
-	assimp_key_s* schannel = ((assimp_key_s*)(raw_schannel->data));
+	//assimp_key_s* schannel = ((assimp_key_s*)(raw_schannel->data));
 
 	for ( unsigned np = 0; np < node->mNumPositionKeys; ++np )
@@ -450,24 +465,40 @@
 		rchannel[np].rotation = glm::quat_cast( m_r33 * glm::mat3_cast( assimp_quat_cast(node->mRotationKeys[np].mValue ) ) * m_ri33 );
 	}
-	if ( node->mNumScalingKeys > 0 )
-	{
-		nv::vec3 scale_vec0 = assimp_vec3_cast( node->mScalingKeys[0].mValue );
-		float scale_value   = glm::length( glm::abs( scale_vec0 - nv::vec3(1,1,1) ) );
-		if ( node->mNumScalingKeys > 1 || scale_value > 0.001 ) 
-		{
-			NV_LOG( nv::LOG_WARNING, "scale key significant!" );
-			for ( unsigned np = 0; np < node->mNumRotationKeys; ++np )
-			{
-				schannel[np].time  = (float)node->mScalingKeys[np].mTime;
-				schannel[np].scale = assimp_vec3_cast(node->mScalingKeys[np].mValue);
-			}
-		}
-		else 
-		{
-			schannel[0].time  = (float)node->mScalingKeys[0].mTime;
-			schannel[0].scale = assimp_vec3_cast(node->mScalingKeys[0].mValue);
-		}
-	}
-
-}
-
+// 	if ( node->mNumScalingKeys > 0 )
+// 	{
+// 		nv::vec3 scale_vec0 = assimp_vec3_cast( node->mScalingKeys[0].mValue );
+// 		float scale_value   = glm::length( glm::abs( scale_vec0 - nv::vec3(1,1,1) ) );
+// 		if ( node->mNumScalingKeys > 1 || scale_value > 0.001 ) 
+// 		{
+// 			NV_LOG( nv::LOG_WARNING, "scale key significant!" );
+// 			for ( unsigned np = 0; np < node->mNumRotationKeys; ++np )
+// 			{
+// 				schannel[np].time  = (float)node->mScalingKeys[np].mTime;
+// 				schannel[np].scale = assimp_vec3_cast(node->mScalingKeys[np].mValue);
+// 			}
+// 		}
+// 		else 
+// 		{
+// 			schannel[0].time  = (float)node->mScalingKeys[0].mTime;
+// 			schannel[0].scale = assimp_vec3_cast(node->mScalingKeys[0].mValue);
+// 		}
+// 	}
+
+}
+
+mesh_data_pack* nv::assimp_loader::release_mesh_data_pack()
+{
+	mesh_data* meshes = new mesh_data[ m_mesh_count ];
+	for ( uint32 i = 0; i < m_mesh_count; ++i )
+	{
+		load_mesh_data(&meshes[i],i);
+	}
+	return new mesh_data_pack( m_mesh_count, meshes, release_mesh_nodes_data() );
+}
+
+mesh_nodes_data* nv::assimp_loader::release_mesh_nodes_data()
+{
+	// TODO: implement
+	return nullptr;
+}
+
