Browse Source

FIX: ColladaLoader now ignores missing 'meter' attribute in Collada files produced by C4D. Adding a c4ddae test file. Thanks to Tobias Rittig to point it out.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@483 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
aramis_acg 16 years ago
parent
commit
1452a7a83d
3 changed files with 49 additions and 2 deletions
  1. 3 0
      CREDITS
  2. 7 2
      code/ColladaParser.cpp
  3. 39 0
      test/models/Collada/Cinema4D.dae

+ 3 - 0
CREDITS

@@ -64,3 +64,6 @@ Contributed several bugfixes fixing memory leaks and improving float parsing
 
 - sueastside
 Updated PyAssimp to the latest Assimp data structures and provided a script to keep the Python binding up-to-date.
+
+- Tobias Rittig
+Collada testing with Cinema 4D

+ 7 - 2
code/ColladaParser.cpp

@@ -202,8 +202,13 @@ void ColladaParser::ReadAssetInfo()
 			if( IsElement( "unit"))
 			{
 				// read unit data from the element's attributes
-				int attrIndex = GetAttribute( "meter");
-				mUnitSize = mReader->getAttributeValueAsFloat( attrIndex);
+				const int attrIndex = TestAttribute( "meter");
+				if (attrIndex == -1) {
+					mUnitSize = 1.f;
+				}
+				else {
+					mUnitSize = mReader->getAttributeValueAsFloat( attrIndex);
+				}
 
 				// consume the trailing stuff
 				if( !mReader->isEmptyElement())

File diff suppressed because it is too large
+ 39 - 0
test/models/Collada/Cinema4D.dae


Some files were not shown because too many files changed in this diff