[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26136] trunk/blender: Animation Editors: Restored 'Realtime Updates' toggle

Joshua Leung aligorith at gmail.com
Wed Jan 20 12:20:20 CET 2010


Revision: 26136
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26136
Author:   aligorith
Date:     2010-01-20 12:20:20 +0100 (Wed, 20 Jan 2010)

Log Message:
-----------
Animation Editors: Restored 'Realtime Updates' toggle

- In 2.4x, this setting was the lock button in the headers. 
- Now, this option can be found in the View menus of all relevant editors

- Basically, this option toggles whether objects (using animation data that's being edited) get updated during animation editor transforms to give realtime feedback on the effects of tweaks. 
- By default, this is enabled, since this fits in nicer with 2.5's everything 'live' paradigm. However, it is recommended to disable this on slower computers or when updates for heavy rigs are causing too much workflow lag

- Also, removed some old crufty settings from action editor data

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_dopesheet.py
    trunk/blender/release/scripts/ui/space_graph.py
    trunk/blender/release/scripts/ui/space_nla.py
    trunk/blender/source/blender/editors/animation/anim_filter.c
    trunk/blender/source/blender/editors/transform/transform_generics.c
    trunk/blender/source/blender/makesdna/DNA_action_types.h
    trunk/blender/source/blender/makesdna/DNA_space_types.h
    trunk/blender/source/blender/makesrna/intern/rna_space.c

Modified: trunk/blender/release/scripts/ui/space_dopesheet.py
===================================================================
--- trunk/blender/release/scripts/ui/space_dopesheet.py	2010-01-20 11:08:50 UTC (rev 26135)
+++ trunk/blender/release/scripts/ui/space_dopesheet.py	2010-01-20 11:20:20 UTC (rev 26136)
@@ -73,6 +73,7 @@
 
         layout.column()
 
+        layout.prop(st, "realtime_updates")
         layout.prop(st, "show_cframe_indicator")
         layout.prop(st, "show_sliders")
         layout.prop(st, "automerge_keyframes")

Modified: trunk/blender/release/scripts/ui/space_graph.py
===================================================================
--- trunk/blender/release/scripts/ui/space_graph.py	2010-01-20 11:08:50 UTC (rev 26135)
+++ trunk/blender/release/scripts/ui/space_graph.py	2010-01-20 11:20:20 UTC (rev 26136)
@@ -68,9 +68,10 @@
 
         layout.column()
 
+        layout.operator("graph.properties", icon='MENU_PANEL')
         layout.separator()
-        layout.operator("graph.properties", icon='MENU_PANEL')
-
+		
+        layout.prop(st, "realtime_updates")
         layout.prop(st, "show_cframe_indicator")
         layout.prop(st, "show_cursor")
         layout.prop(st, "show_sliders")

Modified: trunk/blender/release/scripts/ui/space_nla.py
===================================================================
--- trunk/blender/release/scripts/ui/space_nla.py	2010-01-20 11:08:50 UTC (rev 26135)
+++ trunk/blender/release/scripts/ui/space_nla.py	2010-01-20 11:20:20 UTC (rev 26136)
@@ -58,6 +58,8 @@
         layout.operator("nla.properties", icon='MENU_PANEL')
 
         layout.separator()
+
+        layout.prop(st, "realtime_updates")
         layout.prop(st, "show_cframe_indicator")
 
         layout.operator("anim.time_toggle", text="Show Frames" if st.show_seconds else "Show Seconds")

Modified: trunk/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_filter.c	2010-01-20 11:08:50 UTC (rev 26135)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c	2010-01-20 11:20:20 UTC (rev 26136)
@@ -159,7 +159,7 @@
 	switch (saction->mode) {
 		case SACTCONT_ACTION: /* 'Action Editor' */
 			/* if not pinned, sync with active object */
-			if (saction->pin == 0) {
+			if (/*saction->pin == 0*/0) {
 				if (ac->obact && ac->obact->adt)
 					saction->action = ac->obact->adt->action;
 				else

Modified: trunk/blender/source/blender/editors/transform/transform_generics.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_generics.c	2010-01-20 11:08:50 UTC (rev 26135)
+++ trunk/blender/source/blender/editors/transform/transform_generics.c	2010-01-20 11:20:20 UTC (rev 26136)
@@ -335,6 +335,7 @@
 	}
 	else if (t->spacetype == SPACE_ACTION) {
 		Scene *scene= t->scene;
+		SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first;
 		
 		bAnimContext ac;
 		ListBase anim_data = {NULL, NULL};
@@ -358,10 +359,14 @@
 		filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA);
 		ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
 		
-		/* just tag these animdata-blocks to recalc, assuming that some data there changed */
-		for (ale= anim_data.first; ale; ale= ale->next) {
-			/* set refresh tags for objects using this animation */
-			ANIM_list_elem_update(t->scene, ale);
+		/* just tag these animdata-blocks to recalc, assuming that some data there changed 
+		 * BUT only do this if realtime updates are enabled
+		 */
+		if ((saction->flag & SACTION_NOREALTIMEUPDATES) == 0) {
+			for (ale= anim_data.first; ale; ale= ale->next) {
+				/* set refresh tags for objects using this animation */
+				ANIM_list_elem_update(t->scene, ale);
+			}
 		}
 		
 		/* now free temp channels */
@@ -369,6 +374,7 @@
 	}
 	else if (t->spacetype == SPACE_IPO) {
 		Scene *scene;
+		SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first;
 		
 		ListBase anim_data = {NULL, NULL};
 		bAnimContext ac;
@@ -408,8 +414,11 @@
 			else
 				calchandles_fcurve(fcu);
 				
-			/* set refresh tags for objects using this animation */
-			ANIM_list_elem_update(t->scene, ale);
+			/* set refresh tags for objects using this animation,
+			 * BUT only if realtime updates are enabled  
+			 */
+			if ((sipo->flag & SIPO_NOREALTIMEUPDATES) == 0)
+				ANIM_list_elem_update(t->scene, ale);
 		}
 		
 		/* do resort and other updates? */
@@ -439,8 +448,11 @@
 			if (tdn->handle == 0)
 				continue;
 			
-			/* set refresh tags for objects using this animation */
-			ANIM_id_update(t->scene, tdn->id);
+			/* set refresh tags for objects using this animation,
+			 * BUT only if realtime updates are enabled  
+			 */
+			if ((snla->flag & SNLA_NOREALTIMEUPDATES) == 0)
+				ANIM_id_update(t->scene, tdn->id);
 			
 			/* if cancelling transform, just write the values without validating, then move on */
 			if (t->state == TRANS_CANCEL) {

Modified: trunk/blender/source/blender/makesdna/DNA_action_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_action_types.h	2010-01-20 11:08:50 UTC (rev 26135)
+++ trunk/blender/source/blender/makesdna/DNA_action_types.h	2010-01-20 11:20:20 UTC (rev 26136)
@@ -558,9 +558,7 @@
 	bDopeSheet 	ads;			/* the currently active context (when not showing action) */
 	
 	char  mode, autosnap;		/* mode: editing context; autosnap: automatic keyframe snapping mode   */
-	short flag, actnr; 			/* flag: bitmapped settings; */
-	short pin, lock;			/* pin: keep showing current action; actnr: used for finding chosen action from menu; lock: lock time to other windows */
-	short actwidth;				/* width of the left-hand side name panel (in pixels?) */  // XXX depreceated!
+	short flag; 				/* flag: bitmapped settings; */
 	float timeslide;			/* for Time-Slide transform mode drawing - current frame? */
 } SpaceAction;
 
@@ -568,24 +566,26 @@
 typedef enum eSAction_Flag {
 		/* during transform (only set for TimeSlide) */
 	SACTION_MOVING	= (1<<0),	
-		/* show sliders (if relevant) */
+		/* show sliders */
 	SACTION_SLIDERS	= (1<<1),	
 		/* draw time in seconds instead of time in frames */
 	SACTION_DRAWTIME = (1<<2),
 		/* don't filter action channels according to visibility */
-	SACTION_NOHIDE = (1<<3),
+	//SACTION_NOHIDE = (1<<3), // XXX depreceated... old animation system
 		/* don't kill overlapping keyframes after transform */
 	SACTION_NOTRANSKEYCULL = (1<<4),
 		/* don't include keyframes that are out of view */
-	SACTION_HORIZOPTIMISEON = (1<<5),
+	//SACTION_HORIZOPTIMISEON = (1<<5), // XXX depreceated... old irrelevant trick
 		/* hack for moving pose-markers (temp flag)  */
 	SACTION_POSEMARKERS_MOVE = (1<<6),
 		/* don't draw action channels using group colours (where applicable) */
-	SACTION_NODRAWGCOLORS = (1<<7),
+	SACTION_NODRAWGCOLORS = (1<<7), // XXX depreceated... irrelevant for current groups implementation
 		/* don't draw current frame number beside frame indicator */
 	SACTION_NODRAWCFRANUM = (1<<8),
 		/* temporary flag to force channel selections to be synced with main */
 	SACTION_TEMP_NEEDCHANSYNC = (1<<9),
+		/* don't perform realtime updates */
+	SACTION_NOREALTIMEUPDATES =	(1<<10),
 } eSAction_Flag;	
 
 /* SpaceAction Mode Settings */

Modified: trunk/blender/source/blender/makesdna/DNA_space_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_space_types.h	2010-01-20 11:08:50 UTC (rev 26135)
+++ trunk/blender/source/blender/makesdna/DNA_space_types.h	2010-01-20 11:20:20 UTC (rev 26136)
@@ -750,6 +750,8 @@
 #define SIPO_SELVHANDLESONLY	(1<<9)
 	/* temporary flag to force channel selections to be synced with main */
 #define SIPO_TEMP_NEEDCHANSYNC	(1<<10)
+	/* don't perform realtime updates */
+#define SIPO_NOREALTIMEUPDATES	(1<<11)
 
 /* SpaceIpo->mode (Graph Editor Mode) */
 enum {
@@ -835,15 +837,15 @@
 #define IMS_INFILESLI		4
 
 /* nla->flag */
-	// depreceated
-#define SNLA_ALLKEYED		(1<<0)
-	// depreceated
-#define SNLA_ACTIVELAYERS	(1<<1)
-
+/* flags (1<<0), (1<<1), and (1<<3) are depreceated flags from old blenders */
+	/* draw timing in seconds instead of frames */
 #define SNLA_DRAWTIME		(1<<2)
-#define SNLA_NOTRANSKEYCULL	(1<<3)
+	/* don't draw frame number beside frame indicator */
 #define SNLA_NODRAWCFRANUM	(1<<4)
+	/* don't draw influence curves on strips */
 #define SNLA_NOSTRIPCURVES	(1<<5)
+	/* don't perform realtime updates */
+#define SNLA_NOREALTIMEUPDATES	(1<<6)
 
 /* time->flag */
 	/* show timing in frames instead of in seconds */

Modified: trunk/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_space.c	2010-01-20 11:08:50 UTC (rev 26135)
+++ trunk/blender/source/blender/makesrna/intern/rna_space.c	2010-01-20 11:20:20 UTC (rev 26136)
@@ -449,7 +449,7 @@
 	Object *obact= (scene->basact)? scene->basact->object: NULL;
 
 	/* we must set this action to be the one used by active object (if not pinned) */
-	if(obact && saction->pin == 0) {
+	if(obact/* && saction->pin == 0*/) {
 		AnimData *adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
 		
 		/* set action */
@@ -1342,6 +1342,11 @@
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL);
 	RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points.");
 	RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
+	
+	prop= RNA_def_property(srna, "realtime_updates", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOREALTIMEUPDATES);
+	RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming keyframes, changes to the animation data are flushed to other views.");
+	RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL);
 
 	/* dopesheet */
 	prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
@@ -1426,6 +1431,11 @@
 	RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points.");
 	RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL);
 	
+	prop= RNA_def_property(srna, "realtime_updates", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOREALTIMEUPDATES);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list