[Bf-blender-cvs] [e54d571] master: Amendment to previous commit: Add an option to scene strips to disable GPencil

Joshua Leung noreply at git.blender.org
Fri Dec 5 04:41:12 CET 2014


Commit: e54d5711765130cccdc1ab93cb32bb03b4c3890d
Author: Joshua Leung
Date:   Fri Dec 5 16:39:49 2014 +1300
Branches: master
https://developer.blender.org/rBe54d5711765130cccdc1ab93cb32bb03b4c3890d

Amendment to previous commit: Add an option to scene strips to disable GPencil

On second thought, it is probably still worthwhile to be able to disable GPencil
drawing on strips. By default, GPencil strokes are still shown by default now,
but they can be turned off using this option if it turns out that they are
getting in the way (e.g. a director/animator make some planning notes in the shot
at an earlier stage which are hidden for normal display now, but are still there
popping up sproadically during the animatic).

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

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

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

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index d84d772..8826704 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -793,6 +793,8 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
         layout.label(text="Camera Override")
         layout.template_ID(strip, "scene_camera")
 
+        layout.prop(strip, "use_grease_pencil", text="Show Grease Pencil")
+
         if scene:
             layout.prop(scene, "audio_volume", text="Audio Volume")
 
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 06eecc4..ddc0d58 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -2529,6 +2529,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
 	int do_seq;
 	// bool have_seq = false;  /* UNUSED */
 	bool have_comp = false;
+	bool use_gpencil = true;
 	Scene *scene;
 	int is_thread_main = BLI_thread_is_main();
 
@@ -2553,6 +2554,10 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
 		BKE_scene_camera_switch_update(scene);
 		camera = scene->camera;
 	}
+	
+	if (seq->flag & SEQ_SCENE_NO_GPENCIL) {
+		use_gpencil = false;
+	}
 
 	if (have_comp == false && camera == NULL) {
 		scene->r.cfra = oldcfra;
@@ -2586,7 +2591,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context, Sequence *seq
 		ibuf = sequencer_view3d_cb(scene, camera, width, height, IB_rect,
 		                           context->scene->r.seq_prev_type,
 		                           (context->scene->r.seq_flag & R_SEQ_SOLID_TEX) != 0,
-		                           true, true, scene->r.alphamode, err_out);
+		                           use_gpencil, true, scene->r.alphamode, err_out);
 		if (ibuf == NULL) {
 			fprintf(stderr, "seq_render_scene_strip failed to get opengl buffer: %s\n", err_out);
 		}
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index a7288b9..20678bd 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -363,6 +363,9 @@ enum {
 	SEQ_AUDIO_PITCH_ANIMATED    = (1 << 25),
 	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),
 
 	SEQ_INVALID_EFFECT          = (1 << 31),
 };
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index 00f0a6f..dda0e84 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -1846,6 +1846,11 @@ static void rna_def_scene(BlenderRNA *brna)
 	RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll");
 	RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera");
 	RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, "rna_Sequence_update");
+	
+	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, "rna_Sequence_update");
 
 	rna_def_filter_video(srna);
 	rna_def_proxy(srna);




More information about the Bf-blender-cvs mailing list