GPv3: Onion Skinning #119792

Merged
Falk David merged 20 commits from filedescriptor/blender:gpv3-old-onion-skinning into main 2024-04-03 15:34:51 +02:00
2 changed files with 13 additions and 3 deletions
Showing only changes of commit a681c21d92 - Show all commits

View File

@ -401,9 +401,11 @@ class LayerGroupViewItem : public AbstractTreeViewItem {
PointerRNA group_ptr = RNA_pointer_create(
&grease_pencil_.id, &RNA_GreasePencilLayerGroup, &group_);
const int icon = (group_.base.flag & GP_LAYER_TREE_NODE_HIDE_MASKS) == 0 ? ICON_CLIPUV_DEHLT :
ICON_CLIPUV_HLT;
uiItemR(&row, &group_ptr, "use_masks", UI_ITEM_R_ICON_ONLY, nullptr, icon);
const int mask_icon = (group_.base.flag & GP_LAYER_TREE_NODE_HIDE_MASKS) == 0 ?
ICON_CLIPUV_DEHLT :
ICON_CLIPUV_HLT;
uiItemR(&row, &group_ptr, "use_onion_skinning", UI_ITEM_R_ICON_ONLY, nullptr, ICON_NONE);
uiItemR(&row, &group_ptr, "use_masks", UI_ITEM_R_ICON_ONLY, nullptr, mask_icon);
uiItemR(&row, &group_ptr, "hide", UI_ITEM_R_ICON_ONLY, nullptr, ICON_NONE);
uiItemR(&row, &group_ptr, "lock", UI_ITEM_R_ICON_ONLY, nullptr, ICON_NONE);
}

View File

@ -543,6 +543,14 @@ static void rna_def_grease_pencil_layer_group(BlenderRNA *brna)
"The visibility of drawings in the layers in this group is affected by "
"the layers in the masks lists");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_ui_icon(prop, ICON_ONIONSKIN_OFF, 1);
RNA_def_property_boolean_negative_sdna(
prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING);
RNA_def_property_ui_text(
prop, "Onion Skinning", "Display onion skins before and after the current frame");
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
}
static void rna_def_grease_pencil_onion_skinning(StructRNA *srna)