Armature: temp workaround for crash caused by custom bone drawing
authorClément Foucault <foucault.clem@gmail.com>
Tue, 18 Dec 2018 12:07:33 +0000 (13:07 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Tue, 18 Dec 2018 12:08:17 +0000 (13:08 +0100)
source/blender/draw/intern/draw_armature.c

index b8b53fbbb788d1321ad83939ac197e8b311bfd3e..3837daadd02b1afdd4c06eb59cfe17e621c5d366 100644 (file)
@@ -318,6 +318,8 @@ static void drw_shgroup_bone_envelope(
 
 /* Custom (geometry) */
 
+extern void drw_batch_cache_generate_requested(Object *custom);
+
 static void drw_shgroup_bone_custom_solid(
         const float (*bone_mat)[4],
         const float bone_color[4], const float hint_color[4], const float outline_color[4],
@@ -329,6 +331,9 @@ static void drw_shgroup_bone_custom_solid(
        struct GPUBatch *ledges = DRW_cache_object_loose_edges_get(custom);
        float final_bonemat[4][4];
 
+       /* XXXXXXX needs to be moved elsewhere. */
+       drw_batch_cache_generate_requested(custom);
+
        if (surf || edges || ledges) {
                mul_m4_m4m4(final_bonemat, g_data.ob->obmat, bone_mat);
        }