[Bf-blender-cvs] [3d7a8062af8] greasepencil-refactor: GPencil: New Use Lights option for Layers
Antonio Vazquez
noreply at git.blender.org
Thu Dec 19 17:23:50 CET 2019
Commit: 3d7a8062af8492ab4e5c963d4b93206028affb7b
Author: Antonio Vazquez
Date: Thu Dec 19 17:23:34 2019 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB3d7a8062af8492ab4e5c963d4b93206028affb7b
GPencil: New Use Lights option for Layers
This switch will be used to enable layer affected by scene lights.
===================================================================
M release/scripts/startup/bl_ui/properties_data_gpencil.py
M release/scripts/startup/bl_ui/space_dopesheet.py
M release/scripts/startup/bl_ui/space_topbar.py
M source/blender/makesdna/DNA_gpencil_types.h
M source/blender/makesrna/intern/rna_gpencil.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 323e2f53953..684909b8d03 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -178,6 +178,9 @@ class DATA_PT_gpencil_layers(DataButtonsPanel, Panel):
col = layout.row(align=True)
col.prop(gpl, "opacity", text="Opacity", slider=True)
+ col = layout.row(align=True)
+ col.prop(gpl, "use_lights")
+
class DATA_PT_gpencil_layer_adjustments(LayerDataButtonsPanel, GreasePencilLayerAdjustmentsPanel, Panel):
bl_label = "Adjustments"
diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 5a73ff094a2..a8d59570885 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -699,6 +699,9 @@ class DOPESHEET_PT_gpencil_mode(LayersDopeSheetPanel, Panel):
row = layout.row(align=True)
row.prop(gpl, "opacity", text="Opacity", slider=True)
+ row = layout.row(align=True)
+ row.prop(gpl, "use_lights")
+
class DOPESHEET_PT_gpencil_layer_adjustments(LayersDopeSheetPanel, GreasePencilLayerAdjustmentsPanel, Panel):
bl_label = "Adjustments"
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 6316744eca9..c7a32cd1606 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -168,6 +168,9 @@ class TOPBAR_PT_gpencil_layers(Panel):
srow.prop(gpl, "mask_layer", text="",
icon='MOD_MASK' if gpl.mask_layer else 'LAYER_ACTIVE')
+ srow = col.row(align=True)
+ srow.prop(gpl, "use_lights")
+
srow = col.row(align=True)
srow.prop(gpl, "use_solo_mode", text="Show Only On Keyframed")
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index ae8b1360b7c..f73db60da6a 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -416,6 +416,8 @@ typedef enum eGPDlayer_Flag {
GP_LAYER_NO_XRAY = (1 << 7),
/* "volumetric" strokes */
GP_LAYER_VOLUMETRIC = (1 << 10),
+ /* Use Scene lights */
+ GP_LAYER_USE_LIGHTS = (1 << 11),
/* Unlock color */
GP_LAYER_UNLOCK_COLOR = (1 << 12),
/* Mask Layer */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index ed218e35f7a..6712c008c6e 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1511,6 +1511,13 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Invert Mask", "Invert the masking behavior of the layer");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+ prop = RNA_def_property(srna, "use_lights", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_USE_LIGHTS);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_ui_text(
+ prop, "Use Scene Lights", "Enable the use of scene lights on stroke and fill materials");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
/* 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);
More information about the Bf-blender-cvs
mailing list