GPv3: Expose "Use Lights" option in the object data properties
Adds a `use_lights` option to the layer in RNA and exposes the setting in the object data properties under the layer opacity.
This commit is contained in:
@@ -139,6 +139,9 @@ class DATA_PT_grease_pencil_layers(DataButtonsPanel, Panel):
|
||||
row = layout.row(align=True)
|
||||
row.prop(layer, "opacity", text="Opacity", slider=True)
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(layer, "use_lights", text="Lights")
|
||||
|
||||
|
||||
class DATA_PT_grease_pencil_layer_masks(LayerDataButtonsPanel, Panel):
|
||||
bl_label = "Masks"
|
||||
|
||||
@@ -592,9 +592,10 @@ void legacy_gpencil_to_grease_pencil(Main &bmain, GreasePencil &grease_pencil, b
|
||||
new_layer.set_locked((gpl->flag & GP_LAYER_LOCKED) != 0);
|
||||
new_layer.set_selected((gpl->flag & GP_LAYER_SELECT) != 0);
|
||||
SET_FLAG_FROM_TEST(
|
||||
new_layer.base.flag, (gpl->flag & GP_LAYER_FRAMELOCK), GP_LAYER_TREE_NODE_MUTE);
|
||||
SET_FLAG_FROM_TEST(
|
||||
new_layer.base.flag, (gpl->flag & GP_LAYER_USE_LIGHTS), GP_LAYER_TREE_NODE_USE_LIGHTS);
|
||||
new_layer.base.flag, (gpl->flag & GP_LAYER_FRAMELOCK) != 0, GP_LAYER_TREE_NODE_MUTE);
|
||||
SET_FLAG_FROM_TEST(new_layer.base.flag,
|
||||
(gpl->flag & GP_LAYER_USE_LIGHTS) != 0,
|
||||
GP_LAYER_TREE_NODE_USE_LIGHTS);
|
||||
SET_FLAG_FROM_TEST(new_layer.base.flag,
|
||||
(gpl->onion_flag & GP_LAYER_ONIONSKIN) == 0,
|
||||
GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING);
|
||||
|
||||
@@ -417,6 +417,13 @@ static void rna_def_grease_pencil_layer(BlenderRNA *brna)
|
||||
"The visibility of drawings on this layer is affected by the layers in its masks list");
|
||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
|
||||
|
||||
prop = RNA_def_property(srna, "use_lights", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_USE_LIGHTS);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Use Lights", "Enable the use of lights on stroke and fill materials");
|
||||
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
|
||||
|
||||
/* pass index for compositing and modifiers */
|
||||
prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_ui_text(prop, "Pass Index", "Index number for the \"Layer Index\" pass");
|
||||
|
||||
Reference in New Issue
Block a user