[Bf-blender-cvs] [d6eccc1361b] greasepencil-object: Change some old grease pencil code to annotation

Antonio Vazquez noreply at git.blender.org
Thu Jul 12 19:50:44 CEST 2018


Commit: d6eccc1361b071ba0789178e54d7fd451a01bd5d
Author: Antonio Vazquez
Date:   Thu Jul 12 19:50:33 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBd6eccc1361b071ba0789178e54d7fd451a01bd5d

Change some old grease pencil code to annotation

Fixed the error in annotation panel for other editors.

The main Notes switch for 3D View has been removed of the Notes panel because must be in the overlays.

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

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/editors/space_clip/space_clip.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index b93b1e4c855..c076b7f3480 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -744,7 +744,8 @@ class GreasePencilDataPanel:
 
     @staticmethod
     def draw_header(self, context):
-        self.layout.prop(context.space_data, "show_annotation", text="")
+        if context.space_data.type != 'VIEW_3D':
+            self.layout.prop(context.space_data, "show_annotation", text="")
 
     @staticmethod
     def draw(self, context):
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 89ad7521a1f..f2f2e7d7881 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -1709,7 +1709,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
 						case SPACE_CLIP:
 						{
 							SpaceClip *sclip = (SpaceClip *)sl;
-							sclip->flag |= SC_SHOW_GPENCIL;
+							sclip->flag |= SC_SHOW_ANNOTATION;
 							break;
 						}
 					}
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index 4ac9010d3b5..2bfede79644 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -236,7 +236,7 @@ static SpaceLink *clip_new(const ScrArea *sa, const Scene *scene)
 	sc = MEM_callocN(sizeof(SpaceClip), "initclip");
 	sc->spacetype = SPACE_CLIP;
 	sc->flag = SC_SHOW_MARKER_PATTERN | SC_SHOW_TRACK_PATH |
-	           SC_SHOW_GRAPH_TRACKS_MOTION | SC_SHOW_GRAPH_FRAMES | SC_SHOW_GPENCIL;
+	           SC_SHOW_GRAPH_TRACKS_MOTION | SC_SHOW_GRAPH_FRAMES | SC_SHOW_ANNOTATION;
 	sc->zoom = 1.0f;
 	sc->path_length = 20;
 	sc->scopes.track_preview_height = 120;
@@ -1196,7 +1196,7 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
 
 	clip_draw_cache_and_notes(C, sc, ar);
 
-	if (sc->flag & SC_SHOW_GPENCIL) {
+	if (sc->flag & SC_SHOW_ANNOTATION) {
 		/* Grease Pencil */
 		clip_draw_grease_pencil((bContext *)C, true);
 	}
@@ -1204,7 +1204,7 @@ static void clip_main_region_draw(const bContext *C, ARegion *ar)
 	/* reset view matrix */
 	UI_view2d_view_restore(C);
 
-	if (sc->flag & SC_SHOW_GPENCIL) {
+	if (sc->flag & SC_SHOW_ANNOTATION) {
 		/* draw Grease Pencil - screen space only */
 		clip_draw_grease_pencil((bContext *)C, false);
 	}
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 45f2c472887..5404f4160fd 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -1347,7 +1347,7 @@ typedef enum eSpaceClip_Flag {
 	SC_SHOW_GRID                = (1 << 9),
 	SC_SHOW_STABLE              = (1 << 10),
 	SC_MANUAL_CALIBRATION       = (1 << 11),
-	SC_SHOW_GPENCIL             = (1 << 12),
+	SC_SHOW_ANNOTATION          = (1 << 12),
 	SC_SHOW_FILTERS             = (1 << 13),
 	SC_SHOW_GRAPH_FRAMES        = (1 << 14),
 	SC_SHOW_GRAPH_TRACKS_MOTION = (1 << 15),
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index f31ec6a1f5c..2a83e3c89f6 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -3420,7 +3420,7 @@ static void rna_def_space_image(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
 
-	prop = RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
+	prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SHOW_GPENCIL);
 	RNA_def_property_ui_text(prop, "Show Annotation",
 	                         "Show annotations for this view");
@@ -3625,7 +3625,7 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
 
-	prop = RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
+	prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_SHOW_GPENCIL);
 	RNA_def_property_ui_text(prop, "Show Annotation",
 	                         "Show annotations for this view");
@@ -4772,7 +4772,7 @@ static void rna_def_space_node(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, "rna_SpaceNodeEditor_show_backdrop_update");
 
-	prop = RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
+	prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_SHOW_GPENCIL);
 	RNA_def_property_ui_text(prop, "Show Annotation",
 	                         "Show annotations for this view");
@@ -4840,8 +4840,8 @@ static void rna_def_space_clip(BlenderRNA *brna)
 	};
 
 	static const EnumPropertyItem gpencil_source_items[] = {
-		{SC_GPENCIL_SRC_CLIP, "CLIP", 0, "Clip", "Show grease pencil data-block which belongs to movie clip"},
-		{SC_GPENCIL_SRC_TRACK, "TRACK", 0, "Track", "Show grease pencil data-block which belongs to active track"},
+		{SC_GPENCIL_SRC_CLIP, "CLIP", 0, "Clip", "Show annotation data-block which belongs to movie clip"},
+		{SC_GPENCIL_SRC_TRACK, "TRACK", 0, "Track", "Show annotation data-block which belongs to active track"},
 		{0, NULL, 0, NULL, NULL}
 	};
 
@@ -4991,9 +4991,9 @@ static void rna_def_space_clip(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Manual Calibration", "Use manual calibration helpers");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL);
 
-	/* show grease pencil */
-	prop = RNA_def_property(srna, "show_grease_pencil", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_GPENCIL);
+	/* show annotation */
+	prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", SC_SHOW_ANNOTATION);
 	RNA_def_property_ui_text(prop, "Show Annotation",
 	                         "Show annotations for this view");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL);



More information about the Bf-blender-cvs mailing list