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
7 changed files with 1 additions and 32 deletions
Showing only changes of commit 36269df4b4 - Show all commits

View File

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

Shouldn't this change also be conditioned by the #ifdef WITH_GREASE_PENCIL_V3?

Shouldn't this change also be conditioned by the `#ifdef WITH_GREASE_PENCIL_V3`?
return N_("Browse Movie Clip to be linked"); return N_("Browse Movie Clip to be linked");
case ID_MSK: case ID_MSK:

View File

@ -4523,9 +4523,7 @@ static RNAProcessItem PROCESS_ITEMS[] = {
{"rna_dynamicpaint.c", NULL, RNA_def_dynamic_paint}, {"rna_dynamicpaint.c", NULL, RNA_def_dynamic_paint},
{"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve}, {"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve},
{"rna_gpencil_legacy.c", NULL, RNA_def_gpencil}, {"rna_gpencil_legacy.c", NULL, RNA_def_gpencil},
#ifdef WITH_GREASE_PENCIL_V3
{"rna_grease_pencil.c", NULL, RNA_def_grease_pencil}, {"rna_grease_pencil.c", NULL, RNA_def_grease_pencil},
Review

This should not be ifdef'd, RNA should be available, even if the new type is hidden/disabled from user PoV.

This should not be ifdef'd, RNA should be available, even if the new type is hidden/disabled from user PoV.
#endif
{"rna_curves.c", NULL, RNA_def_curves}, {"rna_curves.c", NULL, RNA_def_curves},
{"rna_image.c", "rna_image_api.c", RNA_def_image}, {"rna_image.c", "rna_image_api.c", RNA_def_image},
{"rna_key.c", NULL, RNA_def_key}, {"rna_key.c", NULL, RNA_def_key},

View File

@ -40,11 +40,8 @@ const EnumPropertyItem rna_enum_id_type_items[] = {
{ID_CU_LEGACY, "CURVE", ICON_CURVE_DATA, "Curve", ""}, {ID_CU_LEGACY, "CURVE", ICON_CURVE_DATA, "Curve", ""},
{ID_CV, "CURVES", ICON_CURVES_DATA, "Curves", ""}, {ID_CV, "CURVES", ICON_CURVES_DATA, "Curves", ""},
{ID_VF, "FONT", ICON_FONT_DATA, "Font", ""}, {ID_VF, "FONT", ICON_FONT_DATA, "Font", ""},
#ifdef WITH_GREASE_PENCIL_V3
{ID_GD_LEGACY, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil (legacy)", ""}, {ID_GD_LEGACY, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil (legacy)", ""},

This change should also be conditioned to #ifdef WITH_GREASE_PENCIL_V3 ?

This change should also be conditioned to `#ifdef WITH_GREASE_PENCIL_V3` ?

Should not be ifdef'd, and missing entry for the new GP RNA type

Should not be ifdef'd, and missing entry for the new GP RNA type
#else {ID_GP, "GREASEPENCIL_V3", ICON_GREASEPENCIL, "Grease Pencil", ""},
{ID_GD_LEGACY, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil", ""},
#endif
{ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""}, {ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""},
{ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""}, {ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""},
{ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""}, {ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""},
@ -489,11 +486,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
case ID_GD_LEGACY: case ID_GD_LEGACY:
return &RNA_GreasePencil; return &RNA_GreasePencil;
case ID_GP: case ID_GP:
# ifdef WITH_GREASE_PENCIL_V3
return &RNA_GreasePencilv3; return &RNA_GreasePencilv3;
# else
return &RNA_ID;
# endif
break; break;
case ID_GR: case ID_GR:
return &RNA_Collection; return &RNA_Collection;

Should not be ifdef'd

Should not be ifdef'd

View File

@ -156,9 +156,7 @@ void RNA_def_depsgraph(struct BlenderRNA *brna);
void RNA_def_dynamic_paint(struct BlenderRNA *brna); void RNA_def_dynamic_paint(struct BlenderRNA *brna);
void RNA_def_fcurve(struct BlenderRNA *brna); void RNA_def_fcurve(struct BlenderRNA *brna);
void RNA_def_gpencil(struct BlenderRNA *brna); void RNA_def_gpencil(struct BlenderRNA *brna);
#ifdef WITH_GREASE_PENCIL_V3
void RNA_def_grease_pencil(struct BlenderRNA *brna); void RNA_def_grease_pencil(struct BlenderRNA *brna);
#endif
void RNA_def_greasepencil_modifier(struct BlenderRNA *brna); void RNA_def_greasepencil_modifier(struct BlenderRNA *brna);
void RNA_def_shader_fx(struct BlenderRNA *brna); void RNA_def_shader_fx(struct BlenderRNA *brna);
void RNA_def_curves(struct BlenderRNA *brna); void RNA_def_curves(struct BlenderRNA *brna);
@ -505,9 +503,7 @@ void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_palettes(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_palettes(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop);
#ifdef WITH_GREASE_PENCIL_V3
void RNA_def_main_grease_pencil(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_grease_pencil(BlenderRNA *brna, PropertyRNA *cprop);
#endif
void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop);

View File

@ -96,9 +96,7 @@ RNA_MAIN_LISTBASE_FUNCS_DEF(collections)
RNA_MAIN_LISTBASE_FUNCS_DEF(curves) RNA_MAIN_LISTBASE_FUNCS_DEF(curves)
RNA_MAIN_LISTBASE_FUNCS_DEF(fonts) RNA_MAIN_LISTBASE_FUNCS_DEF(fonts)
RNA_MAIN_LISTBASE_FUNCS_DEF(gpencils) RNA_MAIN_LISTBASE_FUNCS_DEF(gpencils)
# ifdef WITH_GREASE_PENCIL_V3
RNA_MAIN_LISTBASE_FUNCS_DEF(grease_pencils) RNA_MAIN_LISTBASE_FUNCS_DEF(grease_pencils)
# endif
RNA_MAIN_LISTBASE_FUNCS_DEF(hair_curves) RNA_MAIN_LISTBASE_FUNCS_DEF(hair_curves)
RNA_MAIN_LISTBASE_FUNCS_DEF(images) RNA_MAIN_LISTBASE_FUNCS_DEF(images)
RNA_MAIN_LISTBASE_FUNCS_DEF(lattices) RNA_MAIN_LISTBASE_FUNCS_DEF(lattices)
@ -343,14 +341,12 @@ void RNA_def_main(BlenderRNA *brna)
"Grease Pencil data-blocks", "Grease Pencil data-blocks",
# endif # endif
RNA_def_main_gpencil}, RNA_def_main_gpencil},
# ifdef WITH_GREASE_PENCIL_V3
{"grease_pencils_v3", {"grease_pencils_v3",
"GreasePencilv3", "GreasePencilv3",
"rna_Main_grease_pencils_begin", "rna_Main_grease_pencils_begin",
"Grease Pencil", "Grease Pencil",
"Grease Pencil data-blocks", "Grease Pencil data-blocks",
RNA_def_main_grease_pencil}, RNA_def_main_grease_pencil},
# endif
{"movieclips", {"movieclips",
"MovieClip", "MovieClip",
"rna_Main_movieclips_begin", "rna_Main_movieclips_begin",

View File

@ -2058,7 +2058,6 @@ void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
func, "do_ui_user", true, "", "Make sure interface does not reference this grease pencil"); func, "do_ui_user", true, "", "Make sure interface does not reference this grease pencil");
} }
#ifdef WITH_GREASE_PENCIL_V3
void RNA_def_main_grease_pencil(BlenderRNA *brna, PropertyRNA *cprop) void RNA_def_main_grease_pencil(BlenderRNA *brna, PropertyRNA *cprop)
{ {
StructRNA *srna; StructRNA *srna;
@ -2068,7 +2067,6 @@ void RNA_def_main_grease_pencil(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_struct_sdna(srna, "Main"); RNA_def_struct_sdna(srna, "Main");
RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils"); RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils");
} }
#endif
void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop) void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop)
{ {

View File

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

This change should also be conditioned to #ifdef WITH_GREASE_PENCIL_V3 ?

This change should also be conditioned to `#ifdef WITH_GREASE_PENCIL_V3` ?
#else
{OB_GPENCIL_LEGACY, "GPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", ""},
#endif
{OB_GREASE_PENCIL, "GREASEPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", ""}, {OB_GREASE_PENCIL, "GREASEPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", ""},
RNA_ENUM_ITEM_SEPR, RNA_ENUM_ITEM_SEPR,
{OB_ARMATURE, "ARMATURE", ICON_OUTLINER_OB_ARMATURE, "Armature", ""}, {OB_ARMATURE, "ARMATURE", ICON_OUTLINER_OB_ARMATURE, "Armature", ""},
@ -608,11 +604,7 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr)
case OB_GPENCIL_LEGACY: case OB_GPENCIL_LEGACY:
return &RNA_GreasePencil; return &RNA_GreasePencil;
case OB_GREASE_PENCIL: case OB_GREASE_PENCIL:
# ifdef WITH_GREASE_PENCIL_V3
return &RNA_GreasePencilv3; return &RNA_GreasePencilv3;
# else
return &RNA_ID;
# endif
case OB_CURVES: case OB_CURVES:
return &RNA_Curves; return &RNA_Curves;
case OB_POINTCLOUD: case OB_POINTCLOUD: