From 7bd050e431b5fbd8f931535364a7c9d03df8a0fb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 22 May 2013 11:06:12 +0000 Subject: [PATCH] From Jan Ciger, "Here is a little patch to fix a bug in the InfluenceMap serialization. The names of the maps weren't quoted properly and therefore it was breaking loading of rigged models exported from e.g. Blender. Also names that contained spaces wouldn't have been parsed properly. " --- src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp b/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp index 85ac93280..f556282a5 100644 --- a/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp +++ b/src/osgWrappers/serializers/osgAnimation/RigGeometry.cpp @@ -16,7 +16,9 @@ static bool readInfluenceMap( osgDB::InputStream& is, osgAnimation::RigGeometry& { std::string name; unsigned int viSize = 0; - is >> is.PROPERTY("VertexInfluence") >> name; viSize = is.readSize(); is >> is.BEGIN_BRACKET; + is >> is.PROPERTY("VertexInfluence"); + is.readWrappedString(name); + viSize = is.readSize(); is >> is.BEGIN_BRACKET; osgAnimation::VertexInfluence vi; vi.setName( name ); @@ -48,7 +50,9 @@ static bool writeInfluenceMap( osgDB::OutputStream& os, const osgAnimation::RigG const osgAnimation::VertexInfluence& vi = itr->second; if ( name.empty() ) name = "Empty"; - os << os.PROPERTY("VertexInfluence") << name; os.writeSize(vi.size()) ; os << os.BEGIN_BRACKET << std::endl; + os << os.PROPERTY("VertexInfluence"); + os.writeWrappedString(name); + os.writeSize(vi.size()) ; os << os.BEGIN_BRACKET << std::endl; for ( osgAnimation::VertexInfluence::const_iterator vitr=vi.begin(); vitr != vi.end(); ++vitr )