[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21009] branches/soc-2009-aligorith/source /blender/editors/space_nla: NLA SoC: Minor Tweaks ( Duplicate + Muted-Strip Drawing)

Joshua Leung aligorith at gmail.com
Fri Jun 19 14:57:32 CEST 2009


Revision: 21009
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21009
Author:   aligorith
Date:     2009-06-19 14:57:31 +0200 (Fri, 19 Jun 2009)

Log Message:
-----------
NLA SoC: Minor Tweaks (Duplicate + Muted-Strip Drawing)

* Duplicate operator now inits transform once strips have been created
* Muted strips now draw with a dotted outline

Modified Paths:
--------------
    branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c
    branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_edit.c

Modified: branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c	2009-06-19 12:46:51 UTC (rev 21008)
+++ branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c	2009-06-19 12:57:31 UTC (rev 21009)
@@ -68,6 +68,7 @@
 #include "ED_screen.h"
 
 #include "BIF_gl.h"
+#include "BIF_glutil.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
@@ -184,7 +185,10 @@
 	uiSetRoundBox(15); /* all corners rounded */
 	gl_round_box_shade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1);
 	
-	/* draw strip outline - different colors are used here... */
+	
+	/* draw strip outline 
+	 *	- color used here is to indicate active vs non-active
+	 */
 	if (strip->flag & NLASTRIP_FLAG_ACTIVE) {
 		/* strip should appear 'sunken', so draw a light border around it */
 		glColor3f(0.9f, 1.0f, 0.9f); // FIXME: hardcoded temp-hack colors
@@ -193,7 +197,16 @@
 		/* strip should appear to stand out, so draw a dark border around it */
 		glColor3f(0.0f, 0.0f, 0.0f);
 	}
+	
+	/* - line style: dotted for muted */
+	if (strip->flag & NLASTRIP_FLAG_MUTED)
+		setlinestyle(4);
+		
+	/* draw outline */
 	gl_round_box_shade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1);
+	
+	/* reset linestyle */
+	setlinestyle(0);
 } 
 
 /* add the relevant text to the cache of text-strings to draw in pixelspace */

Modified: branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_edit.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_edit.c	2009-06-19 12:46:51 UTC (rev 21008)
+++ branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_edit.c	2009-06-19 12:57:31 UTC (rev 21009)
@@ -59,6 +59,8 @@
 #include "ED_space_api.h"
 #include "ED_screen.h"
 
+#include "BIF_transform.h"
+
 #include "RNA_access.h"
 #include "RNA_define.h"
 
@@ -506,13 +508,23 @@
 		ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_BOTH);
 		WM_event_add_notifier(C, NC_SCENE, NULL);
 		
-		/* done + allow for tweaking to be invoked */
-		return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
+		/* done */
+		return OPERATOR_FINISHED;
 	}
 	else
 		return OPERATOR_CANCELLED;
 }
 
+static int nlaedit_duplicate_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+	nlaedit_duplicate_exec(C, op);
+	
+	RNA_int_set(op->ptr, "mode", TFM_TIME_TRANSLATE); // XXX
+	WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
+
+	return OPERATOR_FINISHED;
+}
+
 void NLAEDIT_OT_duplicate (wmOperatorType *ot)
 {
 	/* identifiers */
@@ -521,11 +533,15 @@
 	ot->description= "Duplicate selected NLA-Strips, adding the new strips in new tracks above the originals.";
 	
 	/* api callbacks */
+	ot->invoke= nlaedit_duplicate_invoke;
 	ot->exec= nlaedit_duplicate_exec;
 	ot->poll= nlaop_poll_tweakmode_off;
 	
 	/* flags */
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+	
+	/* to give to transform */
+	RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
 }
 
 /* ******************** Delete Strips Operator ***************************** */





More information about the Bf-blender-cvs mailing list