Fix unreported: Grease Pencil "Add Masking Layer" operators duplicate check always returned nullptr
Original code used the wrong type of `BLI_findstring` function, leading to the parameters being read incorrectly and the `MaskingLayer `duplicate check working incorrectly. This PR changed `BLI_findstring` to `BLI_findstring_ptr`, resulting in the `LayerMask` names being read correctly and the duplcate check working as expected. Pull Request: https://projects.blender.org/blender/blender/pulls/134295
This commit is contained in:
committed by
Falk David
parent
aad0bd2148
commit
7451a1d016
@@ -891,9 +891,9 @@ static int grease_pencil_layer_mask_add_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
if (BLI_findstring(&active_layer.masks,
|
||||
mask_name,
|
||||
offsetof(GreasePencilLayerMask, layer_name)) != nullptr)
|
||||
if (BLI_findstring_ptr(&active_layer.masks,
|
||||
mask_name,
|
||||
offsetof(GreasePencilLayerMask, layer_name)) != nullptr)
|
||||
{
|
||||
BKE_report(op->reports, RPT_ERROR, "Layer already added");
|
||||
return OPERATOR_CANCELLED;
|
||||
|
||||
Reference in New Issue
Block a user