diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-19 14:51:45 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-19 14:51:45 +0300 |
commit | 28970b6ed2a50d546c35673903cec5d7eddfe01f (patch) | |
tree | 6ea5d062cd99676d8d9f838054c6b67e52ddf668 /source/blender | |
parent | 92197c24f0b0ebd29623311d9a665528219d1e8e (diff) |
Fix T53523: Keyframes for Marker weight stay, even if the track itself is deleted
Was using wrong prefix for the RNA path fix.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_clip/clip_utils.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/source/blender/editors/space_clip/clip_utils.c b/source/blender/editors/space_clip/clip_utils.c index e901b9f8026..500ec90f011 100644 --- a/source/blender/editors/space_clip/clip_utils.c +++ b/source/blender/editors/space_clip/clip_utils.c @@ -178,37 +178,36 @@ void clip_delete_track(bContext *C, MovieClip *clip, MovieTrackingTrack *track) MovieTrackingTrack *act_track = BKE_tracking_track_get_active(tracking); ListBase *tracksbase = BKE_tracking_get_active_tracks(tracking); bool has_bundle = false; - char track_name_escaped[MAX_NAME], prefix[MAX_NAME * 2]; const bool used_for_stabilization = (track->flag & (TRACK_USE_2D_STAB | TRACK_USE_2D_STAB_ROT)); - - if (track == act_track) + if (track == act_track) { tracking->act_track = NULL; - - /* handle reconstruction display in 3d viewport */ - if (track->flag & TRACK_HAS_BUNDLE) + } + /* Handle reconstruction display in 3d viewport. */ + if (track->flag & TRACK_HAS_BUNDLE) { has_bundle = true; - + } /* Make sure no plane will use freed track */ BKE_tracking_plane_tracks_remove_point_track(tracking, track); - /* Delete f-curves associated with the track (such as weight, i.e.) */ - BLI_strescape(track_name_escaped, track->name, sizeof(track_name_escaped)); - BLI_snprintf(prefix, sizeof(prefix), "tracks[\"%s\"]", track_name_escaped); - BKE_animdata_fix_paths_remove(&clip->id, prefix); + /* Escaped object name, escaped track name, rest of the path. */ + char rna_path[MAX_NAME * 4 + 64]; + BKE_tracking_get_rna_path_for_track(tracking, + track, + rna_path, sizeof(rna_path)); + BKE_animdata_fix_paths_remove(&clip->id, rna_path); BKE_tracking_track_free(track); BLI_freelinkN(tracksbase, track); - + /* Send notifiers. */ WM_event_add_notifier(C, NC_MOVIECLIP | NA_EDITED, clip); - if (used_for_stabilization) { WM_event_add_notifier(C, NC_MOVIECLIP | ND_DISPLAY, clip); } - - DAG_id_tag_update(&clip->id, 0); - - if (has_bundle) + if (has_bundle) { WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, NULL); + } + /* Inform dependency graph. */ + DAG_id_tag_update(&clip->id, 0); } void clip_delete_marker(bContext *C, MovieClip *clip, MovieTrackingTrack *track, |