diff options
author | Hans Goudey <h.goudey@me.com> | 2021-11-24 18:40:13 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-11-24 18:40:13 +0300 |
commit | 4930cd5db6153d6fd40481ea1be0f5cb33d46466 (patch) | |
tree | aec5acfc667a566f8121048457de6745cac4e45f /source/blender/draw/engines | |
parent | 7a97e925fde585ffafd7bdfe310d161cb6d51bc1 (diff) | |
parent | a07089dcb10d8f0265220bf5abe07dca03097fe1 (diff) |
Merge branch 'blender-v3.0-release'
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_armature.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_armature.c b/source/blender/draw/engines/overlay/overlay_armature.c index 1da682ff01b..50d8fe3065d 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.c +++ b/source/blender/draw/engines/overlay/overlay_armature.c @@ -26,6 +26,7 @@ #include "DNA_armature_types.h" #include "DNA_constraint_types.h" +#include "DNA_mesh_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_view3d_types.h" @@ -39,6 +40,7 @@ #include "BKE_armature.h" #include "BKE_deform.h" #include "BKE_modifier.h" +#include "BKE_object.h" #include "DEG_depsgraph_query.h" @@ -52,6 +54,8 @@ #include "overlay_private.h" +#include "draw_cache_impl.h" + #define BONE_VAR(eBone, pchan, var) ((eBone) ? (eBone->var) : (pchan->var)) #define BONE_FLAG(eBone, pchan) ((eBone) ? (eBone->flag) : (pchan->bone->flag)) @@ -535,13 +539,22 @@ static void drw_shgroup_bone_custom_solid(ArmatureDrawContext *ctx, const float outline_color[4], Object *custom) { + /* The custom object is not an evaluated object, so its object->data field hasn't been replaced + * by #data_eval. This is bad since it gives preference to an object's evaluated mesh over any + * other data type, but supporting all evaluated geometry components would require a much larger + * refactor of this area. */ + 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); + DRW_mesh_batch_cache_validate(mesh); - struct GPUBatch *surf = DRW_cache_object_surface_get(custom); - struct GPUBatch *edges = DRW_cache_object_edge_detection_get(custom, NULL); - struct GPUBatch *ledges = DRW_cache_object_loose_edges_get(custom); + struct GPUBatch *surf = DRW_mesh_batch_cache_get_surface(mesh); + struct GPUBatch *edges = DRW_mesh_batch_cache_get_edge_detection(mesh, NULL); + struct GPUBatch *ledges = DRW_mesh_batch_cache_get_loose_edges(mesh); BoneInstanceData inst_data; DRWCallBuffer *buf; |