as processPerVertexIndex(color_index) will default to returning faces for that case (as the color_index is empty), we can save the function call and provide the faces directly.
Now the code is able to:
- rebuild colorIndex field if -1 face end markers are not matching with coordIndex
- use regular index position if no colorIndex is given
- handling vertex colors for both cases (with/without colorIndex)
Usually .wrl files with vertex colors have and colorIndex Field with -1 values as face end markers.
In the original issue file no colorIndex Field was present, thus we check for 0 length, in which case a regular index count gets used. Now both issue file and correct file should import and display correctly.
However to further bulletproof things, we should also check for invalid colorIndexes (without correct number of -1s), this still has to be done.
fixes blender/blender-addons#101604 by using the index position instead of the actual vertex value to access the rgb list.
Now the file from mentioned issue can get imported, however in rendered view the colors are still missing. But that should probably be another issue, as it seems unrelated.