[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28884] branches/render25: Render Branch: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/ blender -r28876:28883

Campbell Barton ideasman42 at gmail.com
Thu May 20 17:09:04 CEST 2010


Revision: 28884
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28884
Author:   campbellbarton
Date:     2010-05-20 17:09:04 +0200 (Thu, 20 May 2010)

Log Message:
-----------
Render Branch: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender  -r28876:28883

Modified Paths:
--------------
    branches/render25/release/scripts/ui/properties_animviz.py
    branches/render25/source/blender/blenkernel/intern/anim.c
    branches/render25/source/blender/blenkernel/intern/armature.c
    branches/render25/source/blender/editors/screen/screen_ops.c
    branches/render25/source/blender/editors/space_graph/graph_buttons.c
    branches/render25/source/blender/editors/space_view3d/drawanimviz.c
    branches/render25/source/blender/editors/space_view3d/drawobject.c
    branches/render25/source/blender/makesdna/DNA_action_types.h
    branches/render25/source/blender/makesrna/intern/rna_animation.c
    branches/render25/source/blender/makesrna/intern/rna_animviz.c

Modified: branches/render25/release/scripts/ui/properties_animviz.py
===================================================================
--- branches/render25/release/scripts/ui/properties_animviz.py	2010-05-20 15:04:47 UTC (rev 28883)
+++ branches/render25/release/scripts/ui/properties_animviz.py	2010-05-20 15:09:04 UTC (rev 28884)
@@ -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: branches/render25/source/blender/blenkernel/intern/anim.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/anim.c	2010-05-20 15:04:47 UTC (rev 28883)
+++ branches/render25/source/blender/blenkernel/intern/anim.c	2010-05-20 15:09:04 UTC (rev 28884)
@@ -187,6 +187,8 @@
 	
 	if (avs->path_bakeflag & MOTIONPATH_BAKE_HEADS)
 		mpath->flag |= MOTIONPATH_FLAG_BHEAD;
+	else
+		mpath->flag &= ~MOTIONPATH_FLAG_BHEAD;
 	
 	/* allocate a cache */
 	mpath->points= MEM_callocN(sizeof(bMotionPathVert)*mpath->length, "bMotionPathVerts");

Modified: branches/render25/source/blender/blenkernel/intern/armature.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/armature.c	2010-05-20 15:04:47 UTC (rev 28883)
+++ branches/render25/source/blender/blenkernel/intern/armature.c	2010-05-20 15:09:04 UTC (rev 28884)
@@ -2055,7 +2055,7 @@
 					
 					/* we need to clamp this within sensible values */
 					// NOTE: these should be fine for now, but should get sanitised in future
-					scale= MIN2( MAX2(scale, 0.0001) , 100000);
+					scale= MIN2(MAX2(scale, 0.0001) , 100000);
 				}
 				else
 					scale= 1.0f;
@@ -2127,8 +2127,6 @@
 				splineik_evaluate_bone(tree, scene, ob, pchan, i, ctime);
 			}
 			
-			// TODO: if another pass is needed to ensure the validity of the chain after blending, it should go here
-			
 			/* free the tree info specific to SplineIK trees now */
 			if (tree->chain) MEM_freeN(tree->chain);
 			if (tree->free_points) MEM_freeN(tree->points);

Modified: branches/render25/source/blender/editors/screen/screen_ops.c
===================================================================
--- branches/render25/source/blender/editors/screen/screen_ops.c	2010-05-20 15:04:47 UTC (rev 28883)
+++ branches/render25/source/blender/editors/screen/screen_ops.c	2010-05-20 15:09:04 UTC (rev 28884)
@@ -3044,7 +3044,8 @@
 	RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", WHEELDOWNMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "delta", 1);
 	RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", WHEELUPMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "delta", -1);
 	
-	WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", DOWNARROWKEY, KM_PRESS, KM_SHIFT, 0);
+	RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", UPARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 1);
+	RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", DOWNARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 0);
 	RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 1);
 	RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 0);
 	

Modified: branches/render25/source/blender/editors/space_graph/graph_buttons.c
===================================================================
--- branches/render25/source/blender/editors/space_graph/graph_buttons.c	2010-05-20 15:04:47 UTC (rev 28883)
+++ branches/render25/source/blender/editors/space_graph/graph_buttons.c	2010-05-20 15:09:04 UTC (rev 28884)
@@ -208,11 +208,88 @@
 				uiLayoutSetEnabled(subrow, (fcu->color_mode==FCURVE_COLOR_CUSTOM));
 				uiItemR(subrow, &fcu_ptr, "color", 0, "", 0);
 	
-	/* TODO: the following settings could be added here
-	 *	- Access details (ID-block + RNA-Path + Array Index)
-	 *	- ...
+	MEM_freeN(ale);
+}
+
+/* ******************* active Keyframe ************** */
+
+/* get 'active' keyframe for panel editing */
+static short get_active_fcurve_keyframe_edit(FCurve *fcu, BezTriple **bezt, BezTriple **prevbezt)
+{
+	BezTriple *b;
+	int i;
+	
+	/* zero the pointers */
+	*bezt = *prevbezt = NULL;
+	
+	/* sanity checks */
+	if ((fcu->bezt == NULL) || (fcu->totvert == 0))
+		return 0;
+		
+	/* find first selected keyframe for now, and call it the active one 
+	 *	- this is a reasonable assumption, given that whenever anyone 
+	 *	  wants to edit numerically, there is likely to only be 1 vert selected
 	 */
+	for (i=0, b=fcu->bezt; i < fcu->totvert; i++, b++) {
+		if (BEZSELECTED(b)) {
+			/* found 
+			 *	- 'previous' is either the one before, of the keyframe itself (which is still fine)
+			 *		XXX: we can just make this null instead if needed
+			 */
+			*prevbezt = (i > 0) ? b-1 : b;
+			*bezt = b;
+			
+			return 1;
+		}
+	}
+	
+	/* not found */
+	return 0;
+}
 
+static void graph_panel_key_properties(const bContext *C, Panel *pa)
+{
+	bAnimListElem *ale;
+	FCurve *fcu;
+	BezTriple *bezt, *prevbezt;
+	
+	uiLayout *layout = pa->layout;
+	uiLayout *col;
+	uiBlock *block;
+
+	if (!graph_panel_context(C, &ale, &fcu))
+		return;
+	
+	block = uiLayoutGetBlock(layout);
+	uiBlockSetHandleFunc(block, do_graph_region_buttons, NULL);
+	
+	/* only show this info if there are keyframes to edit */
+	if (get_active_fcurve_keyframe_edit(fcu, &bezt, &prevbezt)) {
+		PointerRNA bezt_ptr;
+		
+		/* RNA pointer to keyframe, to allow editing */
+		RNA_pointer_create(ale->id, &RNA_Keyframe, bezt, &bezt_ptr);
+		
+		/* interpolation */
+		col= uiLayoutColumn(layout, 0);
+			uiItemR(col, &bezt_ptr, "interpolation", 0, NULL, 0);
+			
+		/* numerical coordinate editing */
+		col= uiLayoutColumn(layout, 1);
+			/* keyframe itself */
+			uiItemR(col, &bezt_ptr, "co", 0, "Key", 0);
+			
+			/* previous handle - only if previous was Bezier interpolation */
+			if ((prevbezt) && (prevbezt->ipo == BEZT_IPO_BEZ))
+				uiItemR(col, &bezt_ptr, "handle1", 0, NULL, 0);
+			
+			/* next handle - only if current is Bezier interpolation */
+			if (bezt->ipo == BEZT_IPO_BEZ)
+				uiItemR(col, &bezt_ptr, "handle2", 0, NULL, 0);
+	}
+	else
+		uiItemL(layout, "No active keyframe on F-Curve", 0);
+	
 	MEM_freeN(ale);
 }
 
@@ -631,6 +708,7 @@
 	strcpy(pt->idname, "GRAPH_PT_view");
 	strcpy(pt->label, "View Properties");
 	pt->draw= graph_panel_view;
+	pt->flag |= PNL_DEFAULT_CLOSED;
 	BLI_addtail(&art->paneltypes, pt);
 	
 	pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties");
@@ -639,7 +717,15 @@
 	pt->draw= graph_panel_properties;
 	pt->poll= graph_panel_poll;
 	BLI_addtail(&art->paneltypes, pt);
+	
+	pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties");
+	strcpy(pt->idname, "GRAPH_PT_key_properties");
+	strcpy(pt->label, "Active Keyframe");
+	pt->draw= graph_panel_key_properties;
+	pt->poll= graph_panel_poll;
+	BLI_addtail(&art->paneltypes, pt);
 
+
 	pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel drivers");
 	strcpy(pt->idname, "GRAPH_PT_drivers");
 	strcpy(pt->label, "Drivers");

Modified: branches/render25/source/blender/editors/space_view3d/drawanimviz.c
===================================================================
--- branches/render25/source/blender/editors/space_view3d/drawanimviz.c	2010-05-20 15:04:47 UTC (rev 28883)
+++ branches/render25/source/blender/editors/space_view3d/drawanimviz.c	2010-05-20 15:09:04 UTC (rev 28884)
@@ -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: branches/render25/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/render25/source/blender/editors/space_view3d/drawobject.c	2010-05-20 15:04:47 UTC (rev 28883)
+++ branches/render25/source/blender/editors/space_view3d/drawobject.c	2010-05-20 15:09:04 UTC (rev 28884)
@@ -2520,7 +2520,8 @@
 	if (ob==OBACT && paint_facesel_test(ob)) draw_wire = 0;
 
 	if(dt==OB_BOUNDBOX) {
-		draw_bounding_volume(scene, ob);
+		if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_WIRE)==0)
+			draw_bounding_volume(scene, ob);
 	}
 	else if(hasHaloMat || (totface==0 && totedge==0)) {
 		glPointSize(1.5);
@@ -6159,7 +6160,10 @@
 			if(dtx & OB_AXIS) {
 				drawaxes(rv3d, rv3d->viewmatob, 1.0f, flag, OB_ARROWS);
 			}
-			if(dtx & OB_BOUNDBOX) draw_bounding_volume(scene, ob);
+			if(dtx & OB_BOUNDBOX) {
+				if((v3d->flag2 & V3D_RENDER_OVERRIDE)==0)
+					draw_bounding_volume(scene, ob);
+			}
 			if(dtx & OB_TEXSPACE) drawtexspace(ob);
 			if(dtx & OB_DRAWNAME) {
 				/* patch for several 3d cards (IBM mostly) that crash on glSelect with text drawing */


@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list