fix list index out of range for color_per_vertex #2

Merged
Cedric Steiert merged 5 commits from Bujus_Krachus/io_scene_x3d:fix-list-index-out-of-range-vertex-color into main 2024-08-06 17:19:38 +02:00

5 Commits

Author SHA1 Message Date
BujusKrachus
b566bb6c87 Merge branch 'main' into fix-list-index-out-of-range-vertex-color 2024-08-06 17:16:04 +02:00
0f47714f59 simplify code for case Color per vertex without index
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.
2024-08-04 23:19:45 +02:00
e8e3c6454c add colorIndex valid check and rebuild option for face end markers
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)
2024-07-20 17:28:36 +02:00
6cb7049fa3 fix detection of working wrl files
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.
2024-07-20 17:02:18 +02:00
9b74290f68 fix list index out of range for color_per_vertex
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.
2024-07-19 22:17:40 +02:00