Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-03-12 17:53:52 +0300
committerJacques Lucke <jacques@blender.org>2020-03-12 17:53:52 +0300
commit63ee3db961074beaf68c32ff30a21dfa65c2b122 (patch)
treeb4d5dcc1345f596e37a6fb71737635fded3b3bf9 /source/blender/editors
parent5929dd7129f6e8d41a79a5e01dd8b18f5369d1a8 (diff)
Fix T73228: UI shows settings of wrong marker when movie clip is offset
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_handlers.c7
-rw-r--r--source/blender/editors/space_clip/clip_buttons.c14
2 files changed, 9 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 833631f871d..3d7378181ad 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -58,6 +58,7 @@
#include "BKE_unit.h"
#include "BKE_paint.h"
#include "BKE_curveprofile.h"
+#include "BKE_movieclip.h"
#include "IMB_colormanagement.h"
@@ -7339,8 +7340,10 @@ static bool ui_numedit_but_TRACKPREVIEW(
}
if (!scopes->track_locked) {
- if (scopes->marker->framenr != scopes->framenr) {
- scopes->marker = BKE_tracking_marker_ensure(scopes->track, scopes->framenr);
+ const MovieClip *clip = CTX_data_edit_movieclip(C);
+ int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, scopes->framenr);
+ if (scopes->marker->framenr != clip_framenr) {
+ scopes->marker = BKE_tracking_marker_ensure(scopes->track, clip_framenr);
}
scopes->marker->flag &= ~(MARKER_DISABLED | MARKER_TRACKED);
diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c
index 34b4967beaf..6b9d3fd054a 100644
--- a/source/blender/editors/space_clip/clip_buttons.c
+++ b/source/blender/editors/space_clip/clip_buttons.c
@@ -259,8 +259,6 @@ typedef struct {
MovieTrackingTrack *track;
MovieTrackingMarker *marker;
- /** current frame number */
- int framenr;
/** position of marker in pixel coords */
float marker_pos[2];
/** position and dimensions of marker pattern in pixel coords */
@@ -283,14 +281,12 @@ static void to_pixel_space(float r[2], float a[2], int width, int height)
static void marker_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
{
MarkerUpdateCb *cb = (MarkerUpdateCb *)arg_cb;
- MovieTrackingMarker *marker;
if (!cb->compact) {
return;
}
- marker = BKE_tracking_marker_ensure(cb->track, cb->framenr);
-
+ MovieTrackingMarker *marker = cb->marker;
marker->flag = cb->marker_flag;
WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, NULL);
@@ -299,14 +295,12 @@ static void marker_update_cb(bContext *C, void *arg_cb, void *UNUSED(arg))
static void marker_block_handler(bContext *C, void *arg_cb, int event)
{
MarkerUpdateCb *cb = (MarkerUpdateCb *)arg_cb;
- MovieTrackingMarker *marker;
int width, height;
bool ok = false;
BKE_movieclip_get_size(cb->clip, cb->user, &width, &height);
- marker = BKE_tracking_marker_ensure(cb->track, cb->framenr);
-
+ MovieTrackingMarker *marker = cb->marker;
if (event == B_MARKER_POS) {
marker->pos[0] = cb->marker_pos[0] / width;
marker->pos[1] = cb->marker_pos[1] / height;
@@ -452,7 +446,8 @@ void uiTemplateMarker(uiLayout *layout,
user = userptr->data;
track = trackptr->data;
- marker = BKE_tracking_marker_get(track, user->framenr);
+ int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr);
+ marker = BKE_tracking_marker_get(track, clip_framenr);
cb = MEM_callocN(sizeof(MarkerUpdateCb), "uiTemplateMarker update_cb");
cb->compact = compact;
@@ -461,7 +456,6 @@ void uiTemplateMarker(uiLayout *layout,
cb->track = track;
cb->marker = marker;
cb->marker_flag = marker->flag;
- cb->framenr = user->framenr;
if (compact) {
block = uiLayoutGetBlock(layout);