[Bf-blender-cvs] [f51c34ec595] greasepencil-object: GP: Move Solo Mode to Layer level
Antonioya
noreply at git.blender.org
Sun Jan 6 16:41:11 CET 2019
Commit: f51c34ec595dd05069d3885320d92a4847c24d14
Author: Antonioya
Date: Sun Jan 6 16:12:39 2019 +0100
Branches: greasepencil-object
https://developer.blender.org/rBf51c34ec595dd05069d3885320d92a4847c24d14
GP: Move Solo Mode to Layer level
WIP: Still pending the final UI location and name.
===================================================================
M release/scripts/startup/bl_ui/properties_data_gpencil.py
M release/scripts/startup/bl_ui/space_topbar.py
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M source/blender/makesdna/DNA_gpencil_types.h
M source/blender/makesdna/DNA_scene_types.h
M source/blender/makesrna/intern/rna_gpencil.c
M source/blender/makesrna/intern/rna_scene.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index b6347afb13f..8fbc2655ef1 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -145,6 +145,9 @@ class DATA_PT_gpencil_datapanel(Panel):
srow.prop(gpl, "clamp_layer", text="",
icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
+ srow = col.row(align=True)
+ srow.prop(gpl, "use_solo_mode", text="Display Only Keyframes", icon='TIME')
+
col = row.column()
sub = col.column(align=True)
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index b9de344d687..8821a7e5dc6 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -507,6 +507,9 @@ class TOPBAR_PT_gpencil_layers(Panel):
srow.prop(gpl, "clamp_layer", text="",
icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
+ srow = col.row(align=True)
+ srow.prop(gpl, "use_solo_mode", text="Display Only Keyframes", icon='TIME')
+
col = row.column()
sub = col.column(align=True)
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 1b1acf29618..b0fe98e4ff8 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -82,8 +82,6 @@ class VIEW3D_HT_header(Header):
sub.prop(tool_settings, "use_gpencil_weight_data_add", text="", icon='WPAINT_HLT')
sub.separator(factor=0.4)
sub.prop(tool_settings, "use_gpencil_draw_additive", text="", icon='FREEZE')
- sub.separator(factor=0.4)
- sub.prop(tool_settings, "use_gpencil_solo_mode", text="", icon='TIME')
if gpd.use_stroke_edit_mode:
row = layout.row(align=True)
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 536029c6397..73652ea02e6 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -1544,9 +1544,6 @@ void DRW_gpencil_populate_datablock(
/* check if playing animation */
const bool playing = stl->storage->is_playing;
- const bool is_solomode = GPENCIL_PAINT_MODE(gpd) &&
- (!playing) && (!stl->storage->is_render) &&
- (ts->gpencil_flags & GP_TOOL_FLAG_SOLO_MODE);
GpencilBatchCache *cache = gpencil_batch_cache_get(ob, cfra_eval);
@@ -1572,6 +1569,10 @@ void DRW_gpencil_populate_datablock(
continue;
}
+ const bool is_solomode = GPENCIL_PAINT_MODE(gpd) &&
+ (!playing) && (!stl->storage->is_render) &&
+ (gpl->flag & GP_LAYER_SOLO_MODE);
+
/* filter view layer to gp layers in the same view layer (for compo) */
if ((stl->storage->is_render) && (gpl->viewlayername[0] != '\0')) {
if (!STREQ(view_layer->name, gpl->viewlayername)) {
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 78db7466575..1ef0d281104 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -315,6 +315,8 @@ typedef enum eGPDlayer_Flag {
GP_LAYER_UNLOCK_COLOR = (1 << 12),
/* Mask Layer */
GP_LAYER_USE_MASK = (1 << 13),
+ /* Flag used to display in Paint mode only layers with keyframe */
+ GP_LAYER_SOLO_MODE = (1 << 4),
} eGPDlayer_Flag;
/* bGPDlayer->onion_flag */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 5bd15992946..eb0810a3d08 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -2139,8 +2139,6 @@ typedef enum eGPencil_Flags {
GP_TOOL_FLAG_THUMBNAIL_LIST = (1 << 3),
/* Generate wheight data for new strokes */
GP_TOOL_FLAG_CREATE_WEIGHTS = (1 << 4),
- /* Display in Paint mode only layers with keyframe */
- GP_TOOL_FLAG_SOLO_MODE = (1 << 5),
} eGPencil_Flags;
/* scene->r.simplify_gpencil */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 615a4fedf1c..89d8e54e740 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1272,6 +1272,13 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
"Clamp any pixel outside underlying layers drawing");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
+ /* solo mode: Only display frames with keyframe */
+ prop = RNA_def_property(srna, "use_solo_mode", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SOLO_MODE);
+ RNA_def_property_ui_text(prop, "Solo Mode",
+ "In Paint mode display only layers with keyframe in current frame");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
/* exposed as layers.active */
#if 0
prop = RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 4e2d971b6eb..a79b6a20dc3 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2657,12 +2657,6 @@ static void rna_def_tool_settings(BlenderRNA *brna)
"When draw new strokes, the new stroke is drawn below of all strokes in the layer");
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
- prop = RNA_def_property(srna, "use_gpencil_solo_mode", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_SOLO_MODE);
- RNA_def_property_ui_text(prop, "Solo Mode",
- "In Paint mode display only layers with keyframe in current frame");
- RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
-
prop = RNA_def_property(srna, "use_gpencil_thumbnail_list", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "gpencil_flags", GP_TOOL_FLAG_THUMBNAIL_LIST);
RNA_def_property_ui_text(prop, "Compact List",
More information about the Bf-blender-cvs
mailing list