LightsprintSDK 2021.08.08
FCollada patch

We contribute our improvements back to original projects, however, FCollada is no longer actively developed. (Other patches exist, e.g. http://o3d.googlecode.com/svn/trunk/googleclient/third_party/fcollada/README.google)

Precompiled FCollada 3.05B in Lightsprint SDK includes our bugfix:

Fix1

File: FCollada/FUtils/FUUniqueStringMap.cpp

// this is original fcollada 3.05b code,
// it splits "a1" and "a01" to {"a",1}, failing in documents with a1 and a01 materials
//while (len > 0 && prefix[len-1] >= '0' && prefix[len-1] <= '9')
//{
// prefix.erase(len-1, len);
// --len;
//}
// this Lightsprint patch splits "a1" to {"a",1}, "a01" to {"a0",1}
size_t fullLen = len;
size_t goodLen = len;
while (len > 0 && prefix[len-1] >= '0' && prefix[len-1] <= '9')
{
if (len == fullLen || prefix[len-1] != '0') goodLen = len-1;
--len;
}
prefix.erase(goodLen, len);

Test case. Patched Fcollada opens it without errors, original FCollada reports errors:

<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<library_effects>
<effect id="a01">
</effect>
<effect id="a1">
</effect>
</library_effects>
<library_materials>
<material id="a1-material" name="a1-material">
<instance_effect url="#a1"/>
</material>
</library_materials>
</COLLADA>