Index: trunk/src/gfx/mesh_creator.cc
===================================================================
--- trunk/src/gfx/mesh_creator.cc	(revision 410)
+++ trunk/src/gfx/mesh_creator.cc	(revision 411)
@@ -19,6 +19,6 @@
 		key_data* keys   = m_data->m_nodes[i].data;
 		key_data* pkeys  = ( parent_id != -1 ? m_data->m_nodes[parent_id].data : nullptr );
-		size_t count     = ( keys ? keys->get_channel(0)->count : 0 );
-		size_t pcount    = ( pkeys ? pkeys->get_channel(0)->count : 0 );
+		size_t count     = ( keys ? keys->get_channel(0)->element_count() : 0 );
+		size_t pcount    = ( pkeys ? pkeys->get_channel(0)->element_count() : 0 );
 		max_frames = nv::max<uint32>( count, max_frames );
 		if ( pkeys && pkeys->get_channel_count() > 0 && keys && keys->get_channel_count() > 0 )
@@ -66,5 +66,5 @@
 			}
 
-			key_raw_channel* raw_channel = key_raw_channel::create<nv_key_transform>( max_keys );
+			raw_data_channel* raw_channel = raw_data_channel::create<nv_key_transform>( max_keys );
 			key_data* new_keys = new key_data;
 			new_keys->add_channel( raw_channel );
@@ -80,5 +80,5 @@
 				{
 					size_t idx = nv::min( old_keys->get_channel(c)->count - 1, n );
-					pkey += old_keys->get_channel(c)->get_raw( idx, pkey );
+					pkey += old_keys->get_raw( old_keys->get_channel(c), idx, pkey );
 				}
 				channel[n].tform = extract_transform_raw( final_key, key );
@@ -106,5 +106,5 @@
 			for ( size_t c = 0; c < kdata->get_channel_count(); ++c )
 			{
-				const key_raw_channel* channel = kdata->get_channel(c);
+				const raw_data_channel* channel = kdata->get_channel(c);
 				size_t key_size = channel->desc.element_size();
 				for ( size_t n = 0; n < channel->count; ++n )
@@ -125,5 +125,5 @@
 	for ( uint32 c = 0; c < m_data->get_channel_count(); ++c )
 	{
-		const mesh_raw_channel* channel = m_data->get_channel(c);
+		const raw_data_channel* channel = m_data->get_channel(c);
 		const data_descriptor&  desc    = channel->desc;
 		uint8* raw_data = channel->data;
@@ -173,5 +173,5 @@
 	size_t n_offset = 0;
 	if ( ch_n == -1 ) return;
-	mesh_raw_channel* channel = m_data->m_channels[ unsigned( ch_n ) ];
+	raw_data_channel* channel = m_data->m_channels[ unsigned( ch_n ) ];
 	for ( const auto& cslot : channel->desc )
 		if ( cslot.vslot == slot::NORMAL )
@@ -196,12 +196,12 @@
 	uint32 n_channel_index = 0;
 
-	const mesh_raw_channel* p_channel = nullptr;
-	      mesh_raw_channel* n_channel = nullptr;
-	const mesh_raw_channel* t_channel = nullptr;
-	const mesh_raw_channel* i_channel = nullptr;
+	const raw_data_channel* p_channel = nullptr;
+	      raw_data_channel* n_channel = nullptr;
+	const raw_data_channel* t_channel = nullptr;
+	const raw_data_channel* i_channel = nullptr;
 
 	for ( uint32 c = 0; c < m_data->get_channel_count(); ++c )
 	{
-		const mesh_raw_channel* channel = m_data->get_channel(c);
+		const raw_data_channel* channel = m_data->get_channel(c);
 
 		for ( const auto& cslot : channel->desc )
@@ -247,5 +247,5 @@
 	}
 
-	mesh_raw_channel* g_channel = mesh_raw_channel::create<vertex_g>( p_channel->count );
+	raw_data_channel* g_channel = raw_data_channel::create<vertex_g>( p_channel->count );
 	vec4* tangents              = reinterpret_cast<vec4*>( g_channel->data );
 	vec3* tangents2             = new vec3[ p_channel->count ];
@@ -334,5 +334,5 @@
 }
 
-nv::mesh_raw_channel* nv::mesh_data_creator::merge_channels( mesh_raw_channel* a, mesh_raw_channel* b )
+nv::raw_data_channel* nv::mesh_data_creator::merge_channels( raw_data_channel* a, raw_data_channel* b )
 {
 	NV_ASSERT( a->count == b->count, "merge_channel - bad channels!" );
@@ -352,5 +352,5 @@
 		raw_copy_n( b->data + i * bdesc.element_size(), bdesc.element_size(), data + i*desc.element_size() + adesc.element_size() );
 	}
-	mesh_raw_channel* result = new mesh_raw_channel;
+	raw_data_channel* result = new raw_data_channel;
 	result->count = count;
 	result->desc  = desc;
@@ -359,5 +359,5 @@
 }
 
-nv::mesh_raw_channel* nv::mesh_data_creator::append_channels( mesh_raw_channel* a, mesh_raw_channel* b, uint32 frame_count )
+nv::raw_data_channel* nv::mesh_data_creator::append_channels( raw_data_channel* a, raw_data_channel* b, uint32 frame_count )
 {
 	if ( a->desc != b->desc ) return nullptr;
@@ -391,7 +391,7 @@
 	}
 
-	mesh_raw_channel* result = new mesh_raw_channel;
-	result->count = a->count + b->count;
-	result->desc  = a->desc;
+	raw_data_channel* result = new raw_data_channel;
+	result->count = a->element_count() + b->element_count();
+	result->desc  = a->descriptor();
 	result->data  = data;
 	return result;
@@ -405,5 +405,5 @@
 	for ( uint32 c = 0; c < m_data->get_channel_count(); ++c )
 	{
-		if ( m_data->get_channel(c)->desc != other->get_channel(c)->desc )
+		if ( m_data->get_channel(c)->descriptor() != other->get_channel(c)->descriptor() )
 			return false;
 	}
@@ -419,8 +419,8 @@
 	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) ]->count;
-	size_t osize  =  other->m_channels[ unsigned(och_ti) ]->count;
-	size_t count  = m_data->m_channels[ unsigned(ch_pi) ]->count;
-	size_t ocount =  other->m_channels[ unsigned(och_pi) ]->count;
+	size_t size   = m_data->m_channels[ unsigned(ch_ti) ]->element_count();
+	size_t osize  =  other->m_channels[ unsigned(och_ti) ]->element_count();
+	size_t count  = m_data->m_channels[ unsigned(ch_pi) ]->element_count();
+	size_t ocount =  other->m_channels[ unsigned(och_pi) ]->element_count();
 	if ( count % size != 0 || ocount % osize != 0 ) return;
 	if ( count / size != ocount / osize ) return;
@@ -428,6 +428,6 @@
 	for ( uint32 c = 0; c < m_data->get_channel_count(); ++c )
 	{
-		mesh_raw_channel* old = m_data->m_channels[c];
-		size_t frame_count = ( old->get_buffer_type() == INDEX_BUFFER ? 1 : old->count / size );
+		raw_data_channel* old = m_data->m_channels[c];
+		size_t frame_count = ( old->get_buffer_type() == INDEX_BUFFER ? 1 : old->element_count() / size );
 		m_data->m_channels[c] = append_channels( old, other->m_channels[c], frame_count );
 		NV_ASSERT( m_data->m_channels[c], "Merge problem!" );
@@ -440,5 +440,5 @@
 					NV_ASSERT( size + osize < uint16(-1), "Index out of range!" );
 					uint16* indexes = reinterpret_cast<uint16*>( m_data->m_channels[c]->data );
-					for ( uint16 i = uint16( old->count ); i < m_data->m_channels[c]->count; ++i )
+					for ( uint16 i = uint16( old->element_count() ); i < m_data->m_channels[c]->element_count(); ++i )
 						indexes[i] += uint16( size );
 
@@ -448,5 +448,5 @@
 				{
 					uint32* indexes = reinterpret_cast<uint32*>( m_data->m_channels[c]->data );
-					for ( uint32 i = old->count; i < m_data->m_channels[c]->count; ++i )
+					for ( uint32 i = old->element_count(); i < m_data->m_channels[c]->element_count(); ++i )
 						indexes[i] += size;
 				}
