[Bf-blender-cvs] [4e3d672] master: Clear motionpaths for all objects and bones instead of only selected ones

Joshua Leung noreply at git.blender.org
Sun Feb 7 01:34:49 CET 2016


Commit: 4e3d6725c4b1ac0e554aa5ff1cb6e151029b2d40
Author: Joshua Leung
Date:   Sat Feb 6 13:04:20 2016 +1300
Branches: master
https://developer.blender.org/rB4e3d6725c4b1ac0e554aa5ff1cb6e151029b2d40

Clear motionpaths for all objects and bones instead of only selected ones

With the old behaviour, it was too easy to get old paths hanging around because you
forgot to go through and select a few bones that still had them.

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

M	source/blender/editors/armature/pose_edit.c
M	source/blender/editors/object/object_edit.c

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

diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index 0260b60..9e8028b 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -306,21 +306,18 @@ static void ED_pose_clear_paths(Object *ob)
 	if (ELEM(NULL, ob, ob->pose))
 		return;
 	
-	/* free the motionpath blocks, but also take note of whether we skipped some... */
+	/* free the motionpath blocks for all bones - This is easier for users to quickly clear all */
 	for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
 		if (pchan->mpath) {
-			if ((pchan->bone) && (pchan->bone->flag & BONE_SELECTED)) {
+			if (pchan->bone) {
 				animviz_free_motionpath(pchan->mpath);
 				pchan->mpath = NULL;
 			}
-			else 
-				skipped = 1;
 		}
 	}
 	
-	/* if we didn't skip any, we shouldn't have any paths left */
-	if (skipped == 0)
-		ob->pose->avs.path_bakeflag &= ~MOTIONPATH_BAKE_HAS_PATHS;
+	/* no paths left!*/
+	ob->pose->avs.path_bakeflag &= ~MOTIONPATH_BAKE_HAS_PATHS;
 }
 
 /* operator callback for this */
@@ -346,7 +343,7 @@ void POSE_OT_paths_clear(wmOperatorType *ot)
 	/* identifiers */
 	ot->name = "Clear Bone Paths";
 	ot->idname = "POSE_OT_paths_clear";
-	ot->description = "Clear path caches for selected bones";
+	ot->description = "Clear path caches for all bones";
 	
 	/* api callbacks */
 	ot->exec = pose_clear_paths_exec;
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 67c9f6e..9940ad8 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1314,11 +1314,11 @@ void OBJECT_OT_paths_update(wmOperatorType *ot)
 
 /* --------- */
 
-/* Clear motion paths for selected objects only */
+/* Clear motion paths for all objects */
 void ED_objects_clear_paths(bContext *C)
 {
-	/* loop over objects in scene */
-	CTX_DATA_BEGIN(C, Object *, ob, selected_editable_objects)
+	/* loop over all edtiable objects in scene */
+	CTX_DATA_BEGIN(C, Object *, ob, editable_objects)
 	{
 		if (ob->mpath) {
 			animviz_free_motionpath(ob->mpath);
@@ -1346,7 +1346,7 @@ void OBJECT_OT_paths_clear(wmOperatorType *ot)
 	/* identifiers */
 	ot->name = "Clear Object Paths";
 	ot->idname = "OBJECT_OT_paths_clear";
-	ot->description = "Clear path caches for selected objects";
+	ot->description = "Clear path caches for all objects";
 	
 	/* api callbacks */
 	ot->exec = object_clear_paths_exec;




More information about the Bf-blender-cvs mailing list