Refactor: change light linking object storage be dynamically allocated #108090

Closed
Brecht Van Lommel wants to merge 128 commits from light-linking-dna into cycles-light-linking

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 42 additions and 6 deletions
Showing only changes of commit 9692262b9d - Show all commits

View File

@ -203,16 +203,13 @@ static void change_frame_seq_preview_begin(bContext *C, const wmEvent *event, Sp
}
}
static void change_frame_seq_preview_end(bContext *C, SpaceSeq *sseq)
static void change_frame_seq_preview_end(SpaceSeq *sseq)
{
BLI_assert(sseq != NULL);
UNUSED_VARS_NDEBUG(sseq);
if (ED_sequencer_special_preview_get() != NULL) {
ED_sequencer_special_preview_clear();
}
Scene *scene = CTX_data_scene(C);
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
}
static bool use_sequencer_snapping(bContext *C)
@ -260,6 +257,36 @@ static int change_frame_invoke(bContext *C, wmOperator *op, const wmEvent *event
return OPERATOR_RUNNING_MODAL;
}
static bool need_extra_redraw_after_scrubbing_ends(bContext *C)
{
if (CTX_wm_space_seq(C)) {
/* During scrubbing in the sequencer, a preview of the final video might be drawn. After
* scrubbing, the actual result should be shown again. */
return true;
}
wmWindowManager *wm = CTX_wm_manager(C);
Object *object = CTX_data_active_object(C);
if (object && object->type == OB_GPENCIL_LEGACY) {
LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
bScreen *screen = WM_window_get_active_screen(win);
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
SpaceLink *sl = (SpaceLink *)area->spacedata.first;
if (sl->spacetype == SPACE_VIEW3D) {
View3D *v3d = (View3D *)sl;
if ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) {
if (v3d->gp_flag & V3D_GP_SHOW_ONION_SKIN) {
/* Grease pencil onion skin is not drawn during scrubbing. Redraw is necessary after
* scrubbing ends to show onion skin again. */
return true;
}
}
}
}
}
}
return false;
}
static void change_frame_cancel(bContext *C, wmOperator *UNUSED(op))
{
bScreen *screen = CTX_wm_screen(C);
@ -267,7 +294,12 @@ static void change_frame_cancel(bContext *C, wmOperator *UNUSED(op))
SpaceSeq *sseq = CTX_wm_space_seq(C);
if (sseq != NULL) {
change_frame_seq_preview_end(C, sseq);
change_frame_seq_preview_end(sseq);
}
if (need_extra_redraw_after_scrubbing_ends(C)) {
Scene *scene = CTX_data_scene(C);
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
}
}
@ -323,7 +355,11 @@ static int change_frame_modal(bContext *C, wmOperator *op, const wmEvent *event)
SpaceSeq *sseq = CTX_wm_space_seq(C);
if (sseq != NULL) {
change_frame_seq_preview_end(C, sseq);
change_frame_seq_preview_end(sseq);
}
if (need_extra_redraw_after_scrubbing_ends(C)) {
Scene *scene = CTX_data_scene(C);
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
}
}