diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_sound.h | 9 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sound.c | 34 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/include/ED_sequencer.h | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 17 | ||||
-rw-r--r-- | source/blender/editors/sound/sound_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/space_sequencer.c | 138 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_screen.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 16 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 5 |
14 files changed, 141 insertions, 110 deletions
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index fac5bf1cfd2..3728dd41089 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -39,7 +39,6 @@ struct PackedFile; struct bSound; -struct bContext; struct ListBase; struct Main; struct Sequence; @@ -65,12 +64,12 @@ struct bSound* sound_new_file(struct Main *main, const char *filename); // XXX unused currently #if 0 -struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source); +struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source); -struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, float start, float end); +struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, float start, float end); #endif -void sound_delete(struct bContext *C, struct bSound* sound); +void sound_delete(struct Main *bmain, struct bSound* sound); void sound_cache(struct bSound* sound); @@ -124,7 +123,7 @@ void sound_play_scene(struct Scene *scene); void sound_stop_scene(struct Scene *scene); -void sound_seek_scene(struct bContext *C); +void sound_seek_scene(struct Main *bmain, struct Scene *scene); float sound_sync_scene(struct Scene *scene); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 9ef30bdd49b..dbb2e7860c5 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3603,6 +3603,7 @@ Sequence *sequencer_add_image_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo #ifdef WITH_AUDASPACE Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo *seq_load) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); /* only for sound */ Editing *ed= seq_give_editing(scene, TRUE); bSound *sound; @@ -3624,7 +3625,7 @@ Sequence *sequencer_add_sound_strip(bContext *C, ListBase *seqbasep, SeqLoadInfo info = AUD_getInfo(sound->playback_handle); if (info.specs.channels == AUD_CHANNELS_INVALID) { - sound_delete(C, sound); + sound_delete(bmain, sound); //if(op) // BKE_report(op->reports, RPT_ERROR, "Unsupported audio format"); return NULL; diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 74f4830b86c..ff518d69e21 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -203,7 +203,7 @@ void sound_exit(void) // XXX unused currently #if 0 -struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source) +struct bSound* sound_new_buffer(struct Main *bmain, struct bSound *source) { bSound* sound = NULL; @@ -211,23 +211,23 @@ struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source) strcpy(name, "buf_"); strcpy(name + 4, source->id.name); - sound = alloc_libblock(&CTX_data_main(C)->sound, ID_SO, name); + sound = alloc_libblock(&bmain->sound, ID_SO, name); sound->child_sound = source; sound->type = SOUND_TYPE_BUFFER; - sound_load(CTX_data_main(C), sound); + sound_load(bmain, sound); if(!sound->playback_handle) { - free_libblock(&CTX_data_main(C)->sound, sound); + free_libblock(&bmain->sound, sound); sound = NULL; } return sound; } -struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, float start, float end) +struct bSound* sound_new_limiter(struct Main *bmain, struct bSound *source, float start, float end) { bSound* sound = NULL; @@ -235,18 +235,18 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa strcpy(name, "lim_"); strcpy(name + 4, source->id.name); - sound = alloc_libblock(&CTX_data_main(C)->sound, ID_SO, name); + sound = alloc_libblock(&bmain->sound, ID_SO, name); sound->child_sound = source; sound->start = start; sound->end = end; sound->type = SOUND_TYPE_LIMITER; - sound_load(CTX_data_main(C), sound); + sound_load(bmain, sound); if(!sound->playback_handle) { - free_libblock(&CTX_data_main(C)->sound, sound); + free_libblock(&bmain->sound, sound); sound = NULL; } @@ -254,13 +254,13 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa } #endif -void sound_delete(struct bContext *C, struct bSound* sound) +void sound_delete(struct Main *bmain, struct bSound* sound) { if(sound) { sound_free(sound); - free_libblock(&CTX_data_main(C)->sound, sound); + free_libblock(&bmain->sound, sound); } } @@ -538,10 +538,11 @@ void sound_stop_scene(struct Scene *scene) } } -void sound_seek_scene(struct bContext *C) +void sound_seek_scene(struct Main *bmain, struct Scene *scene) { - struct Scene *scene = CTX_data_scene(C); AUD_Status status; + bScreen *screen; + int animation_playing; AUD_lock(); @@ -560,7 +561,12 @@ void sound_seek_scene(struct bContext *C) AUD_pause(scene->sound_scene_handle); } - if(scene->audio.flag & AUDIO_SCRUB && !CTX_wm_screen(C)->animtimer) + animation_playing = 0; + for(screen=bmain->screen.first; screen; screen=screen->id.next) + if(screen->animtimer) + animation_playing = 1; + + if(scene->audio.flag & AUDIO_SCRUB && !animation_playing) { if(scene->audio.flag & AUDIO_SYNC) { @@ -758,7 +764,7 @@ void sound_move_scene_sound(struct Scene *UNUSED(scene), void* UNUSED(handle), i static void sound_start_play_scene(struct Scene *UNUSED(scene)) {} void sound_play_scene(struct Scene *UNUSED(scene)) {} void sound_stop_scene(struct Scene *UNUSED(scene)) {} -void sound_seek_scene(struct bContext *UNUSED(C)) {} +void sound_seek_scene(struct Main *UNUSED(bmain), struct Scene *UNUSED(scene)) {} float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; } int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; } int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; } diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index eaba8343f4d..aa61afbac78 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -41,6 +41,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_sound.h" #include "UI_view2d.h" @@ -76,6 +77,7 @@ static int change_frame_poll(bContext *C) /* Set the new frame number */ static void change_frame_apply(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); /* set the new frame number */ @@ -84,7 +86,7 @@ static void change_frame_apply(bContext *C, wmOperator *op) SUBFRA = 0.f; /* do updates */ - sound_seek_scene(C); + sound_seek_scene(bmain, scene); WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); } diff --git a/source/blender/editors/include/ED_sequencer.h b/source/blender/editors/include/ED_sequencer.h index cd22a5c6ca4..5be1403c97b 100644 --- a/source/blender/editors/include/ED_sequencer.h +++ b/source/blender/editors/include/ED_sequencer.h @@ -31,8 +31,4 @@ #define SEQ_ZOOM_FAC(szoom) ((szoom) > 0.0f)? (szoom) : ((szoom) == 0.0f)? (1.0f) : (-1.0f/(szoom)) - -/* in space_sequencer.c, for rna update function */ -void ED_sequencer_update_view(bContext *C, int view); - #endif /* ED_SEQUENCER_H */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 66a67d7c4f2..b199f54cde1 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1732,14 +1732,16 @@ static void SCREEN_OT_region_scale(wmOperatorType *ot) /* function to be called outside UI context, or for redo */ static int frame_offset_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); + Scene *scene= CTX_data_scene(C); int delta; delta = RNA_int_get(op->ptr, "delta"); - CTX_data_scene(C)->r.cfra += delta; - CTX_data_scene(C)->r.subframe = 0.f; + scene->r.cfra += delta; + scene->r.subframe = 0.f; - sound_seek_scene(C); + sound_seek_scene(bmain, scene); WM_event_add_notifier(C, NC_SCENE|ND_FRAME, CTX_data_scene(C)); @@ -1764,6 +1766,7 @@ static void SCREEN_OT_frame_offset(wmOperatorType *ot) /* function to be called outside UI context, or for redo */ static int frame_jump_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); wmTimer *animtimer= CTX_wm_screen(C)->animtimer; @@ -1787,7 +1790,7 @@ static int frame_jump_exec(bContext *C, wmOperator *op) else CFRA= PSFRA; - sound_seek_scene(C); + sound_seek_scene(bmain, scene); WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); } @@ -1816,6 +1819,7 @@ static void SCREEN_OT_frame_jump(wmOperatorType *ot) /* function to be called outside UI context, or for redo */ static int keyframe_jump_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); bDopeSheet ads= {NULL}; @@ -1870,7 +1874,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) /* free temp stuff */ BLI_dlrbTree_free(&keys); - sound_seek_scene(C); + sound_seek_scene(bmain, scene); WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); @@ -2796,6 +2800,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e bScreen *screen= CTX_wm_screen(C); if(screen->animtimer && screen->animtimer==event->customdata) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); wmTimer *wt= screen->animtimer; ScreenAnimData *sad= wt->customdata; @@ -2872,7 +2877,7 @@ static int screen_animation_step(bContext *C, wmOperator *UNUSED(op), wmEvent *e } if (sad->flag & ANIMPLAY_FLAG_JUMPED) - sound_seek_scene(C); + sound_seek_scene(bmain, scene); /* since we follow drawflags, we can't send notifier but tag regions ourselves */ ED_update_for_newframe(CTX_data_main(C), scene, screen, 1); diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 70884d47c23..72dbbd9da9a 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -119,7 +119,7 @@ static int open_exec(bContext *C, wmOperator *op) info = AUD_getInfo(sound->playback_handle); if (info.specs.channels == AUD_CHANNELS_INVALID) { - sound_delete(C, sound); + sound_delete(bmain, sound); if(op->customdata) MEM_freeN(op->customdata); BKE_report(op->reports, RPT_ERROR, "Unsupported audio format"); return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 0d7cdf94bc7..46918407447 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -41,6 +41,7 @@ #include "BLI_utildefines.h" #include "BKE_context.h" +#include "BKE_main.h" #include "BKE_sound.h" #include "UI_view2d.h" @@ -70,6 +71,7 @@ /* Set the new frame number */ static void graphview_cursor_apply(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); SpaceIpo *sipo= CTX_wm_space_graph(C); @@ -78,7 +80,7 @@ static void graphview_cursor_apply(bContext *C, wmOperator *op) */ CFRA= RNA_int_get(op->ptr, "frame"); SUBFRA=0.f; - sound_seek_scene(C); + sound_seek_scene(bmain, scene); /* set the cursor value */ sipo->cursorVal= RNA_float_get(op->ptr, "value"); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index df347506e74..e7673651546 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2174,7 +2174,7 @@ static int sequencer_view_toggle_exec(bContext *C, wmOperator *UNUSED(op)) sseq->view++; if (sseq->view > SEQ_VIEW_SEQUENCE_PREVIEW) sseq->view = SEQ_VIEW_SEQUENCE; - ED_sequencer_update_view(C, sseq->view); + ED_area_tag_refresh(CTX_wm_area(C)); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 36471c7ffcf..5a0369ef80b 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -98,61 +98,6 @@ static ARegion *sequencer_find_region(ScrArea *sa, short type) return ar; } -void ED_sequencer_update_view(bContext *C, int view) -{ - ScrArea *sa= CTX_wm_area(C); - - ARegion *ar_main= sequencer_find_region(sa, RGN_TYPE_WINDOW); - ARegion *ar_preview= sequencer_find_region(sa, RGN_TYPE_PREVIEW); - - switch (view) { - case SEQ_VIEW_SEQUENCE: - if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) { - ar_main->flag &= ~RGN_FLAG_HIDDEN; - ar_main->v2d.flag &= ~V2D_IS_INITIALISED; - } - if (ar_preview && !(ar_preview->flag & RGN_FLAG_HIDDEN)) { - ar_preview->flag |= RGN_FLAG_HIDDEN; - ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; - WM_event_remove_handlers(C, &ar_preview->handlers); - } - if (ar_main) ar_main->alignment= RGN_ALIGN_NONE; - if (ar_preview) ar_preview->alignment= RGN_ALIGN_NONE; - break; - case SEQ_VIEW_PREVIEW: - if (ar_main && !(ar_main->flag & RGN_FLAG_HIDDEN)) { - ar_main->flag |= RGN_FLAG_HIDDEN; - ar_main->v2d.flag &= ~V2D_IS_INITIALISED; - WM_event_remove_handlers(C, &ar_main->handlers); - } - if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) { - ar_preview->flag &= ~RGN_FLAG_HIDDEN; - ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; - ar_preview->v2d.cur = ar_preview->v2d.tot; - } - if (ar_main) ar_main->alignment= RGN_ALIGN_NONE; - if (ar_preview) ar_preview->alignment= RGN_ALIGN_NONE; - break; - case SEQ_VIEW_SEQUENCE_PREVIEW: - if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) { - ar_main->flag &= ~RGN_FLAG_HIDDEN; - ar_main->v2d.flag &= ~V2D_IS_INITIALISED; - } - if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) { - ar_preview->flag &= ~RGN_FLAG_HIDDEN; - ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; - ar_preview->v2d.cur = ar_preview->v2d.tot; - } - if (ar_main) ar_main->alignment= RGN_ALIGN_NONE; - if (ar_preview) ar_preview->alignment= RGN_ALIGN_TOP; - break; - } - - ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa); - ED_area_tag_redraw(sa); -} - - /* ******************** default callbacks for sequencer space ***************** */ static SpaceLink *sequencer_new(const bContext *C) @@ -256,6 +201,88 @@ static void sequencer_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(s } +static void sequencer_refresh(const bContext *C, ScrArea *sa) +{ + wmWindowManager *wm= CTX_wm_manager(C); + wmWindow *window= CTX_wm_window(C); + SpaceSeq *sseq= (SpaceSeq *)sa->spacedata.first; + ARegion *ar_main= sequencer_find_region(sa, RGN_TYPE_WINDOW); + ARegion *ar_preview= sequencer_find_region(sa, RGN_TYPE_PREVIEW); + int view_changed= 0; + + switch (sseq->view) { + case SEQ_VIEW_SEQUENCE: + if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) { + ar_main->flag &= ~RGN_FLAG_HIDDEN; + ar_main->v2d.flag &= ~V2D_IS_INITIALISED; + view_changed= 1; + } + if (ar_preview && !(ar_preview->flag & RGN_FLAG_HIDDEN)) { + ar_preview->flag |= RGN_FLAG_HIDDEN; + ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; + WM_event_remove_handlers((bContext*)C, &ar_preview->handlers); + view_changed= 1; + } + if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) { + ar_main->alignment= RGN_ALIGN_NONE; + view_changed= 1; + } + if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) { + ar_preview->alignment= RGN_ALIGN_NONE; + view_changed= 1; + } + break; + case SEQ_VIEW_PREVIEW: + if (ar_main && !(ar_main->flag & RGN_FLAG_HIDDEN)) { + ar_main->flag |= RGN_FLAG_HIDDEN; + ar_main->v2d.flag &= ~V2D_IS_INITIALISED; + WM_event_remove_handlers((bContext*)C, &ar_main->handlers); + view_changed= 1; + } + if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) { + ar_preview->flag &= ~RGN_FLAG_HIDDEN; + ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; + ar_preview->v2d.cur = ar_preview->v2d.tot; + view_changed= 1; + } + if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) { + ar_main->alignment= RGN_ALIGN_NONE; + view_changed= 1; + } + if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) { + ar_preview->alignment= RGN_ALIGN_NONE; + view_changed= 1; + } + break; + case SEQ_VIEW_SEQUENCE_PREVIEW: + if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) { + ar_main->flag &= ~RGN_FLAG_HIDDEN; + ar_main->v2d.flag &= ~V2D_IS_INITIALISED; + view_changed= 1; + } + if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) { + ar_preview->flag &= ~RGN_FLAG_HIDDEN; + ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; + ar_preview->v2d.cur = ar_preview->v2d.tot; + view_changed= 1; + } + if (ar_main && ar_main->alignment != RGN_ALIGN_TOP) { + ar_main->alignment= RGN_ALIGN_NONE; + view_changed= 1; + } + if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) { + ar_preview->alignment= RGN_ALIGN_TOP; + view_changed= 1; + } + break; + } + + if(view_changed) { + ED_area_initialize(wm, window, sa); + ED_area_tag_redraw(sa); + } +} + static SpaceLink *sequencer_duplicate(SpaceLink *sl) { SpaceSeq *sseqn= MEM_dupallocN(sl); @@ -516,6 +543,7 @@ void ED_spacetype_sequencer(void) st->operatortypes= sequencer_operatortypes; st->keymap= sequencer_keymap; st->dropboxes= sequencer_dropboxes; + st->refresh= sequencer_refresh; /* regions: main window */ art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region"); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 3c60a3b4cd7..8c2f473c65e 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -439,11 +439,10 @@ static void rna_Scene_preview_range_end_frame_set(PointerRNA *ptr, int value) data->r.pefra= value; } -static void rna_Scene_frame_update(bContext *C, PointerRNA *UNUSED(ptr)) +static void rna_Scene_frame_update(Main *bmain, Scene *UNUSED(current_scene), PointerRNA *ptr) { - //Scene *scene= ptr->id.data; - //ED_update_for_newframe(C); - sound_seek_scene(C); + Scene *scene= (Scene*)ptr->id.data; + sound_seek_scene(bmain, scene); } static PointerRNA rna_Scene_active_keying_set_get(PointerRNA *ptr) @@ -3298,7 +3297,6 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_range(prop, MINAFRAME, MAXFRAME); RNA_def_property_int_funcs(prop, NULL, "rna_Scene_current_frame_set", NULL); RNA_def_property_ui_text(prop, "Current Frame", "Current Frame, to update animation data from python frame_set() instead"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SCENE|ND_FRAME, "rna_Scene_frame_update"); prop= RNA_def_property(srna, "frame_subframe", PROP_FLOAT, PROP_TIME); diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index be4adb405e2..59707f05e6f 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -68,13 +68,13 @@ static void rna_Screen_scene_set(PointerRNA *ptr, PointerRNA value) sc->newscene= value.data; } -static void rna_Screen_scene_update(bContext *C, PointerRNA *ptr) +static void rna_Screen_scene_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { bScreen *sc= (bScreen*)ptr->data; /* exception: can't set screens inside of area/region handers */ if(sc->newscene) { - WM_event_add_notifier(C, NC_SCENE|ND_SCENEBROWSE, sc->newscene); + WM_main_add_notifier(NC_SCENE|ND_SCENEBROWSE, sc->newscene); sc->newscene= NULL; } } @@ -231,7 +231,6 @@ static void rna_def_screen(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL); RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL, NULL); RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, 0, "rna_Screen_scene_update"); /* collections */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 35360910015..35115b40d59 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -805,10 +805,9 @@ static void rna_SpaceDopeSheetEditor_mode_update(Main *UNUSED(bmain), Scene *sce /* Space Graph Editor */ -static void rna_SpaceGraphEditor_display_mode_update(bContext *C, PointerRNA *UNUSED(ptr)) +static void rna_SpaceGraphEditor_display_mode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - //SpaceIpo *sipo= (SpaceIpo*)(ptr->data); - ScrArea *sa= CTX_wm_area(C); + ScrArea *sa= rna_area_from_space(ptr); /* after changing view mode, must force recalculation of F-Curve colors * which can only be achieved using refresh as opposed to redraw @@ -822,11 +821,10 @@ static int rna_SpaceGraphEditor_has_ghost_curves_get(PointerRNA *ptr) return (sipo->ghostCurves.first != NULL); } -static void rna_Sequencer_display_mode_update(bContext *C, PointerRNA *ptr) +static void rna_Sequencer_view_type_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { - int view = RNA_enum_get(ptr, "view_type"); - - ED_sequencer_update_view(C, view); + ScrArea *sa= rna_area_from_space(ptr); + ED_area_tag_refresh(sa); } static float rna_BackgroundImage_opacity_get(PointerRNA *ptr) @@ -1689,8 +1687,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "view"); RNA_def_property_enum_items(prop, view_type_items); RNA_def_property_ui_text(prop, "View Type", "The type of the Sequencer view (sequencer, preview or both)"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); - RNA_def_property_update(prop, 0, "rna_Sequencer_display_mode_update"); + RNA_def_property_update(prop, 0, "rna_Sequencer_view_type_update"); /* display type, fairly important */ prop= RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE); @@ -1987,7 +1984,6 @@ static void rna_def_space_graph(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, mode_items); RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed"); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, "rna_SpaceGraphEditor_display_mode_update"); /* display */ diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 4c07a89a42f..a595b121d1a 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -482,13 +482,13 @@ static void rna_Window_screen_set(PointerRNA *ptr, PointerRNA value) win->newscreen= value.data; } -static void rna_Window_screen_update(bContext *C, PointerRNA *ptr) +static void rna_Window_screen_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { wmWindow *win= (wmWindow*)ptr->data; /* exception: can't set screens inside of area/region handers */ if(win->newscreen) { - WM_event_add_notifier(C, NC_SCREEN|ND_SCREENBROWSE, win->newscreen); + WM_main_add_notifier(NC_SCREEN|ND_SCREENBROWSE, win->newscreen); win->newscreen= NULL; } } @@ -1454,7 +1454,6 @@ static void rna_def_window(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the window"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", NULL, NULL); - RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, 0, "rna_Window_screen_update"); } |