The Collada dae importer was not accounting for geometries that used inputs with shared offset values and assumed that there are always as many indices per facePoint as there were inputs.
This was causing the decoder to read/write vertices and indices to/from the wrong memory addresses, which can cause undefined behavior.
This means there are 3 index values for each face point, but the parser assumed there's 4 since there's 4 inputs.
The first triangle in this list would be pulling positions from index 287, 1, and 2 when it should be pulling from index 287, 288, and 286
This code change should help BC from silently crashing/creating garbled models when importing some dae files that would otherwise work in other tools.
Note: The dae files that ran into this issue were exported from blender 3.6.
This code has been tested and confirmed working with 2 dae files that were known to be working prior to this change.
It has not been tested against any files that contain vertex colors.
Looks good to me. I have a stable build I need to get released but will merge in once I get the last critical fix in for that, to allow some time for those on Canary to test properly
The Collada dae importer was not accounting for geometries that used inputs with shared offset values and assumed that there are always as many indices per facePoint as there were inputs.
This was causing the decoder to read/write vertices and indices to/from the wrong memory addresses, which can cause undefined behavior.
For example, if the geometry had the below inputs
This means there are 3 index values for each face point, but the parser assumed there's 4 since there's 4 inputs. The first triangle in this list would be pulling positions from index 287, 1, and 2 when it should be pulling from index 287, 288, and 286
This code change should help BC from silently crashing/creating garbled models when importing some dae files that would otherwise work in other tools.
Note: The dae files that ran into this issue were exported from blender 3.6. This code has been tested and confirmed working with 2 dae files that were known to be working prior to this change. It has not been tested against any files that contain vertex colors.