Weight transfer was not checking the source mesh for edges and faces, even when using edge and face mappings. This caused a segfault when selecting one of those mappings with a source mesh with zero faces or edges. This diff adds checks to see if the mesh has the required geometry, and reports an error if it doesn't.
Details
Diff Detail
- Repository
- rB Blender
Event Timeline
| source/blender/blenkernel/intern/data_transfer.c | ||
|---|---|---|
| 1216–1217 | Let’s stick to the word 'polygon', as in the other error messages here. | |
| 1268–1273 | Not needed, number of edges in src and dst is checked below anyway. | |
| 1276–1277 | Let’s stick to the word 'polygon', as in the other error messages here. | |
| 1345–1350 | Not needed, number of polys in src and dst is checked below anyway. | |
| 1415–1420 | Not needed, number of polys in src and dst is checked below anyway. | |
Regarding the redundant checks, I added those to provide better error messages in those circumstances, however, looking at it again, they don't really seem better at all, so I'll remove them.
Regarding the use of "faces" instead of "polygons", I was aiming for consistency with the UI, where they are referred to as "faces" in the mappings and whatnot. I think it would be strange for the user to be warned he can't use one of the "face" mappings because the mesh doesn't have any "polygons". So perhaps it would be better to instead change the existing error messages to say "faces" too, what do you think?