[Bf-blender-cvs] [3808776a862] greasepencil-object: Move Overlay options to View3DOverlay
Antonio Vazquez
noreply at git.blender.org
Fri Jul 13 10:34:01 CEST 2018
Commit: 3808776a862a9195209ea0c7bbba80c2fc4fd77c
Author: Antonio Vazquez
Date: Fri Jul 13 10:28:02 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB3808776a862a9195209ea0c7bbba80c2fc4fd77c
Move Overlay options to View3DOverlay
It's better to keep all overlays in the same RNA.
===================================================================
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/makesrna/intern/rna_space.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 5fca5900025..e4570d64ae3 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -4621,23 +4621,24 @@ class VIEW3D_PT_overlay_gpencil_options(Panel):
def draw(self, context):
layout = self.layout
view = context.space_data
+ overlay = view.overlay
- layout.prop(view, "use_gpencil_paper", text="Drawing Paper")
+ layout.prop(overlay, "use_gpencil_paper", text="Drawing Paper")
- if view.use_gpencil_paper:
- layout.prop(view, "gpencil_paper_color", text="Color")
- layout.prop(view, "gpencil_paper_opacity", text="Opacity")
+ if overlay.use_gpencil_paper:
+ layout.prop(overlay, "gpencil_paper_color", text="Color")
+ layout.prop(overlay, "gpencil_paper_opacity", text="Opacity")
- layout.prop(view, "use_gpencil_grid", text="Display Paper Grid")
- if view.use_gpencil_grid:
- layout.prop(view, "gpencil_grid_size", text="")
+ layout.prop(overlay, "use_gpencil_grid", text="Display Paper Grid")
+ if overlay.use_gpencil_grid:
+ layout.prop(overlay, "gpencil_grid_size", text="")
- layout.prop(view, "use_gpencil_onion_skin", text="Onion Skin")
+ layout.prop(overlay, "use_gpencil_onion_skin", text="Onion Skin")
if context.object.mode in {'GPENCIL_EDIT', 'GPENCIL_SCULPT', 'GPENCIL_WEIGHT'}:
- layout.prop(view, "use_gpencil_edit_lines", text="Show Edit Lines")
- layout.prop(view, "use_gpencil_multiedit_line_only", text="Only Edit Lines In Multiframe")
- layout.prop(view, "vertex_opacity", text="Vertex Opacity", slider=True)
+ layout.prop(overlay, "use_gpencil_edit_lines", text="Show Edit Lines")
+ layout.prop(overlay, "use_gpencil_multiedit_line_only", text="Only Edit Lines In Multiframe")
+ layout.prop(overlay, "vertex_opacity", text="Vertex Opacity", slider=True)
class VIEW3D_PT_quad_view(Panel):
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 2a83e3c89f6..e6f21b8fcc6 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2581,12 +2581,6 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like manipulators and outlines");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
- prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_ANNOTATION);
- RNA_def_property_ui_text(prop, "Show Annotation",
- "Show annotations for this view");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
-
prop = RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view");
@@ -2803,6 +2797,76 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Weight Paint Opacity", "Opacity of the weight paint mode overlay");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ /* grease pencil paper settings */
+ prop = RNA_def_property(srna, "show_annotation", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SHOW_ANNOTATION);
+ RNA_def_property_ui_text(prop, "Show Annotation",
+ "Show annotations for this view");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "use_gpencil_paper", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_PAPER);
+ RNA_def_property_ui_text(prop, "Use Paper",
+ "Cover all viewport with a full color layer to improve visibility while drawing over complex scenes");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "use_gpencil_grid", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_GRID);
+ RNA_def_property_ui_text(prop, "Use Grid",
+ "Draw a grid over grease pencil paper");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "gpencil_grid_size", PROP_INT, PROP_PIXEL);
+ RNA_def_property_int_sdna(prop, NULL, "gpencil_grid_size");
+ RNA_def_property_range(prop, 15, INT_MAX);
+ RNA_def_property_int_default(prop, 50);
+ RNA_def_property_ui_text(prop, "Size", "Grid size");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ /* Paper Color */
+ static float default_paper1[3] = { 1.0f, 1.0f, 1.0f };
+ prop = RNA_def_property(srna, "gpencil_paper_color", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "gpencil_paper_color");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_float_array_default(prop, default_paper1);
+ RNA_def_property_ui_text(prop, "Paper Color", "Color for paper");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ /* Paper opacity factor */
+ prop = RNA_def_property(srna, "gpencil_paper_opacity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "gpencil_paper_color[3]");
+ RNA_def_property_range(prop, 0.0, 1.0f);
+ RNA_def_property_float_default(prop, 0.7f);
+ RNA_def_property_ui_text(prop, "Opacity", "Paper opacity");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ /* show edit lines */
+ prop = RNA_def_property(srna, "use_gpencil_edit_lines", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_EDIT_LINES);
+ RNA_def_property_ui_text(prop, "Edit Lines", "Show edit lines when edit strokes");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
+
+ prop = RNA_def_property(srna, "use_gpencil_multiedit_line_only", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_MULTIEDIT_LINES);
+ RNA_def_property_ui_text(prop, "Lines Only", "Show only edit lines for additional frames");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
+
+ /* main grease pencil onion switch */
+ prop = RNA_def_property(srna, "use_gpencil_onion_skin", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_ONION_SKIN);
+ RNA_def_property_ui_text(prop, "Onion Skins", "Show ghosts of the frames before and after the current frame");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
+
+ /* vertex opacity */
+ prop = RNA_def_property(srna, "vertex_opacity", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "vertex_opacity");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Vertex Opacity", "Opacity for edit vertices");
+ RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
+ RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_GPencil_update");
+
}
static void rna_def_space_view3d(BlenderRNA *brna)
@@ -3052,70 +3116,6 @@ static void rna_def_space_view3d(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "FX Options", "Options used for real time compositing");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
- /* grease pencil paper settings */
- prop = RNA_def_property(srna, "use_gpencil_paper", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_PAPER);
- RNA_def_property_ui_text(prop, "Use Paper",
- "Cover all viewport with a full color layer to improve visibility while drawing over complex scenes");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
-
- prop = RNA_def_property(srna, "use_gpencil_grid", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_GRID);
- RNA_def_property_ui_text(prop, "Use Grid",
- "Draw a grid over grease pencil paper");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
-
- prop = RNA_def_property(srna, "gpencil_grid_size", PROP_INT, PROP_PIXEL);
- RNA_def_property_int_sdna(prop, NULL, "gpencil_grid_size");
- RNA_def_property_range(prop, 15, INT_MAX);
- RNA_def_property_int_default(prop, 50);
- RNA_def_property_ui_text(prop, "Size", "Grid size");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
-
- /* Paper Color */
- static float default_paper1[3] = { 1.0f, 1.0f, 1.0f };
- prop = RNA_def_property(srna, "gpencil_paper_color", PROP_FLOAT, PROP_COLOR_GAMMA);
- RNA_def_property_float_sdna(prop, NULL, "gpencil_paper_color");
- RNA_def_property_array(prop, 3);
- RNA_def_property_range(prop, 0.0f, 1.0f);
- RNA_def_property_float_array_default(prop, default_paper1);
- RNA_def_property_ui_text(prop, "Paper Color", "Color for paper");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
-
- /* Paper opacity factor */
- prop = RNA_def_property(srna, "gpencil_paper_opacity", PROP_FLOAT, PROP_NONE);
- RNA_def_property_float_sdna(prop, NULL, "gpencil_paper_color[3]");
- RNA_def_property_range(prop, 0.0, 1.0f);
- RNA_def_property_float_default(prop, 0.7f);
- RNA_def_property_ui_text(prop, "Opacity", "Paper opacity");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
-
- /* show edit lines */
- prop = RNA_def_property(srna, "use_gpencil_edit_lines", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_EDIT_LINES);
- RNA_def_property_ui_text(prop, "Edit Lines", "Show edit lines when edit strokes");
- RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update");
-
- prop = RNA_def_property(srna, "use_gpencil_multiedit_line_only", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_MULTIEDIT_LINES);
- RNA_def_property_ui_text(prop, "Lines Only", "Show only edit lines for additional frames");
- RNA
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list