Index: trunk/src/gfx/keyframed_mesh.cc
===================================================================
--- trunk/src/gfx/keyframed_mesh.cc	(revision 415)
+++ trunk/src/gfx/keyframed_mesh.cc	(revision 416)
@@ -23,5 +23,5 @@
 	, m_active( false )
 {
-	m_index_count  = m_mesh_data->get_index_channel()->size();
+	m_index_count  = m_mesh_data->get_channel( slot::INDEX )->size();
 	m_vertex_count = m_mesh_data->get_channel<vertex_t>()->size();
 	m_vchannel     = m_mesh_data->get_channel<vertex_pnt>();
@@ -190,8 +190,7 @@
 	m_context->add_vertex_buffers( m_va, vb, m_mesh_data->get_channel<vertex_t>() );
 
-	const raw_data_channel* index_channel = m_mesh_data->get_index_channel();
+	const raw_data_channel* index_channel = m_mesh_data->get_channel( slot::INDEX );
 	buffer  ib = m_context->get_device()->create_buffer( INDEX_BUFFER, STATIC_DRAW, index_channel->raw_size(), index_channel->raw_data() );
-
-	m_context->set_index_buffer( m_va, ib, m_mesh_data->get_index_channel()->descriptor()[0].etype, true );
+	m_context->set_index_buffer( m_va, ib, index_channel->descriptor()[0].etype, true );
 
 	m_data = new uint8[ m_vertex_count * m_vsize ];
Index: trunk/src/gfx/mesh_creator.cc
===================================================================
--- trunk/src/gfx/mesh_creator.cc	(revision 415)
+++ trunk/src/gfx/mesh_creator.cc	(revision 416)
@@ -6,4 +6,6 @@
 
 #include "nv/gfx/mesh_creator.hh"
+
+#include "nv/interface/data_channel_access.hh"
 
 struct nv_key_transform { nv::transform tform; };
@@ -22,5 +24,5 @@
 		size_t pcount    = ( pkeys ? pkeys->get_channel(0)->size() : 0 );
 		max_frames = nv::max<uint32>( count, max_frames );
-		if ( pkeys && pkeys->get_channel_count() > 0 && keys && keys->get_channel_count() > 0 )
+		if ( pkeys && pkeys->size() > 0 && keys && keys->size() > 0 )
 		{
 			data_channel_creator< nv_key_transform > channel_creator( const_cast< raw_data_channel* >( keys->get_channel( 0 ) ) );
@@ -54,7 +56,7 @@
 	{
 		key_data* old_keys = m_data->m_nodes[i].data;
-		if ( old_keys && old_keys->get_channel_count() > 0 )
-		{
-			size_t chan_count = old_keys->get_channel_count();
+		if ( old_keys && old_keys->size() > 0 )
+		{
+			size_t chan_count = old_keys->size();
 			if ( chan_count == 1 
 				&& old_keys->get_channel(0)->descriptor().size() == 1
@@ -85,5 +87,5 @@
 
 			delete old_keys;
-			new_keys->add_channel( kt_channel.release() );
+			new_keys->add_key_channel( kt_channel.release() );
 			m_data->m_nodes[i].data = new_keys;
 		}
@@ -104,5 +106,5 @@
 		{
 			key_data* kdata  = node.data;
-			for ( size_t c = 0; c < kdata->get_channel_count(); ++c )
+			for ( size_t c = 0; c < kdata->size(); ++c )
 			{
 				raw_data_channel_creator channel( const_cast< raw_data_channel* >( kdata->get_channel( c ) ) );
@@ -123,7 +125,7 @@
 	mat3 normal_transform  = r33;
 
-	for ( uint32 c = 0; c < m_data->get_channel_count(); ++c )
-	{
-		raw_data_channel_creator channel( m_data->m_channels[ c ] );
+	for ( uint32 c = 0; c < m_data->size(); ++c )
+	{
+		raw_data_channel_creator channel( m_data, c );
 		const data_descriptor&  desc    = channel.descriptor();
 		uint8* raw_data = channel.raw_data();
@@ -173,5 +175,5 @@
 	size_t n_offset = 0;
 	if ( ch_n == -1 ) return;
-	raw_data_channel_creator channel( m_data->m_channels[ unsigned( ch_n ) ] );
+	raw_data_channel_creator channel( m_data, unsigned( ch_n ) );
 	for ( const auto& cslot : channel.descriptor() )
 		if ( cslot.vslot == slot::NORMAL )
@@ -201,5 +203,5 @@
 	const raw_data_channel* i_channel = nullptr;
 
-	for ( uint32 c = 0; c < m_data->get_channel_count(); ++c )
+	for ( uint32 c = 0; c < m_data->size(); ++c )
 	{
 		const raw_data_channel* channel = m_data->get_channel(c);
@@ -219,5 +221,5 @@
 				{
 					n_offset  = int( cslot.offset );
-					n_channel = m_data->m_channels[ c ];
+					n_channel = data_channel_set_creator( m_data )[ c ];
 					n_channel_index = c;
 				}
@@ -331,9 +333,9 @@
 	delete tangents2;
 
-	m_data->m_channels[ n_channel_index ] = merge_channels( n_channel, g_channel.channel() );
+	( data_channel_set_creator( m_data ))[ n_channel_index ] = merge_channels( n_channel, g_channel.channel() );
 	delete n_channel;
 }
 
-nv::raw_data_channel* nv::mesh_data_creator::merge_channels( raw_data_channel* a, raw_data_channel* b )
+nv::raw_data_channel* nv::mesh_data_creator::merge_channels( const raw_data_channel* a, const raw_data_channel* b )
 {
 	NV_ASSERT( a->size() == b->size(), "merge_channel - bad channels!" );
@@ -351,5 +353,5 @@
 }
 
-nv::raw_data_channel* nv::mesh_data_creator::append_channels( raw_data_channel* a, raw_data_channel* b, uint32 frame_count )
+nv::raw_data_channel* nv::mesh_data_creator::append_channels( const raw_data_channel* a, const raw_data_channel* b, uint32 frame_count )
 {
 	if ( a->descriptor() != b->descriptor() ) return nullptr;
@@ -389,6 +391,6 @@
 bool nv::mesh_data_creator::is_same_format( mesh_data* other )
 {
-	if ( m_data->get_channel_count() != other->get_channel_count() ) return false;
-	for ( uint32 c = 0; c < m_data->get_channel_count(); ++c )
+	if ( m_data->size() != other->size() ) return false;
+	for ( uint32 c = 0; c < m_data->size(); ++c )
 	{
 		if ( m_data->get_channel(c)->descriptor() != other->get_channel(c)->descriptor() )
@@ -406,18 +408,20 @@
 	int och_ti = other->get_channel_index( slot::TEXCOORD );
 	if ( ch_pi == -1 || ch_ti == -1 ) return;
-	size_t size   = m_data->m_channels[ unsigned(ch_ti) ]->size();
-	size_t osize  =  other->m_channels[ unsigned(och_ti) ]->size();
-	size_t count  = m_data->m_channels[ unsigned(ch_pi) ]->size();
-	size_t ocount =  other->m_channels[ unsigned(och_pi) ]->size();
+	size_t size   = m_data->get_channel_size( unsigned(ch_ti) );
+	size_t osize  =  other->get_channel_size( unsigned(och_ti) );
+	size_t count  = m_data->get_channel_size( unsigned(ch_pi) );
+	size_t ocount =  other->get_channel_size( unsigned(och_pi) );
 	if ( count % size != 0 || ocount % osize != 0 ) return;
 	if ( count / size != ocount / osize ) return;
 	
-	for ( uint32 c = 0; c < m_data->get_channel_count(); ++c )
-	{
-		raw_data_channel* old = m_data->m_channels[c];
+	data_channel_set_creator data( m_data );
+
+	for ( uint32 c = 0; c < m_data->size(); ++c )
+	{
+		const raw_data_channel* old = m_data->get_channel( c );
 		bool old_is_index = old->size() > 0 && old->descriptor()[0].vslot == slot::INDEX;
 		size_t frame_count = ( old_is_index ? 1 : old->size() / size );
-		m_data->m_channels[c] = append_channels( old, other->m_channels[c], frame_count );
-		NV_ASSERT( m_data->m_channels[c], "Merge problem!" );
+		data[c] = append_channels( old, other->get_channel(c), frame_count );
+		NV_ASSERT( data[c], "Merge problem!" );
 		if ( old_is_index )
 		{
@@ -427,5 +431,5 @@
 				{
 					NV_ASSERT( size + osize < uint16(-1), "Index out of range!" );
-					raw_data_channel_creator ic( m_data->m_channels[c] );
+					raw_data_channel_creator ic( data[c] );
 					uint16* indexes = reinterpret_cast<uint16*>( ic.raw_data() );
 					for ( uint16 i = uint16( old->size() ); i < ic.size(); ++i )
@@ -436,5 +440,5 @@
 			case UINT   : 
 				{
-					raw_data_channel_creator ic( m_data->m_channels[c] );
+					raw_data_channel_creator ic( data[c] );
 					uint32* indexes = reinterpret_cast<uint32*>( ic.raw_data() );
 					for ( uint32 i = old->size(); i < ic.size(); ++i )
@@ -444,7 +448,16 @@
 			default : NV_ASSERT( false, "Unsupported index type!" ); break;
 			}
-			m_data->m_index_channel = m_data->m_channels[c];
 		}
 		delete old;
 	}
 }
+
+void nv::mesh_creator::delete_mesh( uint32 index )
+{
+	if ( index < m_pack->get_count() )
+	{
+		data_channel_set_creator( &m_pack->m_meshes[index] ).destroy();
+		data_channel_set_creator( &m_pack->m_meshes[m_pack->m_count - 1] ).move_to( m_pack->m_meshes[index] );
+		m_pack->m_count--;
+	}
+}
Index: trunk/src/gfx/skeletal_mesh.cc
===================================================================
--- trunk/src/gfx/skeletal_mesh.cc	(revision 415)
+++ trunk/src/gfx/skeletal_mesh.cc	(revision 416)
@@ -27,11 +27,11 @@
 
 	m_vtx_data  = a_mesh_data->get_channel_data<md5_vtx_pntiw>();
-	m_indices   = a_mesh_data->get_count();
+	m_indices   = a_mesh_data->get_channel_size( slot::INDEX );
 	m_va        = a_context->create_vertex_array();
 
-	array_view< raw_data_channel* > channels = a_mesh_data->get_raw_channels();
-	for ( uint32 ch = 0; ch < channels.size(); ++ch )
-	{
-		const raw_data_channel* channel = channels[ch];
+	//array_view< raw_data_channel* > channels = a_mesh_data->get_raw_channels();
+	for ( auto channel : *a_mesh_data )
+	{
+		//const raw_data_channel* channel = channels[ch];
 		if ( channel->size() > 0 && channel != pntiw_chan )
 		{
@@ -218,5 +218,5 @@
 {
 	m_va          = a_context->create_vertex_array( a_mesh, nv::STATIC_DRAW );
-	m_index_count = a_mesh->get_count();
+	m_index_count = a_mesh->get_channel_size( slot::INDEX );
 	if ( m_bone_data )
 	{
