Fix: Grease Pencil: issues with the transform keyframes system

Oversight in 09d2108bf5

For one, numinput for keyframes would be broken unless the mouse is moved first.
Secondly, redo would also be broken (using the `Adjust Last Operation` panel or the `Repeat Last` operator).

Above commit did a check for `TRANS_RUNNING` before calling `grease_pencil_layer_update_trans_data`.
This isnt set in any of the above scenarios (it only gets set once the moues moves).

This PR removes `TRANS_RUNNING` check to have proper calls to `grease_pencil_layer_update_trans_data`.
It has one downside: you now get a `grease_pencil_layer_update_trans_data` as soon as you hit `G`.
So it does remove_frame / add_frame unnecessarily (since we are still on the same frame), but only once, sees harmless in comparison to the two regression it fixes.

Fixes #131092
Fixes #130793

Pull Request: https://projects.blender.org/blender/blender/pulls/131143
This commit is contained in:
Philipp Oeser
2024-11-29 15:40:51 +01:00
committed by Philipp Oeser
parent 4eb1b78d82
commit e104735eeb

View File

@@ -1034,7 +1034,7 @@ static void recalcData_actedit(TransInfo *t)
transform_convert_flush_handle2D(td, td2d, 0.0f);
if ((t->state == TRANS_RUNNING) && ((td->flag & TD_GREASE_PENCIL_FRAME) != 0)) {
if ((td->flag & TD_GREASE_PENCIL_FRAME) != 0) {
grease_pencil_layer_update_trans_data(
*static_cast<blender::bke::greasepencil::Layer *>(td->extra),
round_fl_to_int(td->ival),