[Bf-blender-cvs] [ef04fd95717] master: GPencil: Fix missing annotations in VSE strip

Antonio Vazquez noreply at git.blender.org
Thu May 20 20:17:02 CEST 2021


Commit: ef04fd95717d972f294c5ff69a418a7af4504d35
Author: Antonio Vazquez
Date:   Thu May 20 19:36:53 2021 +0200
Branches: master
https://developer.blender.org/rBef04fd95717d972f294c5ff69a418a7af4504d35

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

===================================================================

M	release/scripts/startup/bl_ui/space_sequencer.py
M	source/blender/draw/intern/draw_manager.c
M	source/blender/makesdna/DNA_sequence_types.h
M	source/blender/makesrna/intern/rna_sequencer.c
M	source/blender/sequencer/intern/render.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index f6a03b4769c..b24b6e84939 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -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.
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index c09b4719f3a..37f6bbf52b5 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -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)
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 46ac4435e95..4b95dd41b30 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -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). */
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index d6b2e61eb6d..9ba92431723 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -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);
diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c
index e8e600f910c..9aad76f4c65 100644
--- a/source/blender/sequencer/intern/render.c
+++ b/source/blender/sequencer/intern/render.c
@@ -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;
   }



More information about the Bf-blender-cvs mailing list