Index: /trunk/src/formats/assimp_loader.cc
===================================================================
--- /trunk/src/formats/assimp_loader.cc	(revision 277)
+++ /trunk/src/formats/assimp_loader.cc	(revision 278)
@@ -87,4 +87,5 @@
 
 	mat3 scaled_rotatation = glm::mat3( glm::scale( m_scale, m_scale, m_scale ) * m_rotate_transform );
+	//mat3 scaled_rotatation = glm::mat3( m_rotate_transform );
 	vec3 vertex_offset     = glm::vec3(); 
 	mat3 vertex_transform  = scaled_rotatation;
@@ -169,10 +170,11 @@
 	if ( mesh->mNumBones == 0 ) return false;
 
-	mat4 bone_transform    = glm::inverse( glm::scale( m_scale, m_scale, m_scale ) * glm::mat4(m_rotate_transform) ); //glm::scale( 1.f/m_scale, 1.f/m_scale, 1.f/m_scale ) * m_rotate_transform;
+	mat4 bone_transform    = glm::scale( 1.f/m_scale, 1.f/m_scale, 1.f/m_scale ) *  glm::inverse( glm::mat4(m_rotate_transform) ); 
+	mat4 bone_pre_transform    = glm::scale( m_scale, m_scale, m_scale );
 
 	for (unsigned int m=0; m<mesh->mNumBones; m++)
 	{
 		aiBone* bone   = mesh->mBones[m];
-		mat4    offset = assimp_mat4_cast( bone->mOffsetMatrix ) * bone_transform;
+		mat4    offset = bone_pre_transform * assimp_mat4_cast( bone->mOffsetMatrix ) * bone_transform;
 		bones.emplace_back( bone->mName.data, offset );
 	}
@@ -211,5 +213,5 @@
 			aiMesh* mesh = scene->mMeshes[mc];
 
-			NV_LOG( nv::LOG_NOTICE, "Mesh #"<<mc<<"   - " << mesh->mName.data );
+			NV_LOG( nv::LOG_NOTICE, "Mesh #"<<mc<<"   - " << std::string( mesh->mName.data ) );
 			NV_LOG( nv::LOG_NOTICE, "  bones   - " << mesh->mNumBones );
 			NV_LOG( nv::LOG_NOTICE, "  uvs     - " << mesh->mNumUVComponents[0] );
@@ -329,5 +331,5 @@
 
 	load_node( result, root, 0, -1 );
-	result->nodes[0].transform = glm::scale( m_scale, m_scale, m_scale ) * result->nodes[0].transform;
+	// TODO: this is not used when pretransformed, is it used otherwise?
 
 	if ( bone_data )
@@ -422,5 +424,6 @@
 		nv::vec3 pos = nv::assimp_vec3_cast(node->mPositionKeys[pn].mValue);
 		nv::quat rot = nv::assimp_quat_cast(node->mRotationKeys[rn].mValue);
-		nv::transform ptr;
+		// TODO: only do the calculation when a rotate transform is present!
+		nv::transform ptr( vec3(), glm::quat_cast( m_rotate_transform ) );
 		if ( parent_keys )
 		{
@@ -428,9 +431,6 @@
 			if ( pv && pv->size() > 0 ) ptr = pv->get( glm::min( n, pv->size()-1 ) );
 		}
-
-		nv::vec3 rot_pos = ptr.get_orientation() * pos;
-		pos = ptr.get_position() + rot_pos;
-		rot = glm::normalize( ptr.get_orientation() * rot );
-		keys->insert( nv::transform( pos, rot ) );
+		nv::transform key( ptr * nv::transform( pos * m_scale, rot ) );
+		keys->insert( key );
 	}
 	return keys;
@@ -439,4 +439,5 @@
 key_animation_data* nv::assimp_loader::create_direct_keys( const void* vnode )
 {
+	// TODO : support for m_rotate_transform and m_scale! ( should be easy )
 	const aiNodeAnim* node = (const aiNodeAnim*)vnode;
 	if ( node->mNumPositionKeys == 0 && node->mNumRotationKeys == 0 && node->mNumScalingKeys == 0 ) return nullptr;
@@ -445,5 +446,5 @@
 	for ( unsigned np = 0; np < node->mNumPositionKeys; ++np )
 	{
-		keys->insert_position( (float)node->mPositionKeys[np].mTime, assimp_vec3_cast(node->mPositionKeys[np].mValue) );
+		keys->insert_position( (float)node->mPositionKeys[np].mTime, m_scale * assimp_vec3_cast(node->mPositionKeys[np].mValue) );
 	}
 	for ( unsigned np = 0; np < node->mNumRotationKeys; ++np )
