GPv3: UI and RNA for layer blending mode #110179

Closed
casey-bianco-davis wants to merge 14 commits from casey-bianco-davis/blender:GPv3-layer-blend-mode-ui into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
3 changed files with 8 additions and 8 deletions
Showing only changes of commit efbdd76f41 - Show all commits

View File

@ -189,6 +189,8 @@ void legacy_gpencil_to_grease_pencil(Main &bmain, GreasePencil &grease_pencil, b
grease_pencil.drawing_array = reinterpret_cast<GreasePencilDrawingBase **>(
MEM_cnew_array<GreasePencilDrawing *>(num_drawings, __func__));
bke::MutableAttributeAccessor attributes = grease_pencil.attributes_for_write();
int i = 0, layer_idx = 0;
LISTBASE_FOREACH_INDEX (bGPDlayer *, gpl, &gpd.layers, layer_idx) {
/* Create a new layer. */
@ -207,7 +209,10 @@ void legacy_gpencil_to_grease_pencil(Main &bmain, GreasePencil &grease_pencil, b
(gpl->onion_flag & GP_LAYER_ONIONSKIN),
GP_LAYER_TREE_NODE_USE_ONION_SKINNING);
new_layer.blend_mode = int8_t(gpl->blend_mode);
bke::SpanAttributeWriter<int> blend_mode = attributes.lookup_or_add_for_write_span<int>(
"blend_mode", ATTR_DOMAIN_LAYER);
blend_mode.span[layer_idx] = int8_t(gpl->blend_mode);
/* Convert the layer masks. */
LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl->mask_layers) {

View File

@ -207,7 +207,7 @@ typedef struct GreasePencilLayerMask {
} GreasePencilLayerMask;
/**
* Layer blending modes. #GreasePencilLayer.blend_mode
* Layer blending modes.
*/
typedef enum GreasePencilLayerBlendMode {
GP_LAYER_BLEND_NONE = 0,
@ -278,11 +278,7 @@ typedef struct GreasePencilLayer {
GreasePencilLayerTreeNode base;
/* Only used for storage in the .blend file. */
GreasePencilLayerFramesMapStorage frames_storage;
/**
* Layer blend mode. See `GreasePencilLayerBlendMode`.
*/
int8_t blend_mode;
char _pad[3];
char _pad[4];
/**
* Opacity of the layer.
*/

View File

@ -260,7 +260,6 @@ static void rna_def_grease_pencil_layer(BlenderRNA *brna)
/* Blend Mode */
prop = RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, nullptr, "blend_mode");
RNA_def_property_enum_items(prop, rna_enum_layer_blend_modes_items);
RNA_def_property_enum_funcs(prop,
"rna_GreasePencilLayer_blend_mode_get",