GPv3: Lock material layer property #119913

Merged
Falk David merged 13 commits from PratikPB2123/blender:gpv3-lock-material-layer-prop into main 2024-05-31 15:13:49 +02:00
13 changed files with 94 additions and 51 deletions

View File

@ -174,6 +174,7 @@ class GREASE_PENCIL_MT_grease_pencil_add_layer_extra(Menu):
layout = self.layout
ob = context.object
grease_pencil = ob.data
layer = grease_pencil.layers.active_layer
space = context.space_data
if space.type == 'PROPERTIES':
@ -193,6 +194,7 @@ class GREASE_PENCIL_MT_grease_pencil_add_layer_extra(Menu):
layout.separator()
layout.prop(grease_pencil, "use_autolock_layers", text="Autolock Inactive Layers")
layout.prop(layer, "use_locked_material")
class GREASE_PENCIL_MT_group_context_menu(Menu):

View File

@ -185,6 +185,7 @@ class Layer;
void set_selected(bool selected); \
bool use_onion_skinning() const; \
bool use_masks() const; \
bool use_locked_material() const; \
bool is_child_of(const LayerGroup &group) const;
/* Implements the forwarding of the methods defined by #TREENODE_COMMON_METHODS. */
@ -233,6 +234,10 @@ class Layer;
{ \
return this->as_node().use_masks(); \
} \
inline bool class_name::use_locked_material() const \
{ \
return this->as_node().use_locked_material(); \
} \
inline bool class_name::is_child_of(const LayerGroup &group) const \
{ \
return this->as_node().is_child_of(group); \
@ -771,6 +776,10 @@ inline bool TreeNode::use_masks() const
return ((this->flag & GP_LAYER_TREE_NODE_HIDE_MASKS) == 0) &&
(!this->parent_group() || this->parent_group()->as_node().use_masks());
}
inline bool TreeNode::use_locked_material() const
{
return (this->flag & GP_LAYER_TREE_NODE_USE_LOCKED_MATERIAL) != 0;
}
inline bool TreeNode::is_child_of(const LayerGroup &group) const
{
if (const LayerGroup *parent = this->parent_group()) {

View File

@ -461,7 +461,7 @@ static void grease_pencil_edit_batch_ensure(Object &object,
const VArray<bool> cyclic = curves.cyclic();
IndexMaskMemory memory;
const IndexMask editable_strokes = ed::greasepencil::retrieve_editable_strokes(
object, info.drawing, memory);
object, info.drawing, info.layer_index, memory);
/* Assumes that if the ".selection" attribute does not exist, all points are selected. */
const VArray<float> selection_float = *attributes.lookup_or_default<float>(
@ -531,7 +531,7 @@ static void grease_pencil_edit_batch_ensure(Object &object,
const VArray<bool> cyclic = curves.cyclic();
IndexMaskMemory memory;
const IndexMask editable_strokes = ed::greasepencil::retrieve_editable_strokes(
object, info.drawing, memory);
object, info.drawing, info.layer_index, memory);
/* Fill line indices. */
editable_strokes.foreach_index([&](const int curve_i) {

View File

@ -93,7 +93,7 @@ static int grease_pencil_stroke_smooth_exec(bContext *C, wmOperator *op)
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return;
}
@ -255,7 +255,7 @@ static int grease_pencil_stroke_simplify_exec(bContext *C, wmOperator *op)
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return;
}
@ -461,7 +461,7 @@ static int grease_pencil_delete_exec(bContext *C, wmOperator * /*op*/)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask elements = ed::greasepencil::retrieve_editable_and_selected_elements(
*object, info.drawing, selection_domain, memory);
*object, info.drawing, info.layer_index, selection_domain, memory);
if (elements.is_empty()) {
return;
}
@ -608,7 +608,7 @@ static int grease_pencil_dissolve_exec(bContext *C, wmOperator *op)
IndexMaskMemory memory;
const IndexMask points = ed::greasepencil::retrieve_editable_and_selected_points(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (points.is_empty()) {
return;
}
@ -777,7 +777,7 @@ static int grease_pencil_stroke_material_set_exec(bContext *C, wmOperator *op)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return;
}
@ -852,7 +852,7 @@ static int grease_pencil_cyclical_set_exec(bContext *C, wmOperator *op)
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return;
}
@ -927,7 +927,7 @@ static int grease_pencil_set_active_material_exec(bContext *C, wmOperator * /*op
for (const MutableDrawingInfo &info : drawings) {
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
continue;
}
@ -975,7 +975,7 @@ static int grease_pencil_set_uniform_thickness_exec(bContext *C, wmOperator *op)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return;
}
@ -1032,7 +1032,7 @@ static int grease_pencil_set_uniform_opacity_exec(bContext *C, wmOperator *op)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return;
}
@ -1087,7 +1087,7 @@ static int grease_pencil_stroke_switch_direction_exec(bContext *C, wmOperator *
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return;
}
@ -1164,7 +1164,7 @@ static int grease_pencil_caps_set_exec(bContext *C, wmOperator *op)
bke::CurvesGeometry &curves = info.drawing.strokes_for_write();
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return;
}
@ -1339,7 +1339,7 @@ static int grease_pencil_duplicate_exec(bContext *C, wmOperator * /*op*/)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask elements = retrieve_editable_and_selected_elements(
*object, info.drawing, selection_domain, memory);
*object, info.drawing, info.layer_index, selection_domain, memory);
if (elements.is_empty()) {
return;
}
@ -1391,7 +1391,7 @@ static int grease_pencil_clean_loose_exec(bContext *C, wmOperator *op)
IndexMaskMemory memory;
const IndexMask editable_strokes = ed::greasepencil::retrieve_editable_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
const IndexMask curves_to_delete = IndexMask::from_predicate(
editable_strokes, GrainSize(4096), memory, [&](const int i) {
@ -1460,7 +1460,7 @@ static int gpencil_stroke_subdivide_exec(bContext *C, wmOperator *op)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return;
}
@ -1656,7 +1656,7 @@ static int grease_pencil_stroke_reorder_exec(bContext *C, wmOperator *op)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return;
}
@ -2003,7 +2003,8 @@ static bool grease_pencil_separate_layer(bContext &C,
for (const MutableDrawingInfo &info : drawings_src) {
bke::CurvesGeometry &curves_src = info.drawing.strokes_for_write();
IndexMaskMemory memory;
const IndexMask strokes = retrieve_editable_strokes(object_src, info.drawing, memory);
const IndexMask strokes = retrieve_editable_strokes(
object_src, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
continue;
}
@ -2513,10 +2514,11 @@ static int grease_pencil_stroke_merge_by_distance_exec(bContext *C, wmOperator *
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
bke::greasepencil::Drawing &drawing = info.drawing;
IndexMaskMemory memory;
const IndexMask points =
use_unselected ?
ed::greasepencil::retrieve_editable_points(*object, drawing, memory) :
ed::greasepencil::retrieve_editable_and_selected_points(*object, drawing, memory);
const IndexMask points = use_unselected ?
ed::greasepencil::retrieve_editable_points(
*object, drawing, info.layer_index, memory) :
ed::greasepencil::retrieve_editable_and_selected_points(
*object, info.drawing, info.layer_index, memory);
if (points.is_empty()) {
return;
}
@ -2677,7 +2679,7 @@ static int grease_pencil_extrude_exec(bContext *C, wmOperator * /*op*/)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask points_to_extrude = retrieve_editable_and_selected_points(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (points_to_extrude.is_empty()) {
return;
}

View File

@ -278,7 +278,7 @@ static int grease_pencil_material_lock_unselected_exec(bContext *C, wmOperator *
for (const MutableDrawingInfo &info : drawings) {
IndexMaskMemory memory;
const IndexMask strokes = ed::greasepencil::retrieve_editable_and_selected_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (strokes.is_empty()) {
return OPERATOR_CANCELLED;
}

View File

@ -40,7 +40,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask selectable_elements = retrieve_editable_elements(
*object, info.drawing, selection_domain, memory);
*object, info, selection_domain, memory);
if (selectable_elements.is_empty()) {
return;
}
@ -80,7 +80,7 @@ static int select_more_exec(bContext *C, wmOperator * /*op*/)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask selectable_strokes = ed::greasepencil::retrieve_editable_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (selectable_strokes.is_empty()) {
return;
}
@ -118,7 +118,7 @@ static int select_less_exec(bContext *C, wmOperator * /*op*/)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask selectable_strokes = ed::greasepencil::retrieve_editable_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (selectable_strokes.is_empty()) {
return;
}
@ -156,7 +156,7 @@ static int select_linked_exec(bContext *C, wmOperator * /*op*/)
threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
IndexMaskMemory memory;
const IndexMask selectable_strokes = ed::greasepencil::retrieve_editable_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (selectable_strokes.is_empty()) {
return;
}
@ -199,7 +199,7 @@ static int select_random_exec(bContext *C, wmOperator *op)
IndexMaskMemory memory;
const IndexMask selectable_elements = retrieve_editable_elements(
*object, info.drawing, selection_domain, memory);
*object, info, selection_domain, memory);
if (selectable_elements.is_empty()) {
return;
}
@ -298,7 +298,7 @@ static int select_ends_exec(bContext *C, wmOperator *op)
IndexMaskMemory memory;
const IndexMask selectable_strokes = ed::greasepencil::retrieve_editable_strokes(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
if (selectable_strokes.is_empty()) {
return;
}
@ -306,7 +306,7 @@ static int select_ends_exec(bContext *C, wmOperator *op)
curves, selectable_strokes, amount_start, amount_end, true, memory);
const IndexMask selectable_points = ed::greasepencil::retrieve_editable_points(
*object, info.drawing, memory);
*object, info.drawing, info.layer_index, memory);
const bool was_anything_selected = ed::curves::has_anything_selected(curves,
selectable_points);
bke::GSpanAttributeWriter selection = ed::curves::ensure_selection_attribute(

View File

@ -671,6 +671,7 @@ static VectorSet<int> get_hidden_material_indices(Object &object)
IndexMask retrieve_editable_strokes(Object &object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
IndexMaskMemory &memory)
{
using namespace blender;
@ -688,6 +689,8 @@ IndexMask retrieve_editable_strokes(Object &object,
}
const bke::AttributeAccessor attributes = curves.attributes();
GreasePencil &grease_pencil = *static_cast<GreasePencil *>(object.data);
const bke::greasepencil::Layer &layer = *grease_pencil.layers()[layer_index];
const VArray<int> materials = *attributes.lookup<int>("material_index", bke::AttrDomain::Curve);
if (!materials) {
@ -701,7 +704,9 @@ IndexMask retrieve_editable_strokes(Object &object,
return IndexMask::from_predicate(

This should be a function on the node.

This should be a function on the node.

Done, added new function for that

Done, added new function for that
curves_range, GrainSize(4096), memory, [&](const int64_t curve_i) {
const int material_index = materials[curve_i];
return editable_material_indices.contains(material_index);
/* The stroke is editable if the material is editable. If the material is not editable,
* then the stroke is only editable if the layer disables the locked material option. */
return editable_material_indices.contains(material_index) || layer.use_locked_material();
});

Add a comment here: /* The stroke is editable if the material is editable. If the material is not editable, then the stroke is only editable if the layer disables the locked material option. */

Add a comment here: `/* The stroke is editable if the material is editable. If the material is not editable, then the stroke is only editable if the layer disables the locked material option. */`
}
@ -743,6 +748,7 @@ IndexMask retrieve_editable_strokes_by_material(Object &object,
IndexMask retrieve_editable_points(Object &object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
IndexMaskMemory &memory)
{
const bke::CurvesGeometry &curves = drawing.strokes();
@ -759,6 +765,8 @@ IndexMask retrieve_editable_points(Object &object,
}
const bke::AttributeAccessor attributes = curves.attributes();
GreasePencil &grease_pencil = *static_cast<GreasePencil *>(object.data);
const bke::greasepencil::Layer &layer = *grease_pencil.layers()[layer_index];
/* Propagate the material index to the points. */
const VArray<int> materials = *attributes.lookup<int>("material_index", bke::AttrDomain::Point);
@ -773,20 +781,24 @@ IndexMask retrieve_editable_points(Object &object,
return IndexMask::from_predicate(
points_range, GrainSize(4096), memory, [&](const int64_t point_i) {
const int material_index = materials[point_i];
return editable_material_indices.contains(material_index);
/* The stroke is editable if the material is editable. If the material is not editable,
* then the stroke is only editable if the layer disables the locked material option. */
return editable_material_indices.contains(material_index) || layer.use_locked_material();
});
}
IndexMask retrieve_editable_elements(Object &object,
const bke::greasepencil::Drawing &drawing,
const MutableDrawingInfo &info,
const bke::AttrDomain selection_domain,
IndexMaskMemory &memory)
{
const bke::greasepencil::Drawing &drawing = info.drawing;
if (selection_domain == bke::AttrDomain::Curve) {
return ed::greasepencil::retrieve_editable_strokes(object, drawing, memory);
return ed::greasepencil::retrieve_editable_strokes(object, drawing, info.layer_index, memory);
}
else if (selection_domain == bke::AttrDomain::Point) {
return ed::greasepencil::retrieve_editable_points(object, drawing, memory);
return ed::greasepencil::retrieve_editable_points(object, drawing, info.layer_index, memory);
}
return {};
}
@ -853,13 +865,14 @@ IndexMask retrieve_visible_points(Object &object,
IndexMask retrieve_editable_and_selected_strokes(Object &object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
IndexMaskMemory &memory)
{
using namespace blender;
const bke::CurvesGeometry &curves = drawing.strokes();
const IndexMask editable_strokes = retrieve_editable_strokes(object, drawing, memory);
const IndexMask editable_strokes = retrieve_editable_strokes(
object, drawing, layer_index, memory);
const IndexMask selected_strokes = ed::curves::retrieve_selected_curves(curves, memory);
return IndexMask::from_intersection(editable_strokes, selected_strokes, memory);
@ -867,11 +880,12 @@ IndexMask retrieve_editable_and_selected_strokes(Object &object,
IndexMask retrieve_editable_and_selected_points(Object &object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
IndexMaskMemory &memory)
{
const bke::CurvesGeometry &curves = drawing.strokes();
const IndexMask editable_points = retrieve_editable_points(object, drawing, memory);
const IndexMask editable_points = retrieve_editable_points(object, drawing, layer_index, memory);
const IndexMask selected_points = ed::curves::retrieve_selected_points(curves, memory);
return IndexMask::from_intersection(editable_points, selected_points, memory);
@ -879,14 +893,17 @@ IndexMask retrieve_editable_and_selected_points(Object &object,
IndexMask retrieve_editable_and_selected_elements(Object &object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
const bke::AttrDomain selection_domain,
IndexMaskMemory &memory)
{
if (selection_domain == bke::AttrDomain::Curve) {
return ed::greasepencil::retrieve_editable_and_selected_strokes(object, drawing, memory);
return ed::greasepencil::retrieve_editable_and_selected_strokes(
object, drawing, layer_index, memory);
}
else if (selection_domain == bke::AttrDomain::Point) {
return ed::greasepencil::retrieve_editable_and_selected_points(object, drawing, memory);
return ed::greasepencil::retrieve_editable_and_selected_points(
object, drawing, layer_index, memory);
}
return {};
}

View File

@ -272,6 +272,7 @@ Vector<DrawingInfo> retrieve_visible_drawings(const Scene &scene,
IndexMask retrieve_editable_strokes(Object &grease_pencil_object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
IndexMaskMemory &memory);
IndexMask retrieve_editable_strokes_by_material(Object &object,
const bke::greasepencil::Drawing &drawing,
@ -279,9 +280,10 @@ IndexMask retrieve_editable_strokes_by_material(Object &object,
IndexMaskMemory &memory);
IndexMask retrieve_editable_points(Object &object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
IndexMaskMemory &memory);
IndexMask retrieve_editable_elements(Object &object,
const bke::greasepencil::Drawing &drawing,
const MutableDrawingInfo &info,
bke::AttrDomain selection_domain,
IndexMaskMemory &memory);
@ -294,12 +296,15 @@ IndexMask retrieve_visible_points(Object &object,
IndexMask retrieve_editable_and_selected_strokes(Object &grease_pencil_object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
IndexMaskMemory &memory);
IndexMask retrieve_editable_and_selected_points(Object &object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
IndexMaskMemory &memory);
IndexMask retrieve_editable_and_selected_elements(Object &object,
const bke::greasepencil::Drawing &drawing,
int layer_index,
bke::AttrDomain selection_domain,
IndexMaskMemory &memory);

View File

@ -184,7 +184,7 @@ IndexMask point_selection_mask(const GreasePencilStrokeParams &params, IndexMask
const bool is_masking = GPENCIL_ANY_SCULPT_MASK(
eGP_Sculpt_SelectMaskFlag(params.toolsettings.gpencil_selectmode_sculpt));
return (is_masking ? ed::greasepencil::retrieve_editable_and_selected_points(
params.ob_eval, params.drawing, memory) :
params.ob_eval, params.drawing, params.layer_index, memory) :
params.drawing.strokes().points_range());
}

View File

@ -1202,7 +1202,7 @@ static bool do_lasso_select_grease_pencil(const ViewContext *vc,
IndexMaskMemory memory;
const IndexMask elements = ed::greasepencil::retrieve_editable_elements(
*vc->obedit, info.drawing, selection_domain, memory);
*vc->obedit, info, selection_domain, memory);
if (elements.is_empty()) {
continue;
}
@ -3246,7 +3246,7 @@ static bool ed_grease_pencil_select_pick(bContext *C,
IndexMaskMemory memory;
const IndexMask elements = ed::greasepencil::retrieve_editable_elements(
*vc.obedit, info.drawing, selection_domain, memory);
*vc.obedit, info, selection_domain, memory);
if (elements.is_empty()) {
continue;
}
@ -3280,7 +3280,7 @@ static bool ed_grease_pencil_select_pick(bContext *C,
ed::greasepencil::MutableDrawingInfo info = drawings[i];
IndexMaskMemory memory;
const IndexMask elements = ed::greasepencil::retrieve_editable_elements(
*vc.obedit, info.drawing, selection_domain, memory);
*vc.obedit, info, selection_domain, memory);
if (elements.is_empty()) {
continue;
}
@ -4260,7 +4260,7 @@ static bool do_grease_pencil_box_select(const ViewContext *vc,
ob_eval, *vc->obedit, info.layer_index, info.frame_number);
IndexMaskMemory memory;
const IndexMask elements = ed::greasepencil::retrieve_editable_elements(
*vc->obedit, info.drawing, selection_domain, memory);
*vc->obedit, info, selection_domain, memory);
if (elements.is_empty()) {
continue;
}
@ -5122,7 +5122,7 @@ static bool grease_pencil_circle_select(const ViewContext *vc,
ob_eval, *vc->obedit, info.layer_index, info.frame_number);
IndexMaskMemory memory;
const IndexMask elements = ed::greasepencil::retrieve_editable_elements(
*vc->obedit, info.drawing, selection_domain, memory);
*vc->obedit, info, selection_domain, memory);
if (elements.is_empty()) {
continue;
}

View File

@ -56,13 +56,13 @@ static void createTransGreasePencilVerts(bContext *C, TransInfo *t)
for (ed::greasepencil::MutableDrawingInfo info : drawings) {
if (use_proportional_edit) {
points_per_layer_per_object[layer_offset] = ed::greasepencil::retrieve_editable_points(
*object, info.drawing, curves_transform_data->memory);
*object, info.drawing, info.layer_index, curves_transform_data->memory);
tc.data_len += points_per_layer_per_object[layer_offset].size();
}
else {
points_per_layer_per_object[layer_offset] =
ed::greasepencil::retrieve_editable_and_selected_points(
*object, info.drawing, curves_transform_data->memory);
*object, info.drawing, info.layer_index, curves_transform_data->memory);
tc.data_len += points_per_layer_per_object[layer_offset].size();
}
@ -108,7 +108,7 @@ static void createTransGreasePencilVerts(bContext *C, TransInfo *t)
const IndexMask affected_strokes = use_proportional_edit ?
ed::greasepencil::retrieve_editable_strokes(
*object, info.drawing, memory) :
*object, info.drawing, info.layer_index, memory) :
IndexMask();
curve_populate_trans_data_structs(tc,
curves,

View File

@ -242,6 +242,7 @@ typedef enum GreasePencilLayerTreeNodeFlag {
GP_LAYER_TREE_NODE_EXPANDED = (1 << 6),
GP_LAYER_TREE_NODE_HIDE_MASKS = (1 << 7),
GP_LAYER_TREE_NODE_DISABLE_MASKS_IN_VIEWLAYER = (1 << 8),
GP_LAYER_TREE_NODE_USE_LOCKED_MATERIAL = (1 << 9),
} GreasePencilLayerTreeNodeFlag;
struct GreasePencilLayerTreeGroup;

View File

@ -761,6 +761,13 @@ static void rna_def_grease_pencil_layer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Blend Mode", "Blend mode");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
prop = RNA_def_property(srna, "use_locked_material", PROP_BOOLEAN, PROP_NONE);

Seems like there are unfixed merge issues.

Seems like there are unfixed merge issues.

eh, how that happened. I did resolve merge conflicts before "git commit".
Checking again 😅

eh, how that happened. I did resolve merge conflicts before "git commit". Checking again 😅

Done, should be good now :)

Done, should be good now :)
RNA_def_property_boolean_sdna(
prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_USE_LOCKED_MATERIAL);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(
prop, "Use Locked Materials Editing", "Allow editing locked materials in the layer");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
/* Local transformation matrix. */
prop = RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4);