[Bf-blender-cvs] [28970b6ed2a] master: Fix T53523: Keyframes for Marker weight stay, even if the track itself is deleted

Sergey Sharybin noreply at git.blender.org
Tue Dec 19 13:03:01 CET 2017


Commit: 28970b6ed2a50d546c35673903cec5d7eddfe01f
Author: Sergey Sharybin
Date:   Tue Dec 19 12:51:45 2017 +0100
Branches: master
https://developer.blender.org/rB28970b6ed2a50d546c35673903cec5d7eddfe01f

Fix T53523: Keyframes for Marker weight stay, even if the track itself is deleted

Was using wrong prefix for the RNA path fix.

===================================================================

M	source/blender/editors/space_clip/clip_utils.c

===================================================================

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,



More information about the Bf-blender-cvs mailing list