Blender Git Loki
Git Commits -> Revision 7f28938
Revision 7f28938 by Ankit Meel (soc-2020-io-performance) August 9, 2020, 14:22 (GMT) |
Move index offset from parsing to Object creation The only place where the information needed about how many vertices have been occupied by other objects is `mloop->v` since `v` has to be in the range from zero to total vertices _in a_ mesh. All other indices (edge, UV, normal) work best when they're parsed the way they're written and the corresponding data from the global list is read directly. So instead of modifying every index just to keep `mloop->v` happy, use a `Map<int, int>` for storing vertex indices. This reduces chances of error greatly and avoid "indices to indices to coordinates". `Vector` would've been very slow it being unsorted & lookups being done for _all_ `mloop`s. `Map` gives no drop in performance. UV vertices from `Geometry` have been removed since `FaceCorner`s store a direct index indexing into the Global list of UV coordinates. |
Commit Details:
Full Hash: 7f2893848ec9b31e35c51058ba12065c5fbefaf3
Parent Commit: 8598993
Lines Changed: +67, -114
6 Modified Paths:
/source/blender/io/wavefront_obj/intern/wavefront_obj_importer.cc (+6, -8) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_file_reader.cc (+13, -40) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_file_reader.hh (+0, -9) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.cc (+14, -18) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_objects.cc (+8, -23) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_objects.hh (+26, -16) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_file_reader.cc (+13, -40) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_file_reader.hh (+0, -9) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_mesh.cc (+14, -18) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_objects.cc (+8, -23) (Diff)
/source/blender/io/wavefront_obj/intern/wavefront_obj_im_objects.hh (+26, -16) (Diff)