From 8996184ac4e96af4c7e2e46d3f836c962ccdb0b0 Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Tue, 12 Feb 2013 17:52:18 +0000 Subject: Fixed importing of shapekey names: name is now taken from geometry name instead of deriving it from the mesh name --- source/blender/collada/MeshImporter.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source/blender/collada/MeshImporter.cpp') diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index bf5a39cfae8..26915f37002 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -952,6 +952,13 @@ Mesh *MeshImporter::get_mesh_by_geom_uid(const COLLADAFW::UniqueId& mesh_uid) return NULL; } +std::string *MeshImporter::get_geometry_name(const std::string &mesh_name) +{ + if (this->mesh_geom_map.find(mesh_name) != this->mesh_geom_map.end()) + return &this->mesh_geom_map[mesh_name]; + return NULL; +} + MTex *MeshImporter::assign_textures_to_uvlayer(COLLADAFW::TextureCoordinateBinding &ctexture, Mesh *me, TexIndexTextureArrayMap& texindex_texarray_map, MTex *color_texture) @@ -1300,7 +1307,9 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry *geom) // store the Mesh pointer to link it later with an Object this->uid_mesh_map[mesh->getUniqueId()] = me; - + // needed to map mesh to its geometry name (needed for shape key naming) + this->mesh_geom_map[std::string(me->id.name)] = str_geom_id; + int new_tris = 0; read_vertices(mesh, me); -- cgit v1.2.3