Initial Grease Pencil 3.0 stage #106848

Merged
Falk David merged 224 commits from filedescriptor/blender:grease-pencil-v3 into main 2023-05-30 11:14:22 +02:00
9 changed files with 26 additions and 10 deletions
Showing only changes of commit 53fa7c7945 - Show all commits

View File

@ -1989,7 +1989,7 @@ class _defs_gpencil_paint:
operator="gpencil.draw",
),
)
@ToolDef.from_fn
def cutter():
def draw_settings(_context, layout, tool):

View File

@ -114,7 +114,7 @@ class Layer : public TreeNode, public ::GreasePencilLayer {
* {0: 0, 5: 1, 10: -1, 12: 2, 16: -1}
*
* In this example there are three drawings (drawing #0, drawing #1 and drawing #2). The first
* drawing starts at frame 0 and ends at frame 5 (excusive). The second drawing starts at
* drawing starts at frame 0 and ends at frame 5 (exclusive). The second drawing starts at
* frame 5 and ends at frame 10. Finally, the third drawing starts at frame 12 and ends at
* frame 16.
*
@ -207,11 +207,11 @@ class LayerGroup : public TreeNode {
*/
mutable CacheMutex children_cache_mutex_;
/**
* Caches all the children of this group in a single pre-order vector.
* Caches all the children of this group in a single pre-ordered vector.
*/
mutable Vector<TreeNode *> children_cache_;
/**
* Caches all the layers in this group in a single pre-order vector.
* Caches all the layers in this group in a single pre-ordered vector.
*/
mutable Vector<Layer *> layer_cache_;

View File

@ -684,7 +684,6 @@ GreasePencil *BKE_grease_pencil_new_nomain()
{
GreasePencil *grease_pencil = reinterpret_cast<GreasePencil *>(
BKE_id_new_nomain(ID_GP, nullptr));
grease_pencil_init_data(&grease_pencil->id);
return grease_pencil;
}

View File

@ -454,6 +454,8 @@ uint64_t BKE_library_id_can_use_filter_id(const ID *id_owner)
return FILTER_ID_IM;
case ID_GD_LEGACY:
return FILTER_ID_MA;
case ID_GP:
return FILTER_ID_GP | FILTER_ID_MA;
case ID_WS:
return FILTER_ID_SCE;
case ID_CV:
@ -480,8 +482,6 @@ uint64_t BKE_library_id_can_use_filter_id(const ID *id_owner)
case ID_IP:
/* Deprecated... */
return 0;
case ID_GP:
return FILTER_ID_GP | FILTER_ID_MA;
}
BLI_assert_unreachable();

View File

@ -632,6 +632,8 @@ ListBase *which_libbase(Main *bmain, short type)
return &(bmain->wm);
case ID_GD_LEGACY:
return &(bmain->gpencils);
case ID_GP:
return &(bmain->grease_pencils);
case ID_MC:
return &(bmain->movieclips);
case ID_MSK:
@ -654,8 +656,6 @@ ListBase *which_libbase(Main *bmain, short type)
return &(bmain->volumes);
case ID_SIM:
return &(bmain->simulations);
case ID_GP:
return &(bmain->grease_pencils);
}
return NULL;
}
@ -677,6 +677,7 @@ int set_listbasepointers(Main *bmain, ListBase *lb[/*INDEX_ID_MAX*/])
/* Referenced by nodes, objects, view, scene etc, before to free after. */
lb[INDEX_ID_GD_LEGACY] = &(bmain->gpencils);
lb[INDEX_ID_GP] = &(bmain->grease_pencils);
lb[INDEX_ID_NT] = &(bmain->nodetrees);
lb[INDEX_ID_IM] = &(bmain->images);
@ -721,7 +722,6 @@ int set_listbasepointers(Main *bmain, ListBase *lb[/*INDEX_ID_MAX*/])
lb[INDEX_ID_WM] = &(bmain->wm);
lb[INDEX_ID_MSK] = &(bmain->masks);
lb[INDEX_ID_SIM] = &(bmain->simulations);
lb[INDEX_ID_GP] = &(bmain->grease_pencils);
lb[INDEX_ID_NULL] = NULL;

View File

@ -1109,7 +1109,11 @@ static const char *template_id_browse_tip(const StructRNA *type)
case ID_PA:
return N_("Browse Particle Settings to be linked");
case ID_GD_LEGACY:
#ifdef WITH_GREASE_PENCIL_V3
return N_("Browse Grease Pencil (legacy) Data to be linked");
#else
return N_("Browse Grease Pencil Data to be linked");
#endif
case ID_MC:
return N_("Browse Movie Clip to be linked");
case ID_MSK:

View File

@ -40,7 +40,11 @@ const EnumPropertyItem rna_enum_id_type_items[] = {
{ID_CU_LEGACY, "CURVE", ICON_CURVE_DATA, "Curve", ""},
{ID_CV, "CURVES", ICON_CURVES_DATA, "Curves", ""},
{ID_VF, "FONT", ICON_FONT_DATA, "Font", ""},
#ifdef WITH_GREASE_PENCIL_V3
{ID_GD_LEGACY, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil (legacy)", ""},
#else
{ID_GD_LEGACY, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil", ""},
#endif
{ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""},
{ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""},
{ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""},

View File

@ -332,8 +332,13 @@ void RNA_def_main(BlenderRNA *brna)
{"grease_pencils",
"GreasePencil",
"rna_Main_gpencils_begin",
# ifdef WITH_GREASE_PENCIL_V3
"Grease Pencil (legacy)",
"Grease Pencil (legacy) data-blocks",
# else
"Grease Pencil",
"Grease Pencil data-blocks",
# endif
RNA_def_main_gpencil},
{"movieclips",
"MovieClip",

View File

@ -254,7 +254,11 @@ const EnumPropertyItem rna_enum_object_type_items[] = {
{OB_CURVES, "CURVES", ICON_OUTLINER_OB_CURVES, "Hair Curves", ""},
{OB_POINTCLOUD, "POINTCLOUD", ICON_OUTLINER_OB_POINTCLOUD, "Point Cloud", ""},
{OB_VOLUME, "VOLUME", ICON_OUTLINER_OB_VOLUME, "Volume", ""},
#ifdef WITH_GREASE_PENCIL_V3
{OB_GPENCIL_LEGACY, "GPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil (legacy)", ""},
#else
{OB_GPENCIL_LEGACY, "GPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", ""},
#endif
{OB_GREASE_PENCIL, "GREASEPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", ""},
RNA_ENUM_ITEM_SEPR,
{OB_ARMATURE, "ARMATURE", ICON_OUTLINER_OB_ARMATURE, "Armature", ""},