Index: trunk/src/formats/assimp_loader.cc
===================================================================
--- trunk/src/formats/assimp_loader.cc	(revision 480)
+++ trunk/src/formats/assimp_loader.cc	(revision 482)
@@ -105,12 +105,12 @@
 }
 
-data_channel_set* nv::assimp_loader::release_mesh_data( size_t index /*= 0 */ )
+data_channel_set* nv::assimp_loader::release_mesh_data( size_t index, data_node_info& info )
 {
 	if ( index >= m_mesh_count ) return nullptr;
 	data_channel_set* result = data_channel_set_creator::create_set( 2 );
-	load_mesh_data( result, index );
+	load_mesh_data( result, index, info );
 	return result;
 }
-void nv::assimp_loader::load_mesh_data( data_channel_set* data, size_t index )
+void nv::assimp_loader::load_mesh_data( data_channel_set* data, size_t index, data_node_info& info )
 {
 	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
@@ -126,5 +126,6 @@
 	data_channel_set_creator maccess( data );
 	const char* name = mesh->mName.data;
-	maccess.set_name( make_name( name ) );
+	info.name = make_name( name );
+	info.parent_id = -1;
 	uint8*  cdata   = maccess.add_channel( desc, mesh->mNumVertices ).raw_data();
 	uint16* indices = reinterpret_cast<uint16*>( maccess.add_channel< index_u16 >( mesh->mNumFaces * 3 ).raw_data() );
@@ -190,5 +191,5 @@
 }
 
-bool nv::assimp_loader::load_bones( size_t index, array_ref< data_channel_set* > bones )
+bool nv::assimp_loader::load_bones( size_t index, array_ref< data_node_info > bones )
 {
 	if ( m_scene == nullptr ) return false;
@@ -200,9 +201,7 @@
 		aiBone* bone   = mesh->mBones[m];
 		mat4    offset = assimp_mat4_cast( bone->mOffsetMatrix );
-		bones[m] = data_channel_set_creator::create_set( 0 );
-		data_channel_set_creator access( bones[m] );
 		const char* name = bone->mName.data;
-		access.set_name( make_name( name ) );
-		access.set_transform( offset );
+		bones[m].name = make_name( name );
+		bones[m].transform = offset;
 	}
 	return true;
@@ -284,23 +283,24 @@
 }
 
-mesh_nodes_data* nv::assimp_loader::release_merged_bones( data_channel_set* meshes )
-{
-	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
-	mesh_nodes_data* result = new mesh_nodes_data( make_name( "bones" ) );
+data_node_list* nv::assimp_loader::release_merged_bones( data_channel_set* meshes )
+{
+	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
+	data_node_list* result = new data_node_list( make_name( "bones" ) );
 	hash_store< shash64, uint16 > names;
 	for ( unsigned int m = 0; m < m_mesh_count; ++m )
 	{
 		uint16 translate[MAX_BONES];
-		vector< data_channel_set* > bones;
+		vector< data_node_info > bones;
 		const aiMesh*  mesh  = scene->mMeshes[ m ];
 		if ( mesh->mNumBones != 0 )
 		{
 			bones.resize( mesh->mNumBones );
+			NV_ASSERT( false, "parent ids for bones are not loaded!" );
 			load_bones( m, bones );
 			for ( unsigned int b = 0; b < mesh->mNumBones; ++b )
 			{
 
-				data_channel_set* bone = bones[b];
-				auto iname = names.find( bone->get_name() );
+				data_node_info bone = bones[b];
+				auto iname = names.find( bone.name );
 				if ( iname == names.end() )
 				{
@@ -308,5 +308,5 @@
 					uint16 index = uint16( result->size() );
 					result->append( bone );
-					names[ bone->get_name() ] = index;
+					names[ bone.name ] = index;
 					translate[b] = index;
 				}
@@ -334,5 +334,5 @@
 		}	
 	}
-	result->initialize();
+	//result->initialize();
 
 	return result;
@@ -352,18 +352,39 @@
 	uint16 frame_rate     = static_cast<uint16>( anim->mTicksPerSecond );
 	uint16 duration       = static_cast<uint16>( anim->mDuration );
-	bool   flat           = false;
-
-	data_channel_set** temp = new data_channel_set*[ count ];
+
+	data_channel_set** temp  = new data_channel_set*[ count ];
+	data_node_info*    temp2 = new data_node_info[count];
 	array_ref< data_channel_set* > temp_ref( temp, count );
-	load_node( index, temp_ref, root, 0, -1 );
-
-	mesh_nodes_data* result = new mesh_nodes_data( make_name( static_cast<const char*>( anim->mName.data ) ), frame_rate, duration, flat );
-	for ( auto set : temp_ref )
-	{
-		result->append( set );
+	array_ref< data_node_info >    temp2_ref( temp2, count );
+	load_node( index, temp_ref, temp2_ref, root, 0, -1 );
+
+	mesh_nodes_data* result = new mesh_nodes_data( make_name( static_cast<const char*>( anim->mName.data ) ), frame_rate, duration );
+	for ( nv::uint32 i = 0; i < count; ++i )
+	{
+		result->append( temp_ref[i], temp2_ref[i] );
 	}
 	result->initialize();
 	delete temp;
+	delete temp2;
 	return result;
+}
+
+data_node_list* nv::assimp_loader::release_data_node_list( size_t index /*= 0 */ )
+{
+	int this_is_incorrect;
+	NV_ASSERT( false, "unimplemented!" );
+// 	mesh_nodes_data* half_result = release_mesh_nodes_data( index );
+// 	data_node_list* result = new data_node_list( half_result->get_name() );
+// 	for ( auto node : *half_result )
+// 		result->append( node->get_info() );
+// 	delete half_result;
+//	return result;
+	return nullptr;
+}
+
+bool nv::assimp_loader::is_animated( size_t /*= 0 */ )
+{
+	int this_is_incorrect;
+	return false;
 }
 
@@ -379,5 +400,5 @@
 }
 
-nv::sint16 nv::assimp_loader::load_node( uint32 anim_id, array_ref< data_channel_set* > nodes, const void* vnode, sint16 this_id, sint16 parent_id )
+nv::sint16 nv::assimp_loader::load_node( uint32 anim_id, array_ref< data_channel_set* > nodes, array_ref< data_node_info > infos, const void* vnode, sint16 this_id, sint16 parent_id )
 {
 	const aiScene* scene = reinterpret_cast<const aiScene*>( m_scene );
@@ -396,18 +417,18 @@
 	nodes[ this_id ] = anode ? create_keys( anode ) : data_channel_set_creator::create_set( 0 );
 
-	data_channel_set_creator access( nodes[this_id] );
-	access.set_name( make_name( name ) );
-	access.set_parent_id( parent_id );
+	infos[this_id].name      = make_name( name );
+	infos[this_id].parent_id = parent_id;
 	// This value is ignored by the create_transformed_keys, but needed by create_direct_keys!
 	// TODO: find a common solution!
 	//       This is bad because create_transformed_keys never uses node-transformations for
 	//       node's without keys
-	access.set_transform( nv::assimp_mat4_cast( node->mTransformation ) );
-	if ( this_id == 0 ) access.set_transform( mat4() );
+	// TODO: this can probably be deleted
+	infos[this_id].transform = nv::assimp_mat4_cast( node->mTransformation );
+	if ( this_id == 0 ) infos[this_id].transform = mat4();
 
 	nv::sint16 next = this_id + 1;
 	for ( unsigned i = 0; i < node->mNumChildren; ++i )
 	{
-		next = load_node( anim_id, nodes, node->mChildren[i], next, this_id );
+		next = load_node( anim_id, nodes, infos, node->mChildren[i], next, this_id );
 	}
 
