GPencil: Fix missing annotations in VSE strip

Since version 2.80, the annotations of the Scene strip were not displayed in VSE. Also, the UI panel was`Grease Pencil` and must be `Annotation`

The problem was the offscreen render hasn't evil_CTX and the section of the annotation was never called.

Differential Revision: https://developer.blender.org/D11329
This commit is contained in:
Antonio Vazquez 2021-05-20 19:36:53 +02:00
parent 677909cdc3
commit ef04fd9571
5 changed files with 16 additions and 9 deletions

View File

@ -1453,7 +1453,7 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
if strip.scene_input == 'CAMERA':
layout = layout.column(heading="Show")
layout.prop(strip, "use_grease_pencil", text="Grease Pencil")
layout.prop(strip, "use_annotations", text="Annotations")
if scene:
# Warning, this is not a good convention to follow.
# Expose here because setting the alpha from the 'Render' menu is very inconvenient.

View File

@ -1473,6 +1473,14 @@ void DRW_draw_callbacks_post_scene(void)
GPU_depth_test(GPU_DEPTH_LESS_EQUAL);
}
else {
if (v3d && ((v3d->flag2 & V3D_SHOW_ANNOTATION) != 0)) {
GPU_depth_test(GPU_DEPTH_NONE);
/* XXX: as scene->gpd is not copied for COW yet */
ED_annotation_draw_view3d(DEG_get_input_scene(depsgraph), depsgraph, v3d, region, true);
GPU_depth_test(GPU_DEPTH_LESS_EQUAL);
}
}
}
struct DRWTextStore *DRW_text_cache_ensure(void)

View File

@ -517,8 +517,8 @@ enum {
SEQ_AUDIO_PAN_ANIMATED = (1 << 26),
SEQ_AUDIO_DRAW_WAVEFORM = (1 << 27),
/* don't include Grease Pencil in OpenGL previews of Scene strips */
SEQ_SCENE_NO_GPENCIL = (1 << 28),
/* don't include Annotations in OpenGL previews of Scene strips */
SEQ_SCENE_NO_ANNOTATION = (1 << 28),
SEQ_USE_VIEWS = (1 << 29),
/* Access scene strips directly (like a meta-strip). */

View File

@ -2390,11 +2390,10 @@ static void rna_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Input", "Input type to use for the Scene strip");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_use_sequence");
prop = RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_SCENE_NO_GPENCIL);
RNA_def_property_ui_text(
prop, "Use Grease Pencil", "Show Grease Pencil strokes in OpenGL previews");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL);
prop = RNA_def_property(srna, "use_annotations", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SEQ_SCENE_NO_ANNOTATION);
RNA_def_property_ui_text(prop, "Use Annotations", "Show Annotations in OpenGL previews");
RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_invalidate_raw_update");
rna_def_filter_video(srna);
rna_def_proxy(srna);

View File

@ -1508,7 +1508,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context,
goto finally;
}
if (seq->flag & SEQ_SCENE_NO_GPENCIL) {
if (seq->flag & SEQ_SCENE_NO_ANNOTATION) {
use_gpencil = false;
}