Fix #136098: Impossible to select of pose bones when in Weight Paint mode

This was caused by the select_id not being flushed to
the armature object.

This is because the selection code uses `FOREACH_OBJECT_IN_MODE_BEGIN`
to iterate over the objects. This doesn't call the depsgraph
which would, in normal circumstances, flush the select_id value
to the evaluated object.

Also fix #136141

Pull Request: https://projects.blender.org/blender/blender/pulls/136320
This commit is contained in:
Clément Foucault
2025-03-21 18:15:23 +01:00
committed by Clément Foucault
parent 463ea020e4
commit 32fe65dc9b

View File

@@ -1700,6 +1700,10 @@ void DRW_draw_select_loop(Depsgraph *depsgraph,
draw_ctx.engines_init_and_sync([&](DupliCacheManager &duplis, ExtractionGraph &extraction) {
if (use_obedit) {
FOREACH_OBJECT_IN_MODE_BEGIN (scene, view_layer, v3d, object_type, object_mode, ob_iter) {
/* Depsgraph usually does this, but we use a different iterator.
* So we have to do it manually. */
ob_iter->runtime->select_id = DEG_get_original_object(ob_iter)->runtime->select_id;
blender::draw::ObjectRef ob_ref(ob_iter);
drw_engines_cache_populate(ob_ref, extraction);
}