Page MenuHome

Fix T66668: frame selected bone not working in weight paint mode
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Jul 12 2019, 9:59 AM.

Details

Summary

'viewselected_exec()' [which uses evaluated view layer] would query BASE_SELECTED flag, but it was not set on base_eval, but on its base_orig.

reason for this is 'ed_object_select_pick()' [or even more generally 'view3d_select_exec()'] would modify base flags [through 'ED_object_base_select()' etc], but not tag scene ID_RECALC_BASE_FLAGS.

thx @Sergey Sharybin (sergey) for hinting.

(still I am unsure how costly recalculating base flags really is, so I proposed 3 possible places for the tagging...)

Diff Detail

Repository
rB Blender

Event Timeline

source/blender/editors/space_view3d/view3d_edit.c
2953 ↗(On Diff #16333)

why is this so?
... still figuring this out actually...

note there is also T66742 which I am looking into, so issue might actually be deeper than this...

Philipp Oeser (lichtwerk) marked an inline comment as not done.Jul 12 2019, 10:02 AM
source/blender/editors/space_view3d/view3d_edit.c
2953 ↗(On Diff #16333)

This sounds like someone who modified base flags did not tag DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);

This comment has been deleted.
source/blender/editors/space_view3d/view3d_edit.c
2953 ↗(On Diff #16333)

Yep, can confirm that ed_object_select_pick does a whole lot of ED_object_base_select etc. without tagging scene ID_RECALC_BASE_FLAGS, can also confirm that tagging scene there fixes the issue.

Will update Diff accordingly (just figuring out the best place for the tag...might actually do this in view3d_select_exec...)

Sidequestion: going over code there it seems often times DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); is called numerous times (if you include some "sub-functions" that are called and also tag....). Might be possible to remove some redundancy, but... this doesnt really do harm, right?

Philipp Oeser (lichtwerk) planned changes to this revision.Jul 12 2019, 11:59 AM

will rather tag scene ID_RECALC_BASE_FLAGS in ed_object_select_pick / view3d_select_exec...

source/blender/editors/space_view3d/view3d_edit.c
2953 ↗(On Diff #16333)

Tagging is supposed to be cheap, so multiple calls to DEG_id_tag_update() should not be a problem.

If it ever pops up in a profiles we should solve this from DEG_id_tag_update() side.

  • tag scene ID_RECALC_BASE_FLAGS when selecting (instead of querying selection flag on base_orig)

Is not a bad idea to localize update tags, it should't be tagging "just in case", unless:

  • Localization of tagging is causing a lot of hassle.
  • Tag is needed in almost any code path of the tool/operator.

This seems fine but the commented out code should be removed before commit.

This revision is now accepted and ready to land.Jul 15 2019, 4:12 PM