[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28881] trunk/blender: Motion Path Tweaks:

Joshua Leung aligorith at gmail.com
Thu May 20 14:31:56 CEST 2010


Revision: 28881
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28881
Author:   aligorith
Date:     2010-05-20 14:31:55 +0200 (Thu, 20 May 2010)

Log Message:
-----------
Motion Path Tweaks:

- #22155: keyframe dots not shown on path for bone keyframes that aren't in a group with a matching name. Since this situation is going to become more common in 2.5, I've added an option which will alternatively just search the entire action to find all F-Curves associated with bones. The old option is still the default though for the general cases.

- When keyframe drawing is enabled, the current frame will also be indicated on the path now as a (bigger) green dot, as requested by William. This makes it easier to see the position on the path on the current frame.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_animviz.py
    trunk/blender/source/blender/editors/space_view3d/drawanimviz.c
    trunk/blender/source/blender/makesdna/DNA_action_types.h
    trunk/blender/source/blender/makesrna/intern/rna_animviz.c

Modified: trunk/blender/release/scripts/ui/properties_animviz.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_animviz.py	2010-05-20 11:49:53 UTC (rev 28880)
+++ trunk/blender/release/scripts/ui/properties_animviz.py	2010-05-20 12:31:55 UTC (rev 28881)
@@ -61,6 +61,8 @@
         col.label(text="Display:")
         col.prop(mps, "show_frame_numbers", text="Frame Numbers")
         col.prop(mps, "highlight_keyframes", text="Keyframes")
+        if bones:
+            col.prop(mps, "search_all_action_keyframes", text="+ Non-Grouped Keyframes")
         col.prop(mps, "show_keyframe_numbers", text="Keyframe Numbers")
 
 

Modified: trunk/blender/source/blender/editors/space_view3d/drawanimviz.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawanimviz.c	2010-05-20 11:49:53 UTC (rev 28880)
+++ trunk/blender/source/blender/editors/space_view3d/drawanimviz.c	2010-05-20 12:31:55 UTC (rev 28881)
@@ -199,6 +199,21 @@
 		glVertex3fv(mpv->co);
 	glEnd();
 	
+	/* Draw big green dot where the current frame is */
+	// NOTE: only do this when drawing keyframes for now... 
+	if (avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) {
+		UI_ThemeColor(TH_CFRAME);
+		glPointSize(6.0f);
+		
+		glBegin(GL_POINTS);
+			mpv = mpv_start + (CFRA - sfra);
+			glVertex3fv(mpv->co);
+		glEnd();
+		
+		glPointSize(1.0f);
+		UI_ThemeColor(TH_TEXT_HI);
+	}
+	
 	/* Draw frame numbers at each framestep value */
 	if (avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) {
 		for (i=0, mpv=mpv_start; i < len; i+=stepsize, mpv+=stepsize) {
@@ -220,9 +235,9 @@
 			}
 		}
 	}
-
+	
 	/* Keyframes - dots and numbers */
-	if (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) {
+	if (avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) {
 		AnimData *adt= BKE_animdata_from_id(&ob->id);
 		DLRBT_Tree keys;
 		
@@ -230,8 +245,10 @@
 		BLI_dlrbTree_init(&keys);
 		
 		if (adt) {
-			/* for now, it is assumed that keyframes for bones are all grouped in a single group */
-			if (pchan) {
+			/* it is assumed that keyframes for bones are all grouped in a single group
+			 * unless an option is set to always use the whole action
+			 */
+			if ((pchan) && (avs->path_viewflag & MOTIONPATH_VIEW_KFACT)==0) {
 				bActionGroup *agrp= action_groups_find_named(adt->action, pchan->name);
 				
 				if (agrp) {
@@ -261,7 +278,7 @@
 		glPointSize(1.0f);
 		
 		/* Draw frame numbers of keyframes  */
-		if (avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) {
+		if (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) {
 			for (i=0, mpv=mpv_start; i < len; i++, mpv++) {
 				float mframe= (float)(sfra + i);
 				

Modified: trunk/blender/source/blender/makesdna/DNA_action_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_action_types.h	2010-05-20 11:49:53 UTC (rev 28880)
+++ trunk/blender/source/blender/makesdna/DNA_action_types.h	2010-05-20 12:31:55 UTC (rev 28881)
@@ -154,6 +154,8 @@
 	MOTIONPATH_VIEW_KFRAS		= (1<<1),
 		/* show keyframe/frame numbers */
 	MOTIONPATH_VIEW_KFNOS		= (1<<2),
+		/* find keyframes in whole action (instead of just in matching group name) */
+	MOTIONPATH_VIEW_KFACT		= (1<<3),
 } eMotionPath_ViewFlag;
 
 /* bAnimVizSettings->path_bakeflag */

Modified: trunk/blender/source/blender/makesrna/intern/rna_animviz.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_animviz.c	2010-05-20 11:49:53 UTC (rev 28880)
+++ trunk/blender/source/blender/makesrna/intern/rna_animviz.c	2010-05-20 12:31:55 UTC (rev 28881)
@@ -264,6 +264,11 @@
 	RNA_def_property_ui_text(prop, "Show Keyframe Numbers", "Show frame numbers of Keyframes on Motion Paths");
 	RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
 	
+	prop= RNA_def_property(srna, "search_all_action_keyframes", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "path_viewflag", MOTIONPATH_VIEW_KFACT);
+	RNA_def_property_ui_text(prop, "All Action Keyframes", "For bone motion paths, search whole Action for keyframes instead of in group with matching name only (is slower)");
+	RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); /* XXX since this is only for 3d-view drawing */
+	
 	prop= RNA_def_property(srna, "frame_step", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "path_step");
 	RNA_def_property_range(prop, 1, 100);





More information about the Bf-blender-cvs mailing list