Bugfix [#25902] alt+a over 3D view don't up date dropesheet editor

Migrating "redraws" settings from TimeLine view data to per Screen.
The options are now still shown in the TimeLine "Playback" menu
though.

This means that whatever redraw settings you set in a TimeLine editor
will be used throughout a screen (i.e. editor layout) to determine
which editors will get updated during playback, instead of only
certain editors doing certain things at vague times.

---

Also, I moved some version patches pre 2.56 version bump into a
version-check for 2.56. These must've been missed when doing the
release...
This commit is contained in:
Joshua Leung 2011-02-01 23:41:01 +00:00
parent b8d9d10a65
commit efd1d0f901
10 changed files with 98 additions and 98 deletions

View File

@ -168,16 +168,16 @@ class TIME_MT_playback(bpy.types.Menu):
def draw(self, context):
layout = self.layout
st = context.space_data
screen = context.screen
scene = context.scene
layout.prop(st, "use_play_top_left_3d_editor")
layout.prop(st, "use_play_3d_editors")
layout.prop(st, "use_play_animation_editors")
layout.prop(st, "use_play_properties_editors")
layout.prop(st, "use_play_image_editors")
layout.prop(st, "use_play_sequence_editors")
layout.prop(st, "use_play_node_editors")
layout.prop(screen, "use_play_top_left_3d_editor")
layout.prop(screen, "use_play_3d_editors")
layout.prop(screen, "use_play_animation_editors")
layout.prop(screen, "use_play_properties_editors")
layout.prop(screen, "use_play_image_editors")
layout.prop(screen, "use_play_sequence_editors")
layout.prop(screen, "use_play_node_editors")
layout.separator()

View File

@ -11249,13 +11249,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
/* put compatibility code here until next subversion bump */
{
/* Fix for sample line scope initializing with no height */
if (main->versionfile < 256) {
bScreen *sc;
ScrArea *sa;
Key *key;
/* Fix for sample line scope initializing with no height */
for(sc= main->screen.first; sc; sc= sc->id.next) {
sa= sc->areabase.first;
while(sa) {
@ -11270,10 +11270,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
sa= sa->next;
}
}
}
{
Key *key;
/* old files could have been saved with slidermin = slidermax = 0.0, but the UI in
* 2.4x would never reveal this to users as a dummy value always ended up getting used
@ -11288,6 +11284,21 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
}
}
}
/* put compatibility code here until next subversion bump */
{
bScreen *sc;
/* redraws flag in SpaceTime has been moved to Screen level */
for (sc = main->screen.first; sc; sc= sc->id.next) {
if (sc->redraws_flag == 0) {
/* just initialise to default? */
// XXX: we could also have iterated through areas, and taken them from the first timeline available...
sc->redraws_flag = TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN;
}
}
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */

View File

@ -2467,7 +2467,7 @@ static short animdata_filter_dopesheet_summary (bAnimContext *ac, ListBase *anim
/* dopesheet summary
* - only for drawing and/or selecting keyframes in channels, but not for real editing
* - only useful for DopeSheet Editor, where the summary is useful
* - only useful for DopeSheet/Action/etc. editors where it is actually useful
*/
// TODO: we should really check if some other prohibited filters are also active, but that can be for later
if ((filter_mode & ANIMFILTER_CHANNELS) && (ads->filterflag & ADS_FILTER_SUMMARY)) {
@ -2568,7 +2568,8 @@ int ANIM_animdata_filter (bAnimContext *ac, ListBase *anim_data, int filter_mode
switch (datatype) {
case ANIMCONT_ACTION: /* 'Action Editor' */
{
bDopeSheet *ads = ((ac->sa) && (ac->sa->spacetype==SPACE_ACTION)) ? &((SpaceAction*)ac->sa->spacedata.first)->ads : NULL;
SpaceAction *saction = (SpaceAction *)ac->sa->spacedata.first;
bDopeSheet *ads = (saction)? &saction->ads : NULL;
/* the check for the DopeSheet summary is included here since the summary works here too */
if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))

View File

@ -418,6 +418,7 @@ bScreen *ED_screen_add(wmWindow *win, Scene *scene, const char *name)
sc= alloc_libblock(&G.main->screen, ID_SCR, name);
sc->scene= scene;
sc->do_refresh= 1;
sc->redraws_flag= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN;
sc->winid= win->winid;
sv1= screen_addvert(sc, 0, 0);

View File

@ -2696,36 +2696,18 @@ int ED_screen_animation_play(bContext *C, int sync, int mode)
}
else {
ScrArea *sa= CTX_wm_area(C);
int refresh= SPACE_TIME;
int refresh= SPACE_TIME; /* these settings are currently only available from a menu in the TimeLine */
if (mode == 1) // XXX only play audio forwards!?
sound_play_scene(scene);
/* timeline gets special treatment since it has it's own menu for determining redraws */
if ((sa) && (sa->spacetype == SPACE_TIME)) {
SpaceTime *stime= (SpaceTime *)sa->spacedata.first;
ED_screen_animation_timer(C, screen->redraws_flag, refresh, sync, mode);
if (screen->animtimer) {
wmTimer *wt= screen->animtimer;
ScreenAnimData *sad= wt->customdata;
ED_screen_animation_timer(C, stime->redraws, refresh, sync, mode);
/* update region if TIME_REGION was set, to leftmost 3d window */
ED_screen_animation_timer_update(screen, stime->redraws, refresh);
}
else {
int redraws = TIME_REGION|TIME_ALL_3D_WIN;
/* XXX - would like a better way to deal with this situation - Campbell */
if ((!sa) || (sa->spacetype == SPACE_SEQ)) {
redraws |= TIME_SEQ;
}
ED_screen_animation_timer(C, redraws, refresh, sync, mode);
if(screen->animtimer) {
wmTimer *wt= screen->animtimer;
ScreenAnimData *sad= wt->customdata;
sad->ar= CTX_wm_region(C);
}
sad->ar= CTX_wm_region(C);
}
}
@ -2763,7 +2745,7 @@ static int screen_animation_cancel_exec(bContext *C, wmOperator *UNUSED(op))
{
bScreen *screen= CTX_wm_screen(C);
if(screen->animtimer) {
if (screen->animtimer) {
ScreenAnimData *sad= screen->animtimer->customdata;
Scene *scene= CTX_data_scene(C);

View File

@ -569,7 +569,7 @@ static SpaceLink *time_new(const bContext *C)
stime= MEM_callocN(sizeof(SpaceTime), "inittime");
stime->spacetype= SPACE_TIME;
stime->redraws= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN;
stime->redraws= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN; // XXX: depreceated
stime->flag |= TIME_DRAWFRAMES;
/* header */

View File

@ -54,6 +54,9 @@ typedef struct bScreen {
struct Scene *scene;
struct Scene *newscene; /* temporary when switching */
int redraws_flag; /* user-setting for which editors get redrawn during anim playback (used to be time->redraws) */
int pad1;
short full; /* temp screen for image render display or fileselect */
short temp; /* temp screen in a temp window, don't save (like user prefs) */
short winid; /* winid from WM, starts with 1 */

View File

@ -372,7 +372,7 @@ typedef struct SpaceTime {
ListBase caches;
int cache_display, pad;
int flag, redraws;
int flag, redraws; /* redraws is deprecated... moved to screen */
} SpaceTime;
@ -863,7 +863,7 @@ enum {
/* only keyframes from active/selected channels get shown */
#define TIME_ONLYACTSEL 4
/* time->redraws */
/* time->redraws (now screen->redraws_flag) */
#define TIME_REGION 1
#define TIME_ALL_3D_WIN 2
#define TIME_ALL_ANIM_WIN 4

View File

@ -46,12 +46,12 @@ EnumPropertyItem region_type_items[] = {
#include "ED_screen.h"
#ifdef RNA_RUNTIME
#include "WM_api.h"
#include "WM_types.h"
#ifdef RNA_RUNTIME
static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value)
{
bScreen *sc= (bScreen*)ptr->data;
@ -74,6 +74,15 @@ static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr)
}
}
static void rna_Screen_redraw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
bScreen *screen= (bScreen*)ptr->data;
/* the settings for this are currently only available from a menu in the TimeLine, hence refresh=SPACE_TIME */
ED_screen_animation_timer_update(screen, screen->redraws_flag, SPACE_TIME);
}
static int rna_Screen_is_animation_playing_get(PointerRNA *ptr)
{
bScreen *sc= (bScreen*)ptr->data;
@ -189,6 +198,7 @@ static void rna_def_screen(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Screen", "Screen datablock, defining the layout of areas in a window");
RNA_def_struct_ui_icon(srna, ICON_SPLITSCREEN);
/* pointers */
prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL, NULL);
@ -196,11 +206,13 @@ static void rna_def_screen(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
RNA_def_property_update(prop, 0, "rna_Screen_scene_update");
/* collections */
prop= RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL);
RNA_def_property_struct_type(prop, "Area");
RNA_def_property_ui_text(prop, "Areas", "Areas the screen is subdivided into");
/* readonly status indicators */
prop= RNA_def_property(srna, "is_animation_playing", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Screen_is_animation_playing_get", NULL);
@ -210,6 +222,42 @@ static void rna_def_screen(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_funcs(prop, "rna_Screen_fullscreen_get", NULL);
RNA_def_property_ui_text(prop, "Fullscreen", "An area is maximised, filling this screen");
/* Define Anim Playback Areas */
prop= RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_REGION);
RNA_def_property_ui_text(prop, "Top-Left 3D Editor", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_3D_WIN);
RNA_def_property_ui_text(prop, "All 3D View Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_ANIM_WIN);
RNA_def_property_ui_text(prop, "Animation Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_BUTS_WIN);
RNA_def_property_ui_text(prop, "Property Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_IMAGE_WIN);
RNA_def_property_ui_text(prop, "Image Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_SEQ);
RNA_def_property_ui_text(prop, "Sequencer Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
prop= RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_NODES);
RNA_def_property_ui_text(prop, "Node Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_Screen_redraw_update");
}
void RNA_def_screen(BlenderRNA *brna)

View File

@ -630,16 +630,6 @@ static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *m
*max= ci->len;
}
/* Space Time */
static void rna_SpaceTime_redraw_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
SpaceTime *st= (SpaceTime*)ptr->data;
bScreen *screen= (bScreen*)ptr->id.data;
ED_screen_animation_timer_update(screen, st->redraws, SPACE_TIME);
}
/* Space Dopesheet */
static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value)
@ -1933,43 +1923,7 @@ static void rna_def_space_time(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SpaceTime");
RNA_def_struct_ui_text(srna, "Space Timeline Editor", "Timeline editor space data");
/* Define Anim Playback Areas */
prop= RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_REGION);
RNA_def_property_ui_text(prop, "Top-Left 3D Editor", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
prop= RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_3D_WIN);
RNA_def_property_ui_text(prop, "All 3D View Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
prop= RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_ANIM_WIN);
RNA_def_property_ui_text(prop, "Animation Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
prop= RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_BUTS_WIN);
RNA_def_property_ui_text(prop, "Property Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
prop= RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_IMAGE_WIN);
RNA_def_property_ui_text(prop, "Image Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
prop= RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_SEQ);
RNA_def_property_ui_text(prop, "Sequencer Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
prop= RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_NODES);
RNA_def_property_ui_text(prop, "Node Editors", "");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update");
/* Other options */
/* view settings */
prop= RNA_def_property(srna, "show_only_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL);
RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes for active Object and/or its selected channels only");