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
This commit is contained in:
Joshua Leung 2010-01-20 11:20:20 +00:00
parent 09424badda
commit 6307c65534
8 changed files with 59 additions and 25 deletions

@ -73,6 +73,7 @@ class DOPESHEET_MT_view(bpy.types.Menu):
layout.column() layout.column()
layout.prop(st, "realtime_updates")
layout.prop(st, "show_cframe_indicator") layout.prop(st, "show_cframe_indicator")
layout.prop(st, "show_sliders") layout.prop(st, "show_sliders")
layout.prop(st, "automerge_keyframes") layout.prop(st, "automerge_keyframes")

@ -68,9 +68,10 @@ class GRAPH_MT_view(bpy.types.Menu):
layout.column() layout.column()
layout.separator()
layout.operator("graph.properties", icon='MENU_PANEL') layout.operator("graph.properties", icon='MENU_PANEL')
layout.separator()
layout.prop(st, "realtime_updates")
layout.prop(st, "show_cframe_indicator") layout.prop(st, "show_cframe_indicator")
layout.prop(st, "show_cursor") layout.prop(st, "show_cursor")
layout.prop(st, "show_sliders") layout.prop(st, "show_sliders")

@ -58,6 +58,8 @@ class NLA_MT_view(bpy.types.Menu):
layout.operator("nla.properties", icon='MENU_PANEL') layout.operator("nla.properties", icon='MENU_PANEL')
layout.separator() layout.separator()
layout.prop(st, "realtime_updates")
layout.prop(st, "show_cframe_indicator") layout.prop(st, "show_cframe_indicator")
layout.operator("anim.time_toggle", text="Show Frames" if st.show_seconds else "Show Seconds") layout.operator("anim.time_toggle", text="Show Frames" if st.show_seconds else "Show Seconds")

@ -159,7 +159,7 @@ static short actedit_get_context (bAnimContext *ac, SpaceAction *saction)
switch (saction->mode) { switch (saction->mode) {
case SACTCONT_ACTION: /* 'Action Editor' */ case SACTCONT_ACTION: /* 'Action Editor' */
/* if not pinned, sync with active object */ /* if not pinned, sync with active object */
if (saction->pin == 0) { if (/*saction->pin == 0*/0) {
if (ac->obact && ac->obact->adt) if (ac->obact && ac->obact->adt)
saction->action = ac->obact->adt->action; saction->action = ac->obact->adt->action;
else else

@ -335,6 +335,7 @@ void recalcData(TransInfo *t)
} }
else if (t->spacetype == SPACE_ACTION) { else if (t->spacetype == SPACE_ACTION) {
Scene *scene= t->scene; Scene *scene= t->scene;
SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first;
bAnimContext ac; bAnimContext ac;
ListBase anim_data = {NULL, NULL}; ListBase anim_data = {NULL, NULL};
@ -358,17 +359,22 @@ void recalcData(TransInfo *t)
filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA); filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
/* just tag these animdata-blocks to recalc, assuming that some data there changed */ /* 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) { for (ale= anim_data.first; ale; ale= ale->next) {
/* set refresh tags for objects using this animation */ /* set refresh tags for objects using this animation */
ANIM_list_elem_update(t->scene, ale); ANIM_list_elem_update(t->scene, ale);
} }
}
/* now free temp channels */ /* now free temp channels */
BLI_freelistN(&anim_data); BLI_freelistN(&anim_data);
} }
else if (t->spacetype == SPACE_IPO) { else if (t->spacetype == SPACE_IPO) {
Scene *scene; Scene *scene;
SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first;
ListBase anim_data = {NULL, NULL}; ListBase anim_data = {NULL, NULL};
bAnimContext ac; bAnimContext ac;
@ -408,7 +414,10 @@ void recalcData(TransInfo *t)
else else
calchandles_fcurve(fcu); calchandles_fcurve(fcu);
/* set refresh tags for objects using this animation */ /* 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); ANIM_list_elem_update(t->scene, ale);
} }
@ -439,7 +448,10 @@ void recalcData(TransInfo *t)
if (tdn->handle == 0) if (tdn->handle == 0)
continue; continue;
/* set refresh tags for objects using this animation */ /* 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); ANIM_id_update(t->scene, tdn->id);
/* if cancelling transform, just write the values without validating, then move on */ /* if cancelling transform, just write the values without validating, then move on */

@ -558,9 +558,7 @@ typedef struct SpaceAction {
bDopeSheet ads; /* the currently active context (when not showing action) */ bDopeSheet ads; /* the currently active context (when not showing action) */
char mode, autosnap; /* mode: editing context; autosnap: automatic keyframe snapping mode */ char mode, autosnap; /* mode: editing context; autosnap: automatic keyframe snapping mode */
short flag, actnr; /* flag: bitmapped settings; */ short flag; /* 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!
float timeslide; /* for Time-Slide transform mode drawing - current frame? */ float timeslide; /* for Time-Slide transform mode drawing - current frame? */
} SpaceAction; } SpaceAction;
@ -568,24 +566,26 @@ typedef struct SpaceAction {
typedef enum eSAction_Flag { typedef enum eSAction_Flag {
/* during transform (only set for TimeSlide) */ /* during transform (only set for TimeSlide) */
SACTION_MOVING = (1<<0), SACTION_MOVING = (1<<0),
/* show sliders (if relevant) */ /* show sliders */
SACTION_SLIDERS = (1<<1), SACTION_SLIDERS = (1<<1),
/* draw time in seconds instead of time in frames */ /* draw time in seconds instead of time in frames */
SACTION_DRAWTIME = (1<<2), SACTION_DRAWTIME = (1<<2),
/* don't filter action channels according to visibility */ /* 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 */ /* don't kill overlapping keyframes after transform */
SACTION_NOTRANSKEYCULL = (1<<4), SACTION_NOTRANSKEYCULL = (1<<4),
/* don't include keyframes that are out of view */ /* 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) */ /* hack for moving pose-markers (temp flag) */
SACTION_POSEMARKERS_MOVE = (1<<6), SACTION_POSEMARKERS_MOVE = (1<<6),
/* don't draw action channels using group colours (where applicable) */ /* 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 */ /* don't draw current frame number beside frame indicator */
SACTION_NODRAWCFRANUM = (1<<8), SACTION_NODRAWCFRANUM = (1<<8),
/* temporary flag to force channel selections to be synced with main */ /* temporary flag to force channel selections to be synced with main */
SACTION_TEMP_NEEDCHANSYNC = (1<<9), SACTION_TEMP_NEEDCHANSYNC = (1<<9),
/* don't perform realtime updates */
SACTION_NOREALTIMEUPDATES = (1<<10),
} eSAction_Flag; } eSAction_Flag;
/* SpaceAction Mode Settings */ /* SpaceAction Mode Settings */

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

@ -449,7 +449,7 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, Po
Object *obact= (scene->basact)? scene->basact->object: NULL; Object *obact= (scene->basact)? scene->basact->object: NULL;
/* we must set this action to be the one used by active object (if not pinned) */ /* 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 */ AnimData *adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */
/* set action */ /* set action */
@ -1343,6 +1343,11 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points."); 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); 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 */ /* dopesheet */
prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE); prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "DopeSheet"); RNA_def_property_struct_type(prop, "DopeSheet");
@ -1426,6 +1431,11 @@ static void rna_def_space_graph(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points."); 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); 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);
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_GRAPH, NULL);
/* cursor */ /* cursor */
prop= RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE); prop= RNA_def_property(srna, "show_cursor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCURSOR); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCURSOR);
@ -1490,6 +1500,12 @@ static void rna_def_space_nla(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips."); RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
/* editing */
prop= RNA_def_property(srna, "realtime_updates", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOREALTIMEUPDATES);
RNA_def_property_ui_text(prop, "Realtime Updates", "When transforming strips, changes to the animation data are flushed to other views.");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL);
/* dopesheet */ /* dopesheet */
prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE); prop= RNA_def_property(srna, "dopesheet", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "DopeSheet"); RNA_def_property_struct_type(prop, "DopeSheet");