diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-02 05:16:18 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-02 05:16:18 +0300 |
commit | 594656e7a39d3598d7a357511742fb0b001254bc (patch) | |
tree | 9f852a7c1569510fcb05c0c0f77de8a69ba03702 /source/blender/draw/engines | |
parent | 9cec9b4d6e33e2270baa8b94454b16665a8f2f60 (diff) |
Fix T93525: Crash with curve/text armature bone gizmo
The problem is that drw_batch_cache_generate_requested_delayed
is called on the object, which uses the original object data type to
choose which data type to get info for. So for curves and text it uses
the incorrect type (not the evaluated mesh like we hardcoded in the
armature overlay code).
To fix this I hardcoded the "delayed" generation to only use the
evaluated mesh. Luckily it wasn't use elsewhere besides this
armature overlay system. That seems like the simplest fix for
3.0. A proper solution should rewrite this whole area anyway.
Differential Revision: https://developer.blender.org/D13439
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_armature.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c index 50d8fe3065d..cc12f097526 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.c +++ b/source/blender/draw/engines/overlay/overlay_armature.c @@ -591,12 +591,16 @@ static void drw_shgroup_bone_custom_wire(ArmatureDrawContext *ctx, const float color[4], Object *custom) { + /* See comments in #drw_shgroup_bone_custom_solid. */ + Mesh *mesh = BKE_object_get_evaluated_mesh(custom); + if (mesh == NULL) { + return; + } /* TODO(fclem): arg... less than ideal but we never iter on this object * to assure batch cache is valid. */ - drw_batch_cache_validate(custom); - - struct GPUBatch *geom = DRW_cache_object_all_edges_get(custom); + DRW_mesh_batch_cache_validate(mesh); + struct GPUBatch *geom = DRW_mesh_batch_cache_get_all_edges(mesh); if (geom) { DRWCallBuffer *buf = custom_bone_instance_shgroup(ctx, ctx->custom_wire, geom); BoneInstanceData inst_data; |