[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21070] branches/soc-2009-aligorith/source /blender: NLA SoC: DopeSheet Cleanups

Joshua Leung aligorith at gmail.com
Mon Jun 22 05:26:42 CEST 2009


Revision: 21070
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21070
Author:   aligorith
Date:     2009-06-22 05:26:36 +0200 (Mon, 22 Jun 2009)

Log Message:
-----------
NLA SoC: DopeSheet Cleanups 

* Replaced old-style menu defines with the new-style Layout Engine ones. These are now much cleaner as a result :)

* Wrapped DopeSheet and Graph Editors in RNA to allow them to use the new Layout Engine for menu drawing 

* Shortened the names of operators in the DopeSheet, removing the "keyframes" prefix since that's the only real context which can operate there.

* Standardised a few names, and renamed a confusingly named operator (cfrasnap -> jump to frame)

Modified Paths:
--------------
    branches/soc-2009-aligorith/source/blender/editors/include/ED_anim_api.h
    branches/soc-2009-aligorith/source/blender/editors/space_action/action_edit.c
    branches/soc-2009-aligorith/source/blender/editors/space_action/action_header.c
    branches/soc-2009-aligorith/source/blender/editors/space_action/action_intern.h
    branches/soc-2009-aligorith/source/blender/editors/space_action/action_ops.c
    branches/soc-2009-aligorith/source/blender/editors/space_action/action_select.c
    branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_header.c
    branches/soc-2009-aligorith/source/blender/makesrna/RNA_access.h
    branches/soc-2009-aligorith/source/blender/makesrna/intern/rna_space.c

Modified: branches/soc-2009-aligorith/source/blender/editors/include/ED_anim_api.h
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/include/ED_anim_api.h	2009-06-22 03:06:25 UTC (rev 21069)
+++ branches/soc-2009-aligorith/source/blender/editors/include/ED_anim_api.h	2009-06-22 03:26:36 UTC (rev 21070)
@@ -142,7 +142,6 @@
 	ALE_GPFRAME,		/* Grease Pencil Frames */
 	ALE_NLASTRIP,		/* NLA Strips */
 	
-	// XXX the following are for summaries... should these be kept?
 	ALE_SCE,			/* Scene summary */
 	ALE_OB,				/* Object summary */
 	ALE_ACT,			/* Action summary */
@@ -311,7 +310,7 @@
 /* ------------- NLA-Mapping ----------------------- */
 /* anim_draw.c */
 
-// XXX these are soon to be depreceated?
+// XXX these need attention for the new editing method...
 
 /* Obtain the Object providing NLA-scaling for the given channel if applicable */
 struct Object *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale);

Modified: branches/soc-2009-aligorith/source/blender/editors/space_action/action_edit.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/space_action/action_edit.c	2009-06-22 03:06:25 UTC (rev 21069)
+++ branches/soc-2009-aligorith/source/blender/editors/space_action/action_edit.c	2009-06-22 03:26:36 UTC (rev 21070)
@@ -307,11 +307,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_copy (wmOperatorType *ot)
+void ACT_OT_copy (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Copy Keyframes";
-	ot->idname= "ACT_OT_keyframes_copy";
+	ot->idname= "ACT_OT_copy";
 	
 	/* api callbacks */
 	ot->exec= actkeys_copy_exec;
@@ -351,11 +351,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_paste (wmOperatorType *ot)
+void ACT_OT_paste (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Paste Keyframes";
-	ot->idname= "ACT_OT_keyframes_paste";
+	ot->idname= "ACT_OT_paste";
 	
 	/* api callbacks */
 	ot->exec= actkeys_paste_exec;
@@ -447,11 +447,11 @@
 	return OPERATOR_FINISHED;
 }
 
-void ACT_OT_keyframes_insert (wmOperatorType *ot)
+void ACT_OT_insert (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Insert Keyframes";
-	ot->idname= "ACT_OT_keyframes_insert";
+	ot->idname= "ACT_OT_insert";
 	
 	/* api callbacks */
 	ot->invoke= WM_menu_invoke;
@@ -524,11 +524,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_duplicate (wmOperatorType *ot)
+void ACT_OT_duplicate (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Duplicate Keyframes";
-	ot->idname= "ACT_OT_keyframes_duplicate";
+	ot->idname= "ACT_OT_duplicate";
 	
 	/* api callbacks */
 	ot->invoke= actkeys_duplicate_invoke;
@@ -591,11 +591,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_delete (wmOperatorType *ot)
+void ACT_OT_delete (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Delete Keyframes";
-	ot->idname= "ACT_OT_keyframes_delete";
+	ot->idname= "ACT_OT_delete";
 	
 	/* api callbacks */
 	ot->invoke= WM_operator_confirm;
@@ -654,11 +654,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_clean (wmOperatorType *ot)
+void ACT_OT_clean (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Clean Keyframes";
-	ot->idname= "ACT_OT_keyframes_clean";
+	ot->idname= "ACT_OT_clean";
 	
 	/* api callbacks */
 	//ot->invoke=  // XXX we need that number popup for this! 
@@ -778,11 +778,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_sample (wmOperatorType *ot)
+void ACT_OT_sample (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Sample Keyframes";
-	ot->idname= "ACT_OT_keyframes_sample";
+	ot->idname= "ACT_OT_sample";
 	
 	/* api callbacks */
 	ot->exec= actkeys_sample_exec;
@@ -853,11 +853,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_extrapolation_type_set (wmOperatorType *ot)
+void ACT_OT_extrapolation_type_set (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Set Keyframe Extrapolation";
-	ot->idname= "ACT_OT_keyframes_extrapolation_type_set";
+	ot->idname= "ACT_OT_extrapolation_type_set";
 	
 	/* api callbacks */
 	ot->invoke= WM_menu_invoke;
@@ -923,11 +923,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_interpolation_type (wmOperatorType *ot)
+void ACT_OT_interpolation_type_set (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Set Keyframe Interpolation";
-	ot->idname= "ACT_OT_keyframes_interpolation_type";
+	ot->idname= "ACT_OT_interpolation_type_set";
 	
 	/* api callbacks */
 	ot->invoke= WM_menu_invoke;
@@ -1011,11 +1011,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_handle_type_set (wmOperatorType *ot)
+void ACT_OT_handle_type_set (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Set Keyframe Handle Type";
-	ot->idname= "ACT_OT_keyframes_handle_type_set";
+	ot->idname= "ACT_OT_handle_type_set";
 	
 	/* api callbacks */
 	ot->invoke= WM_menu_invoke;
@@ -1032,10 +1032,10 @@
 /* ************************************************************************** */
 /* TRANSFORM STUFF */
 
-/* ***************** Snap Current Frame Operator *********************** */
+/* ***************** Jump to Selected Frames Operator *********************** */
 
 /* snap current-frame indicator to 'average time' of selected keyframe */
-static int actkeys_cfrasnap_exec(bContext *C, wmOperator *op)
+static int actkeys_framejump_exec(bContext *C, wmOperator *op)
 {
 	bAnimContext ac;
 	ListBase anim_data= {NULL, NULL};
@@ -1071,14 +1071,14 @@
 	return OPERATOR_FINISHED;
 }
 
-void ACT_OT_keyframes_cfrasnap (wmOperatorType *ot)
+void ACT_OT_frame_jump (wmOperatorType *ot)
 {
 	/* identifiers */
-	ot->name= "Snap Current Frame to Keys";
-	ot->idname= "ACT_OT_keyframes_cfrasnap";
+	ot->name= "Jump to Frame";
+	ot->idname= "ACT_OT_frame_jump";
 	
 	/* api callbacks */
-	ot->exec= actkeys_cfrasnap_exec;
+	ot->exec= actkeys_framejump_exec;
 	ot->poll= ED_operator_action_active;
 	
 	/* flags */
@@ -1166,11 +1166,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_snap (wmOperatorType *ot)
+void ACT_OT_snap (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Snap Keys";
-	ot->idname= "ACT_OT_keyframes_snap";
+	ot->idname= "ACT_OT_snap";
 	
 	/* api callbacks */
 	ot->invoke= WM_menu_invoke;
@@ -1282,11 +1282,11 @@
 	return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_mirror (wmOperatorType *ot)
+void ACT_OT_mirror (wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name= "Mirror Keys";
-	ot->idname= "ACT_OT_keyframes_mirror";
+	ot->idname= "ACT_OT_mirror";
 	
 	/* api callbacks */
 	ot->invoke= WM_menu_invoke;

Modified: branches/soc-2009-aligorith/source/blender/editors/space_action/action_header.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/space_action/action_header.c	2009-06-22 03:06:25 UTC (rev 21069)
+++ branches/soc-2009-aligorith/source/blender/editors/space_action/action_header.c	2009-06-22 03:26:36 UTC (rev 21070)
@@ -51,11 +51,14 @@
 #include "ED_types.h"
 #include "ED_util.h"
 
+#include "RNA_access.h"
+
 #include "WM_api.h"
 #include "WM_types.h"
 
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
+#include "BIF_transform.h"
 
 #include "UI_interface.h"
 #include "UI_resources.h"
@@ -63,1494 +66,183 @@
 
 #include "action_intern.h"
 
+enum {
+	B_REDR= 0,
+} eActHeader_Events;
+
 /* ********************************************************* */
 /* Menu Defines... */
 
-/* button events */
-enum {
-	B_REDR 	= 0,
-	B_ACTCOPYKEYS,
-	B_ACTPASTEKEYS,
-} eActHeader_ButEvents;
-
-/* ------------------------------- */
-/* enums declaring constants that are used as menu event codes  */
-
-enum {
-	ACTMENU_VIEW_CENTERVIEW= 0,
-	ACTMENU_VIEW_AUTOUPDATE,
-	ACTMENU_VIEW_PLAY3D,
-	ACTMENU_VIEW_PLAYALL,
-	ACTMENU_VIEW_ALL,
-	ACTMENU_VIEW_MAXIMIZE,
-	ACTMENU_VIEW_LOCK,
-	ACTMENU_VIEW_SLIDERS,
-	ACTMENU_VIEW_NEXTMARKER,
-	ACTMENU_VIEW_PREVMARKER,
-	ACTMENU_VIEW_NEXTKEYFRAME,
-	ACTMENU_VIEW_PREVKEYFRAME,
-	ACTMENU_VIEW_TIME,
-	ACTMENU_VIEW_NOHIDE,
-	ACTMENU_VIEW_FRANUM,
-	ACTMENU_VIEW_TRANSDELDUPS,
-	ACTMENU_VIEW_HORIZOPTIMISE,
-	ACTMENU_VIEW_GCOLORS,
-	ACTMENU_VIEW_PREVRANGESET,
-	ACTMENU_VIEW_PREVRANGECLEAR,
-	ACTMENU_VIEW_PREVRANGEAUTO
-};
-
-enum {
-	ACTMENU_SEL_BORDER = 0,
-	ACTMENU_SEL_BORDERC,
-	ACTMENU_SEL_BORDERM,
-	ACTMENU_SEL_ALL_KEYS,
-	ACTMENU_SEL_ALL_CHAN,
-	ACTMENU_SEL_ALL_MARKERS,
-	ACTMENU_SEL_INVERSE_KEYS,
-	ACTMENU_SEL_INVERSE_MARKERS,
-	ACTMENU_SEL_INVERSE_CHANNELS,
-	ACTMENU_SEL_LEFTKEYS,
-	ACTMENU_SEL_RIGHTKEYS
-};
-
-enum {
-	ACTMENU_SEL_COLUMN_KEYS	= 1,
-	ACTMENU_SEL_COLUMN_CFRA,
-	ACTMENU_SEL_COLUMN_MARKERSCOLUMN,
-	ACTMENU_SEL_COLUMN_MARKERSBETWEEN 
-};
-
-enum {
-	ACTMENU_CHANNELS_OPENLEVELS = 0,
-	ACTMENU_CHANNELS_CLOSELEVELS,
-	ACTMENU_CHANNELS_EXPANDALL,
-	ACTMENU_CHANNELS_SHOWACHANS,
-	ACTMENU_CHANNELS_DELETE
-};
-
-enum {
-	ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_UP	= 0,
-	ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_DOWN,
-	ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_TOP,
-	ACTMENU_CHANNELS_CHANPOS_MOVE_CHANNEL_BOTTOM
-};
-
-enum {
-	ACTMENU_CHANNELS_GROUP_ADD_TOACTIVE	= 0,
-	ACTMENU_CHANNELS_GROUP_ADD_TONEW,
-	ACTMENU_CHANNELS_GROUP_REMOVE,
-	ACTMENU_CHANNELS_GROUP_SYNCPOSE
-};
-
-enum {
-	ACTMENU_CHANNELS_SETTINGS_TOGGLE = 0,
-	ACTMENU_CHANNELS_SETTINGS_ENABLE,
-	ACTMENU_CHANNELS_SETTINGS_DISABLE,
-};
-
-enum {
-	ACTMENU_KEY_DUPLICATE = 0,
-	ACTMENU_KEY_DELETE,
-	ACTMENU_KEY_CLEAN,
-	ACTMENU_KEY_SAMPLEKEYS,
-	ACTMENU_KEY_INSERTKEY
-};
-
-enum {
-	ACTMENU_KEY_TRANSFORM_MOVE  = 0,
-	ACTMENU_KEY_TRANSFORM_SCALE,
-	ACTMENU_KEY_TRANSFORM_SLIDE,
-	ACTMENU_KEY_TRANSFORM_EXTEND
-};
-
-enum {
-	ACTMENU_KEY_HANDLE_AUTO = 0,
-	ACTMENU_KEY_HANDLE_ALIGN,
-	ACTMENU_KEY_HANDLE_FREE,
-	ACTMENU_KEY_HANDLE_VECTOR
-};
-
-enum {
-	ACTMENU_KEY_INTERP_CONST = 0,
-	ACTMENU_KEY_INTERP_LINEAR,
-	ACTMENU_KEY_INTERP_BEZIER
-};
-
-enum {
-	ACTMENU_KEY_EXTEND_CONST = 0,
-	ACTMENU_KEY_EXTEND_EXTRAPOLATION,
-	ACTMENU_KEY_EXTEND_CYCLIC,
-	ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION
-};
-
-enum {
-	ACTMENU_KEY_SNAP_NEARFRAME = 1,
-	ACTMENU_KEY_SNAP_CURFRAME,
-	ACTMENU_KEY_SNAP_NEARMARK,
-	ACTMENU_KEY_SNAP_NEARTIME,
-	ACTMENU_KEY_SNAP_CFRA2KEY,
-};
-
-enum {
-	ACTMENU_KEY_MIRROR_CURFRAME = 1,
-	ACTMENU_KEY_MIRROR_YAXIS,
-	ACTMENU_KEY_MIRROR_XAXIS,
-	ACTMENU_KEY_MIRROR_MARKER
-};
-
-enum {
-	ACTMENU_MARKERS_ADD = 0,
-	ACTMENU_MARKERS_DUPLICATE,
-	ACTMENU_MARKERS_DELETE,
-	ACTMENU_MARKERS_NAME,
-	ACTMENU_MARKERS_MOVE,
-	ACTMENU_MARKERS_LOCALADD,
-	ACTMENU_MARKERS_LOCALRENAME,
-	ACTMENU_MARKERS_LOCALDELETE,
-	ACTMENU_MARKERS_LOCALMOVE
-};
-
-/* ------------------------------- */

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list