main sync #3

Merged
Patrick Busch merged 318 commits from blender/blender:main into main 2023-03-17 15:52:21 +01:00
121 changed files with 338 additions and 325 deletions
Showing only changes of commit 53bb713eda - Show all commits

View File

@ -259,7 +259,7 @@ extern IDTypeInfo IDType_ID_AC;
extern IDTypeInfo IDType_ID_NT;
extern IDTypeInfo IDType_ID_BR;
extern IDTypeInfo IDType_ID_PA;
extern IDTypeInfo IDType_ID_GD;
extern IDTypeInfo IDType_ID_GD_LEGACY;
extern IDTypeInfo IDType_ID_WM;
extern IDTypeInfo IDType_ID_MC;
extern IDTypeInfo IDType_ID_MSK;

View File

@ -515,7 +515,7 @@ static void armature_deform_coords_impl(const Object *ob_arm,
dverts_len = lt->pntsu * lt->pntsv * lt->pntsw;
}
}
else if (ob_target->type == OB_GPENCIL) {
else if (ob_target->type == OB_GPENCIL_LEGACY) {
target_data_id = (const ID *)ob_target->data;
dverts = gps_target->dvert;
if (dverts) {

View File

@ -440,7 +440,7 @@ bool BKE_object_supports_vertex_groups(const Object *ob)
return false;
}
return ELEM(GS(id->name), ID_ME, ID_LT, ID_GD);
return ELEM(GS(id->name), ID_ME, ID_LT, ID_GD_LEGACY);
}
const ListBase *BKE_id_defgroup_list_get(const ID *id)
@ -454,7 +454,7 @@ const ListBase *BKE_id_defgroup_list_get(const ID *id)
const Lattice *lt = (const Lattice *)id;
return &lt->vertex_group_names;
}
case ID_GD: {
case ID_GD_LEGACY: {
const bGPdata *gpd = (const bGPdata *)id;
return &gpd->vertex_group_names;
}
@ -477,7 +477,7 @@ static const int *object_defgroup_active_index_get_p(const Object *ob)
const Lattice *lattice = (const Lattice *)ob->data;
return &lattice->vertex_group_active_index;
}
case OB_GPENCIL: {
case OB_GPENCIL_LEGACY: {
const bGPdata *gpd = (const bGPdata *)ob->data;
return &gpd->vertex_group_active_index;
}

View File

@ -296,10 +296,10 @@ static void greasepencil_blend_read_expand(BlendExpander *expander, ID *id)
}
}
IDTypeInfo IDType_ID_GD = {
.id_code = ID_GD,
.id_filter = FILTER_ID_GD,
.main_listbase_index = INDEX_ID_GD,
IDTypeInfo IDType_ID_GD_LEGACY = {
.id_code = ID_GD_LEGACY,
.id_filter = FILTER_ID_GD_LEGACY,
.main_listbase_index = INDEX_ID_GD_LEGACY,
.struct_size = sizeof(bGPdata),
.name = "GPencil",
.name_plural = "grease_pencils",
@ -707,7 +707,7 @@ bGPdata *BKE_gpencil_data_addnew(Main *bmain, const char name[])
bGPdata *gpd;
/* allocate memory for a new block */
gpd = BKE_libblock_alloc(bmain, ID_GD, name, 0);
gpd = BKE_libblock_alloc(bmain, ID_GD_LEGACY, name, 0);
/* initial settings */
gpd->flag = (GP_DATA_DISPINFO | GP_DATA_EXPAND);
@ -2710,7 +2710,7 @@ void BKE_gpencil_layer_transform_matrix_get(const Depsgraph *depsgraph,
/* if not layer parented, try with object parented */
if (obparent_eval == NULL) {
if ((ob_eval != NULL) && (ob_eval->type == OB_GPENCIL)) {
if ((ob_eval != NULL) && (ob_eval->type == OB_GPENCIL_LEGACY)) {
copy_m4_m4(diff_mat, ob_eval->object_to_world);
mul_m4_m4m4(diff_mat, diff_mat, gpl->layer_mat);
return;
@ -2748,7 +2748,7 @@ void BKE_gpencil_layer_transform_matrix_get(const Depsgraph *depsgraph,
void BKE_gpencil_update_layer_transforms(const Depsgraph *depsgraph, Object *ob)
{
if (ob->type != OB_GPENCIL) {
if (ob->type != OB_GPENCIL_LEGACY) {
return;
}

View File

@ -468,7 +468,7 @@ void BKE_gpencil_convert_curve(Main *bmain,
const float scale_thickness,
const float sample)
{
if (ELEM(NULL, ob_gp, ob_cu) || (ob_gp->type != OB_GPENCIL) || (ob_gp->data == NULL)) {
if (ELEM(NULL, ob_gp, ob_cu) || (ob_gp->type != OB_GPENCIL_LEGACY) || (ob_gp->data == NULL)) {
return;
}

View File

@ -2703,7 +2703,8 @@ bool BKE_gpencil_convert_mesh(Main *bmain,
{
using namespace blender;
using namespace blender::bke;
if (ELEM(nullptr, ob_gp, ob_mesh) || (ob_gp->type != OB_GPENCIL) || (ob_gp->data == nullptr)) {
if (ELEM(nullptr, ob_gp, ob_mesh) || (ob_gp->type != OB_GPENCIL_LEGACY) ||
(ob_gp->data == nullptr)) {
return false;
}

View File

@ -81,7 +81,7 @@ static void id_type_init(void)
INIT_TYPE(ID_NT);
INIT_TYPE(ID_BR);
INIT_TYPE(ID_PA);
INIT_TYPE(ID_GD);
INIT_TYPE(ID_GD_LEGACY);
INIT_TYPE(ID_WM);
INIT_TYPE(ID_MC);
INIT_TYPE(ID_MSK);
@ -220,7 +220,7 @@ uint64_t BKE_idtype_idcode_to_idfilter(const short idcode)
CASE_IDFILTER(CA);
CASE_IDFILTER(CF);
CASE_IDFILTER(CU_LEGACY);
CASE_IDFILTER(GD);
CASE_IDFILTER(GD_LEGACY);
CASE_IDFILTER(GR);
CASE_IDFILTER(CV);
CASE_IDFILTER(IM);
@ -278,7 +278,7 @@ short BKE_idtype_idcode_from_idfilter(const uint64_t idfilter)
CASE_IDFILTER(CA);
CASE_IDFILTER(CF);
CASE_IDFILTER(CU_LEGACY);
CASE_IDFILTER(GD);
CASE_IDFILTER(GD_LEGACY);
CASE_IDFILTER(GR);
CASE_IDFILTER(CV);
CASE_IDFILTER(IM);
@ -334,7 +334,7 @@ int BKE_idtype_idcode_to_index(const short idcode)
CASE_IDINDEX(CA);
CASE_IDINDEX(CF);
CASE_IDINDEX(CU_LEGACY);
CASE_IDINDEX(GD);
CASE_IDINDEX(GD_LEGACY);
CASE_IDINDEX(GR);
CASE_IDINDEX(CV);
CASE_IDINDEX(IM);
@ -393,7 +393,7 @@ short BKE_idtype_idcode_from_index(const int index)
CASE_IDCODE(CA);
CASE_IDCODE(CF);
CASE_IDCODE(CU_LEGACY);
CASE_IDCODE(GD);
CASE_IDCODE(GD_LEGACY);
CASE_IDCODE(GR);
CASE_IDCODE(CV);
CASE_IDCODE(IM);

View File

@ -839,7 +839,7 @@ bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
RNA_property_update(C, ptr, prop);
/* tag grease pencil data-block and disable onion */
if (GS(id->name) == ID_GD) {
if (GS(id->name) == ID_GD_LEGACY) {
DEG_id_tag_update(id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
DEG_id_tag_update(newid, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
bGPdata *gpd = (bGPdata *)newid;

View File

@ -396,7 +396,7 @@ uint64_t BKE_library_id_can_use_filter_id(const ID *id_owner)
case ID_SCE:
return FILTER_ID_OB | FILTER_ID_WO | FILTER_ID_SCE | FILTER_ID_MC | FILTER_ID_MA |
FILTER_ID_GR | FILTER_ID_TXT | FILTER_ID_LS | FILTER_ID_MSK | FILTER_ID_SO |
FILTER_ID_GD | FILTER_ID_BR | FILTER_ID_PAL | FILTER_ID_IM | FILTER_ID_NT;
FILTER_ID_GD_LEGACY | FILTER_ID_BR | FILTER_ID_PAL | FILTER_ID_IM | FILTER_ID_NT;
case ID_OB:
/* Could be more specific, but simpler to just always say 'yes' here. */
return FILTER_ID_ALL;
@ -435,7 +435,7 @@ uint64_t BKE_library_id_can_use_filter_id(const ID *id_owner)
case ID_PA:
return FILTER_ID_OB | FILTER_ID_GR | FILTER_ID_TE;
case ID_MC:
return FILTER_ID_GD | FILTER_ID_IM;
return FILTER_ID_GD_LEGACY | FILTER_ID_IM;
case ID_MSK:
/* WARNING! mask->parent.id, not typed. */
return FILTER_ID_MC;
@ -443,7 +443,7 @@ uint64_t BKE_library_id_can_use_filter_id(const ID *id_owner)
return FILTER_ID_TE | FILTER_ID_OB;
case ID_LP:
return FILTER_ID_IM;
case ID_GD:
case ID_GD_LEGACY:
return FILTER_ID_MA;
case ID_WS:
return FILTER_ID_SCE;

View File

@ -625,7 +625,7 @@ ListBase *which_libbase(Main *bmain, short type)
return &(bmain->particles);
case ID_WM:
return &(bmain->wm);
case ID_GD:
case ID_GD_LEGACY:
return &(bmain->gpencils);
case ID_MC:
return &(bmain->movieclips);
@ -669,7 +669,7 @@ int set_listbasepointers(Main *bmain, ListBase *lb[/*INDEX_ID_MAX*/])
lb[INDEX_ID_PAL] = &(bmain->palettes);
/* Referenced by nodes, objects, view, scene etc, before to free after. */
lb[INDEX_ID_GD] = &(bmain->gpencils);
lb[INDEX_ID_GD_LEGACY] = &(bmain->gpencils);
lb[INDEX_ID_NT] = &(bmain->nodetrees);
lb[INDEX_ID_IM] = &(bmain->images);

View File

@ -328,7 +328,7 @@ Material ***BKE_object_material_array_p(Object *ob)
MetaBall *mb = static_cast<MetaBall *>(ob->data);
return &(mb->mat);
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
return &(gpd->mat);
}
@ -361,7 +361,7 @@ short *BKE_object_material_len_p(Object *ob)
MetaBall *mb = static_cast<MetaBall *>(ob->data);
return &(mb->totcol);
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
return &(gpd->totcol);
}
@ -392,7 +392,7 @@ Material ***BKE_id_material_array_p(ID *id)
return &(((Curve *)id)->mat);
case ID_MB:
return &(((MetaBall *)id)->mat);
case ID_GD:
case ID_GD_LEGACY:
return &(((bGPdata *)id)->mat);
case ID_CV:
return &(((Curves *)id)->mat);
@ -418,7 +418,7 @@ short *BKE_id_material_len_p(ID *id)
return &(((Curve *)id)->totcol);
case ID_MB:
return &(((MetaBall *)id)->totcol);
case ID_GD:
case ID_GD_LEGACY:
return &(((bGPdata *)id)->totcol);
case ID_CV:
return &(((Curves *)id)->totcol);
@ -480,7 +480,7 @@ bool BKE_object_material_slot_used(Object *object, short actcol)
case ID_MB:
/* Meta-elements don't support materials at the moment. */
return false;
case ID_GD:
case ID_GD_LEGACY:
return BKE_gpencil_material_index_used((bGPdata *)ob_data, actcol - 1);
default:
return false;
@ -1090,7 +1090,7 @@ void BKE_object_material_remap(Object *ob, const uint *remap)
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) {
BKE_curve_material_remap(static_cast<Curve *>(ob->data), remap, ob->totcol);
}
else if (ob->type == OB_GPENCIL) {
else if (ob->type == OB_GPENCIL_LEGACY) {
BKE_gpencil_material_remap(static_cast<bGPdata *>(ob->data), remap, ob->totcol);
}
else {
@ -1347,7 +1347,7 @@ bool BKE_object_material_slot_remove(Main *bmain, Object *ob)
}
}
/* check indices from gpencil */
else if (ob->type == OB_GPENCIL) {
else if (ob->type == OB_GPENCIL_LEGACY) {
BKE_gpencil_material_index_reassign((bGPdata *)ob->data, ob->totcol, actcol - 1);
}

View File

@ -735,7 +735,7 @@ ModifierData *BKE_modifiers_get_virtual_modifierlist(const Object *ob,
Object *BKE_modifiers_is_deformed_by_armature(Object *ob)
{
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
GpencilVirtualModifierData gpencilvirtualModifierData;
ArmatureGpencilModifierData *agmd = nullptr;
GpencilModifierData *gmd = BKE_gpencil_modifiers_get_virtual_modifierlist(

View File

@ -233,7 +233,7 @@ static void object_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const in
BKE_object_facemap_copy_list(&ob_dst->fmaps, &ob_src->fmaps);
BKE_constraints_copy_ex(&ob_dst->constraints, &ob_src->constraints, flag_subdata, true);
ob_dst->mode = ob_dst->type != OB_GPENCIL ? OB_MODE_OBJECT : ob_dst->mode;
ob_dst->mode = ob_dst->type != OB_GPENCIL_LEGACY ? OB_MODE_OBJECT : ob_dst->mode;
ob_dst->sculpt = nullptr;
if (ob_src->pd) {
@ -1489,7 +1489,7 @@ static ParticleSystem *object_copy_modifier_particle_system_ensure(Main *bmain,
bool BKE_object_copy_modifier(
Main *bmain, Scene *scene, Object *ob_dst, const Object *ob_src, ModifierData *md_src)
{
BLI_assert(ob_dst->type != OB_GPENCIL);
BLI_assert(ob_dst->type != OB_GPENCIL_LEGACY);
const ModifierTypeInfo *mti = BKE_modifier_get_info((ModifierType)md_src->type);
if (!object_modifier_type_copy_check((ModifierType)md_src->type)) {
@ -1587,7 +1587,7 @@ bool BKE_object_copy_modifier(
bool BKE_object_copy_gpencil_modifier(struct Object *ob_dst, GpencilModifierData *gmd_src)
{
BLI_assert(ob_dst->type == OB_GPENCIL);
BLI_assert(ob_dst->type == OB_GPENCIL_LEGACY);
GpencilModifierData *gmd_dst = BKE_gpencil_modifier_new(gmd_src->type);
BLI_strncpy(gmd_dst->name, gmd_src->name, sizeof(gmd_dst->name));
@ -1607,7 +1607,7 @@ bool BKE_object_modifier_stack_copy(Object *ob_dst,
const bool do_copy_all,
const int flag_subdata)
{
if ((ob_dst->type == OB_GPENCIL) != (ob_src->type == OB_GPENCIL)) {
if ((ob_dst->type == OB_GPENCIL_LEGACY) != (ob_src->type == OB_GPENCIL_LEGACY)) {
BLI_assert_msg(0,
"Trying to copy a modifier stack between a GPencil object and another type.");
return false;
@ -1904,7 +1904,7 @@ bool BKE_object_is_in_editmode(const Object *ob)
case OB_SURF:
case OB_CURVES_LEGACY:
return ((Curve *)ob->data)->editnurb != nullptr;
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
/* Grease Pencil object has no edit mode data. */
return GPENCIL_EDIT_MODE((bGPdata *)ob->data);
case OB_CURVES:
@ -2131,7 +2131,7 @@ static const char *get_obdata_defname(int type)
return DATA_("Volume");
case OB_EMPTY:
return DATA_("Empty");
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
return DATA_("GPencil");
case OB_LIGHTPROBE:
return DATA_("LightProbe");
@ -2156,7 +2156,7 @@ static void object_init(Object *ob, const short ob_type)
ob->upflag = OB_POSY;
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
ob->dtx |= OB_USE_GPENCIL_LIGHTS;
}
@ -2196,7 +2196,7 @@ void *BKE_object_obdata_add_from_type(Main *bmain, int type, const char *name)
return BKE_speaker_add(bmain, name);
case OB_LIGHTPROBE:
return BKE_lightprobe_add(bmain, name);
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
return BKE_gpencil_data_addnew(bmain, name);
case OB_CURVES:
return BKE_curves_add(bmain, name);
@ -2230,8 +2230,8 @@ int BKE_object_obdata_to_type(const ID *id)
return OB_CAMERA;
case ID_LT:
return OB_LATTICE;
case ID_GD:
return OB_GPENCIL;
case ID_GD_LEGACY:
return OB_GPENCIL_LEGACY;
case ID_AR:
return OB_ARMATURE;
case ID_LP:
@ -2558,7 +2558,7 @@ Object *BKE_object_pose_armature_get_with_wpaint_check(Object *ob)
}
break;
}
case OB_GPENCIL: {
case OB_GPENCIL_LEGACY: {
if ((ob->mode & OB_MODE_WEIGHT_GPENCIL) == 0) {
return nullptr;
}
@ -2794,7 +2794,7 @@ Object *BKE_object_duplicate(Main *bmain, Object *ob, uint dupflag, uint duplica
id_new = BKE_id_copy_for_duplicate(bmain, id_old, dupflag, copy_flags);
}
break;
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
if (dupflag & USER_DUP_GPENCIL) {
id_new = BKE_id_copy_for_duplicate(bmain, id_old, dupflag, copy_flags);
}
@ -3737,7 +3737,7 @@ const BoundBox *BKE_object_boundbox_get(Object *ob)
case OB_ARMATURE:
bb = BKE_armature_boundbox_get(ob);
break;
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
bb = BKE_gpencil_boundbox_get(ob);
break;
case OB_CURVES:
@ -3889,7 +3889,7 @@ void BKE_object_minmax(Object *ob, float r_min[3], float r_max[3], const bool us
changed = true;
break;
}
case OB_GPENCIL: {
case OB_GPENCIL_LEGACY: {
const BoundBox bb = *BKE_gpencil_boundbox_get(ob);
BKE_boundbox_minmax(&bb, ob->object_to_world, r_min, r_max);
changed = true;
@ -4190,7 +4190,7 @@ void BKE_object_foreach_display_point(Object *ob,
func_cb(co, user_data);
}
}
else if (ob->type == OB_GPENCIL) {
else if (ob->type == OB_GPENCIL_LEGACY) {
GPencilStrokePointIterData iter_data{};
iter_data.obmat = obmat;
iter_data.point_func_cb = func_cb;
@ -5118,7 +5118,7 @@ bool BKE_object_supports_material_slots(struct Object *ob)
OB_CURVES,
OB_POINTCLOUD,
OB_VOLUME,
OB_GPENCIL);
OB_GPENCIL_LEGACY);
}
/** \} */

View File

@ -366,7 +366,7 @@ static void object_defgroup_remove_edit_mode(Object *ob, bDeformGroup *dg)
void BKE_object_defgroup_remove(Object *ob, bDeformGroup *defgroup)
{
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
BKE_gpencil_vgroup_remove(ob, defgroup);
}
else {

View File

@ -181,7 +181,7 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o
case OB_LATTICE:
BKE_lattice_modifiers_calc(depsgraph, scene, ob);
break;
case OB_GPENCIL: {
case OB_GPENCIL_LEGACY: {
BKE_gpencil_prepare_eval_data(depsgraph, scene, ob);
BKE_gpencil_modifiers_calc(depsgraph, scene, ob);
BKE_gpencil_update_layer_transforms(depsgraph, ob);
@ -303,7 +303,7 @@ void BKE_object_batch_cache_dirty_tag(Object *ob)
}
break;
}
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
BKE_gpencil_batch_cache_dirty_tag((struct bGPdata *)ob->data);
break;
case OB_CURVES:

View File

@ -2963,7 +2963,7 @@ static const char *dataname(short id_code)
return "Data from PAL";
case ID_PC:
return "Data from PCRV";
case ID_GD:
case ID_GD_LEGACY:
return "Data from GD";
case ID_WM:
return "Data from WM";

View File

@ -431,7 +431,7 @@ static void versions_gpencil_add_main(Main *bmain, ListBase *lb, ID *id, const c
BLI_addtail(lb, id);
id->us = 1;
id->flag = LIB_FAKEUSER;
*((short *)id->name) = ID_GD;
*((short *)id->name) = ID_GD_LEGACY;
BKE_id_new_name_validate(bmain, lb, id, name, false);
/* alphabetic insertion: is in BKE_id_new_name_validate */

View File

@ -4665,7 +4665,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
/* Fix Grease Pencil VFX and modifiers. */
LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
if (ob->type != OB_GPENCIL) {
if (ob->type != OB_GPENCIL_LEGACY) {
continue;
}

View File

@ -553,7 +553,7 @@ void do_versions_after_linking_290(FileData * /*fd*/, Main *bmain)
Scene *scene = static_cast<Scene *>(bmain->scenes.first);
if (scene != nullptr) {
LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
if (ob->type != OB_GPENCIL) {
if (ob->type != OB_GPENCIL_LEGACY) {
continue;
}
bGPdata *gpd = static_cast<bGPdata *>(ob->data);

View File

@ -385,7 +385,7 @@ static void assert_sorted_ids(Main *bmain)
static void move_vertex_group_names_to_object_data(Main *bmain)
{
LISTBASE_FOREACH (Object *, object, &bmain->objects) {
if (ELEM(object->type, OB_MESH, OB_LATTICE, OB_GPENCIL)) {
if (ELEM(object->type, OB_MESH, OB_LATTICE, OB_GPENCIL_LEGACY)) {
ListBase *new_defbase = BKE_object_defgroup_list_mutable(object);
/* Choose the longest vertex group name list among all linked duplicates. */
@ -1044,7 +1044,7 @@ void do_versions_after_linking_300(FileData * /*fd*/, Main *bmain)
if (!MAIN_VERSION_ATLEAST(bmain, 300, 33)) {
/* This was missing from #move_vertex_group_names_to_object_data. */
LISTBASE_FOREACH (Object *, object, &bmain->objects) {
if (ELEM(object->type, OB_MESH, OB_LATTICE, OB_GPENCIL)) {
if (ELEM(object->type, OB_MESH, OB_LATTICE, OB_GPENCIL_LEGACY)) {
/* This uses the fact that the active vertex group index starts counting at 1. */
if (BKE_object_defgroup_active_index_get(object) == 0) {
BKE_object_defgroup_active_index_set(object, object->actdef);
@ -2347,7 +2347,7 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
}
}
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) {
if (md->type == eGpencilModifierType_Lineart) {
LineartGpencilModifierData *lmd = (LineartGpencilModifierData *)md;
@ -2542,7 +2542,7 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
if (!DNA_struct_elem_find(
fd->filesdna, "LineartGpencilModifierData", "bool", "use_crease_on_smooth")) {
LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) {
if (md->type == eGpencilModifierType_Lineart) {
LineartGpencilModifierData *lmd = (LineartGpencilModifierData *)md;

View File

@ -464,7 +464,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
Object *ob = static_cast<Object *>(
BLI_findstring(&bmain->objects, "Stroke", offsetof(ID, name) + 2));
if (ob && ob->type == OB_GPENCIL) {
if (ob && ob->type == OB_GPENCIL_LEGACY) {
ob->dtx |= OB_USE_GPENCIL_LIGHTS;
}
}
@ -550,7 +550,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
if (app_template && STREQ(app_template, "2D_Animation")) {
LISTBASE_FOREACH (Object *, object, &bmain->objects) {
if (object->type == OB_GPENCIL) {
if (object->type == OB_GPENCIL_LEGACY) {
/* Set grease pencil object in drawing mode */
bGPdata *gpd = (bGPdata *)object->data;
object->mode = OB_MODE_PAINT_GPENCIL;

View File

@ -604,7 +604,7 @@ void DepsgraphNodeBuilder::build_id(ID *id)
case ID_MB:
case ID_CU_LEGACY:
case ID_LT:
case ID_GD:
case ID_GD_LEGACY:
case ID_CV:
case ID_PT:
case ID_VO:
@ -933,7 +933,7 @@ void DepsgraphNodeBuilder::build_object_data(Object *object)
case OB_SURF:
case OB_MBALL:
case OB_LATTICE:
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
case OB_CURVES:
case OB_POINTCLOUD:
case OB_VOLUME:
@ -1616,7 +1616,7 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata)
break;
}
case ID_GD: {
case ID_GD_LEGACY: {
/* GPencil evaluation operations. */
op_node = add_operation_node(obdata,
NodeType::GEOMETRY,

View File

@ -224,8 +224,14 @@ OperationCode bone_target_opcode(ID *target,
bool object_have_geometry_component(const Object *object)
{
return ELEM(
object->type, OB_MESH, OB_CURVES_LEGACY, OB_FONT, OB_SURF, OB_MBALL, OB_LATTICE, OB_GPENCIL);
return ELEM(object->type,
OB_MESH,
OB_CURVES_LEGACY,
OB_FONT,
OB_SURF,
OB_MBALL,
OB_LATTICE,
OB_GPENCIL_LEGACY);
}
} // namespace
@ -542,7 +548,7 @@ void DepsgraphRelationBuilder::build_id(ID *id)
case ID_CV:
case ID_PT:
case ID_VO:
case ID_GD:
case ID_GD_LEGACY:
build_object_data_geometry_datablock(id);
break;
case ID_SPK:
@ -942,7 +948,7 @@ void DepsgraphRelationBuilder::build_object_data(Object *object)
case OB_SURF:
case OB_MBALL:
case OB_LATTICE:
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
case OB_CURVES:
case OB_POINTCLOUD:
case OB_VOLUME: {
@ -2435,7 +2441,7 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
}
case ID_LT:
break;
case ID_GD: /* Grease Pencil */
case ID_GD_LEGACY: /* Grease Pencil */
{
bGPdata *gpd = (bGPdata *)obdata;

View File

@ -71,7 +71,7 @@ void depsgraph_geometry_tag_to_component(const ID *id, NodeType *component_type)
bool is_selectable_data_id_type(const ID_Type id_type)
{
return ELEM(id_type, ID_ME, ID_CU_LEGACY, ID_MB, ID_LT, ID_GD, ID_CV, ID_PT, ID_VO);
return ELEM(id_type, ID_ME, ID_CU_LEGACY, ID_MB, ID_LT, ID_GD_LEGACY, ID_CV, ID_PT, ID_VO);
}
void depsgraph_select_tag_to_component_opcode(const ID *id,
@ -585,7 +585,7 @@ NodeType geometry_tag_to_component(const ID *id)
case OB_FONT:
case OB_LATTICE:
case OB_MBALL:
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
case OB_CURVES:
case OB_POINTCLOUD:
case OB_VOLUME:
@ -609,7 +609,7 @@ NodeType geometry_tag_to_component(const ID *id)
return NodeType::UNDEFINED;
case ID_LP:
return NodeType::PARAMETERS;
case ID_GD:
case ID_GD_LEGACY:
return NodeType::GEOMETRY;
case ID_PAL: /* Palettes */
return NodeType::PARAMETERS;

View File

@ -739,7 +739,7 @@ void update_id_after_copy(const Depsgraph *depsgraph,
}
/* FIXME: This is a temporary fix to update the runtime pointers properly, see #96216. Should
* be removed at some point. */
case ID_GD: {
case ID_GD_LEGACY: {
bGPdata *gpd_cow = (bGPdata *)id_cow;
bGPDlayer *gpl = (bGPDlayer *)(gpd_cow->layers.first);
if (gpl != nullptr && gpl->runtime.gpl_orig == nullptr) {
@ -892,8 +892,8 @@ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, const IDNode
}
/* In case we don't need to do a copy-on-write, we can use the update cache of the grease
* pencil data to do an update-on-write. */
if (id_type == ID_GD && BKE_gpencil_can_avoid_full_copy_on_write(
(const ::Depsgraph *)depsgraph, (bGPdata *)id_orig)) {
if (id_type == ID_GD_LEGACY && BKE_gpencil_can_avoid_full_copy_on_write(
(const ::Depsgraph *)depsgraph, (bGPdata *)id_orig)) {
BKE_gpencil_update_on_write((bGPdata *)id_orig, (bGPdata *)id_cow);
return id_cow;
}

View File

@ -60,7 +60,7 @@ void RuntimeBackup::init_from_id(ID *id)
case ID_VO:
volume_backup.init_from_volume(reinterpret_cast<Volume *>(id));
break;
case ID_GD:
case ID_GD_LEGACY:
gpencil_backup.init_from_gpencil(reinterpret_cast<bGPdata *>(id));
break;
default:
@ -103,7 +103,7 @@ void RuntimeBackup::restore_to_id(ID *id)
case ID_VO:
volume_backup.restore_to_volume(reinterpret_cast<Volume *>(id));
break;
case ID_GD:
case ID_GD_LEGACY:
gpencil_backup.restore_to_gpencil(reinterpret_cast<bGPdata *>(id));
break;
default:

View File

@ -136,7 +136,7 @@ void Instance::scene_sync()
void Instance::object_sync(Object *ob)
{
const bool is_renderable_type = ELEM(ob->type, OB_CURVES, OB_GPENCIL, OB_MESH, OB_LAMP);
const bool is_renderable_type = ELEM(ob->type, OB_CURVES, OB_GPENCIL_LEGACY, OB_MESH, OB_LAMP);
const int ob_visibility = DRW_object_visibility_in_active_context(ob);
const bool partsys_is_visible = (ob_visibility & OB_VISIBLE_PARTICLES) != 0 &&
(ob->type == OB_MESH);
@ -174,7 +174,7 @@ void Instance::object_sync(Object *ob)
case OB_CURVES:
sync.sync_curves(ob, ob_handle, res_handle);
break;
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
sync.sync_gpencil(ob, ob_handle, res_handle);
break;
default:

View File

@ -99,7 +99,7 @@ static inline eMaterialGeometry to_material_geometry(const Object *ob)
return MAT_GEOM_CURVES;
case OB_VOLUME:
return MAT_GEOM_VOLUME;
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
return MAT_GEOM_GPENCIL;
default:
return MAT_GEOM_MESH;

View File

@ -195,7 +195,7 @@ static void external_cache_populate(void *vedata, Object *ob)
return;
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
/* Grease Pencil objects need correct depth to do the blending. */
stl->g_data->need_depth = true;
return;

View File

@ -111,7 +111,7 @@ void GPENCIL_engine_init(void *ved)
stl->pd->v3d_color_type = (v3d->shading.type == OB_SOLID) ? v3d->shading.color_type : -1;
/* Special case: If Vertex Paint mode, use always Vertex mode. */
if (v3d->shading.type == OB_SOLID && ctx->obact && ctx->obact->type == OB_GPENCIL &&
if (v3d->shading.type == OB_SOLID && ctx->obact && ctx->obact->type == OB_GPENCIL_LEGACY &&
ctx->obact->mode == OB_MODE_VERTEX_GPENCIL) {
stl->pd->v3d_color_type = V3D_SHADING_VERTEX_COLOR;
}
@ -235,7 +235,7 @@ void GPENCIL_cache_init(void *ved)
pd->do_fast_drawing = false;
pd->obact = draw_ctx->obact;
if (pd->obact && pd->obact->type == OB_GPENCIL && !(pd->draw_depth_only)) {
if (pd->obact && pd->obact->type == OB_GPENCIL_LEGACY && !(pd->draw_depth_only)) {
/* Check if active object has a temp stroke data. */
bGPdata *gpd = (bGPdata *)pd->obact->data;
if (gpd->runtime.sbuffer_used > 0) {
@ -592,7 +592,7 @@ void GPENCIL_cache_populate(void *ved, Object *ob)
return;
}
if (ob->data && (ob->type == OB_GPENCIL) && (ob->dt >= OB_SOLID)) {
if (ob->data && (ob->type == OB_GPENCIL_LEGACY) && (ob->dt >= OB_SOLID)) {
gpIterPopulateData iter = {0};
iter.ob = ob;
iter.pd = pd;
@ -917,7 +917,7 @@ void GPENCIL_draw_scene(void *ved)
/* Fade 3D objects. */
if ((!pd->is_render) && (pd->fade_3d_object_opacity > -1.0f) && (pd->obact != NULL) &&
(pd->obact->type == OB_GPENCIL)) {
(pd->obact->type == OB_GPENCIL_LEGACY)) {
float background_color[3];
ED_view3d_background_color_get(pd->scene, pd->v3d, background_color);
/* Blend color. */

View File

@ -143,7 +143,7 @@ static void GPENCIL_render_cache(void *vedata,
struct RenderEngine *UNUSED(engine),
Depsgraph *UNUSED(depsgraph))
{
if (ob && ELEM(ob->type, OB_GPENCIL, OB_LAMP)) {
if (ob && ELEM(ob->type, OB_GPENCIL_LEGACY, OB_LAMP)) {
if (DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF) {
GPENCIL_cache_populate(vedata, ob);
}

View File

@ -329,7 +329,7 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob)
OB_CURVES_LEGACY,
OB_SURF,
OB_FONT,
OB_GPENCIL,
OB_GPENCIL_LEGACY,
OB_CURVES,
OB_POINTCLOUD,
OB_VOLUME);
@ -467,7 +467,7 @@ static void OVERLAY_cache_populate(void *vedata, Object *ob)
OVERLAY_metaball_cache_populate(data, ob);
}
break;
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
OVERLAY_gpencil_cache_populate(data, ob);
break;
}

View File

@ -1577,7 +1577,7 @@ void OVERLAY_extra_cache_populate(OVERLAY_Data *vedata, Object *ob)
const bool from_dupli = (ob->base_flag & (BASE_FROM_SET | BASE_FROM_DUPLI)) != 0;
const bool has_bounds = !ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_EMPTY, OB_SPEAKER, OB_LIGHTPROBE);
const bool has_texspace = has_bounds &&
!ELEM(ob->type, OB_EMPTY, OB_LATTICE, OB_ARMATURE, OB_GPENCIL);
!ELEM(ob->type, OB_EMPTY, OB_LATTICE, OB_ARMATURE, OB_GPENCIL_LEGACY);
const bool draw_relations = ((pd->v3d_flag & V3D_HIDE_HELPLINES) == 0) && !is_select_mode;
const bool draw_obcenters = !is_paint_mode &&

View File

@ -45,7 +45,7 @@ void OVERLAY_edit_gpencil_cache_init(OVERLAY_Data *vedata)
Scene *scene = draw_ctx->scene;
ToolSettings *ts = scene->toolsettings;
if (gpd == nullptr || ob->type != OB_GPENCIL) {
if (gpd == nullptr || ob->type != OB_GPENCIL_LEGACY) {
return;
}
@ -223,7 +223,7 @@ void OVERLAY_gpencil_cache_init(OVERLAY_Data *vedata)
pd->edit_curve.show_handles = v3d->overlay.handle_display != CURVE_HANDLE_NONE;
pd->edit_curve.handle_display = v3d->overlay.handle_display;
if (gpd == nullptr || ob->type != OB_GPENCIL) {
if (gpd == nullptr || ob->type != OB_GPENCIL_LEGACY) {
return;
}

View File

@ -311,7 +311,7 @@ void OVERLAY_outline_cache_populate(OVERLAY_Data *vedata,
return;
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
OVERLAY_outline_gpencil(pd, ob);
return;
}

View File

@ -297,7 +297,7 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
shgrp = pd->wires_grp[is_xray][use_coloring];
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
/* TODO(fclem): Make GPencil objects have correct bound-box. */
DRW_shgroup_call_no_cull(shgrp, geom, ob);
}

View File

@ -880,7 +880,7 @@ GPUBatch *DRW_cache_object_face_wireframe_get(Object *ob)
return DRW_pointcloud_batch_cache_get_dots(ob);
case OB_VOLUME:
return DRW_cache_volume_face_wireframe_get(ob);
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
return DRW_cache_gpencil_face_wireframe_get(ob);
default:
return NULL;
@ -945,7 +945,7 @@ int DRW_cache_object_material_count_get(struct Object *ob)
return DRW_pointcloud_material_count_get(ob->data);
case OB_VOLUME:
return DRW_volume_material_count_get(ob->data);
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
return DRW_gpencil_material_count_get(ob->data);
default:
BLI_assert(0);

View File

@ -603,7 +603,7 @@ static void gpencil_sbuffer_stroke_ensure(bGPdata *gpd, bool do_fill)
ARegion *region = draw_ctx->region;
Object *ob = draw_ctx->obact;
BLI_assert(ob && (ob->type == OB_GPENCIL));
BLI_assert(ob && (ob->type == OB_GPENCIL_LEGACY));
/* Get origin to reproject points. */
float origin[3];

View File

@ -1314,9 +1314,9 @@ static void drw_engines_data_validate(void)
static bool drw_gpencil_engine_needed(Depsgraph *depsgraph, View3D *v3d)
{
const bool exclude_gpencil_rendering = v3d ? (v3d->object_type_exclude_viewport &
(1 << OB_GPENCIL)) != 0 :
(1 << OB_GPENCIL_LEGACY)) != 0 :
false;
return (!exclude_gpencil_rendering) && DEG_id_type_any_exists(depsgraph, ID_GD);
return (!exclude_gpencil_rendering) && DEG_id_type_any_exists(depsgraph, ID_GD_LEGACY);
}
/* -------------------------------------------------------------------- */
@ -1876,7 +1876,7 @@ bool DRW_render_check_grease_pencil(Depsgraph *depsgraph)
deg_iter_settings.depsgraph = depsgraph;
deg_iter_settings.flags = DEG_OBJECT_ITER_FOR_RENDER_ENGINE_FLAGS;
DEG_OBJECT_ITER_BEGIN (&deg_iter_settings, ob) {
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
if (DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF) {
return true;
}

View File

@ -695,7 +695,7 @@ static int acf_object_icon(bAnimListElem *ale)
return ICON_OUTLINER_OB_VOLUME;
case OB_EMPTY:
return ICON_OUTLINER_OB_EMPTY;
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
return ICON_OUTLINER_OB_GREASEPENCIL;
default:
return ICON_OBJECT_DATA;

View File

@ -1847,7 +1847,7 @@ static size_t animdata_filter_gpencil(bAnimContext *ac,
BKE_view_layer_synced_ensure(scene, view_layer);
LISTBASE_FOREACH (Base *, base, BKE_view_layer_object_bases_get(view_layer)) {
/* Only consider this object if it has got some GP data (saving on all the other tests) */
if (base->object && (base->object->type == OB_GPENCIL)) {
if (base->object && (base->object->type == OB_GPENCIL_LEGACY)) {
Object *ob = base->object;
/* firstly, check if object can be included, by the following factors:
@ -2806,7 +2806,7 @@ static size_t animdata_filter_dopesheet_ob(
}
/* object data */
if ((ob->data) && (ob->type != OB_GPENCIL)) {
if ((ob->data) && (ob->type != OB_GPENCIL_LEGACY)) {
tmp_items += animdata_filter_ds_obdata(ac, &tmp_data, ads, ob, filter_mode);
}
@ -2816,7 +2816,8 @@ static size_t animdata_filter_dopesheet_ob(
}
/* grease pencil */
if ((ob->type == OB_GPENCIL) && (ob->data) && !(ads->filterflag & ADS_FILTER_NOGPENCIL)) {
if ((ob->type == OB_GPENCIL_LEGACY) && (ob->data) &&
!(ads->filterflag & ADS_FILTER_NOGPENCIL)) {
tmp_items += animdata_filter_ds_gpencil(ac, &tmp_data, ads, ob->data, filter_mode);
}
}

View File

@ -294,7 +294,7 @@ void ED_armature_bone_rename(Main *bmain,
}
/* fix grease pencil modifiers and vertex groups */
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = (bGPdata *)ob->data;
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {

View File

@ -278,7 +278,7 @@ void ED_armature_pose_select_in_wpaint_mode(const Scene *scene,
Object *ob_active = BKE_view_layer_active_object_get(view_layer);
BLI_assert(ob_active && (ob_active->mode & OB_MODE_ALL_WEIGHT_PAINT));
if (ob_active->type == OB_GPENCIL) {
if (ob_active->type == OB_GPENCIL_LEGACY) {
GpencilVirtualModifierData virtualModifierData;
GpencilModifierData *md = BKE_gpencil_modifiers_get_virtual_modifierlist(ob_active,
&virtualModifierData);

View File

@ -525,7 +525,7 @@ static bool gpencil_generate_weights_poll(bContext *C)
return false;
}
if (ob->type != OB_GPENCIL) {
if (ob->type != OB_GPENCIL_LEGACY) {
return false;
}

View File

@ -86,7 +86,7 @@ static bool gpencil_bake_grease_pencil_animation_poll(bContext *C)
}
/* Check if grease pencil or empty for dupli groups. */
if ((obact == nullptr) || !ELEM(obact->type, OB_GPENCIL, OB_EMPTY)) {
if ((obact == nullptr) || !ELEM(obact->type, OB_GPENCIL_LEGACY, OB_EMPTY)) {
return false;
}
@ -135,7 +135,7 @@ static void gpencil_bake_duplilist(Depsgraph *depsgraph, Scene *scene, Object *o
ListBase *lb;
lb = object_duplilist(depsgraph, scene, ob);
LISTBASE_FOREACH (DupliObject *, dob, lb) {
if (dob->ob->type != OB_GPENCIL) {
if (dob->ob->type != OB_GPENCIL_LEGACY) {
continue;
}
@ -154,7 +154,7 @@ static void gpencil_bake_ob_list(bContext *C, Depsgraph *depsgraph, Scene *scene
/* Add active object. In some files this could not be in selected array. */
Object *obact = CTX_data_active_object(C);
if (obact->type == OB_GPENCIL) {
if (obact->type == OB_GPENCIL_LEGACY) {
elem = MEM_cnew<GpBakeOb>(__func__);
elem->ob = obact;
BLI_addtail(list, elem);
@ -170,7 +170,7 @@ static void gpencil_bake_ob_list(bContext *C, Depsgraph *depsgraph, Scene *scene
continue;
}
/* Add selected objects. */
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
elem = MEM_cnew<GpBakeOb>(__func__);
elem->ob = ob;
BLI_addtail(list, elem);

View File

@ -1468,7 +1468,7 @@ static bool gpencil_convert_poll(bContext *C)
Object *ob = CTX_data_active_object(C);
Scene *scene = CTX_data_scene(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}

View File

@ -221,7 +221,7 @@ static int gpencil_layer_add_exec(bContext *C, wmOperator *op)
else {
/* GP Object */
Object *ob = CTX_data_active_object(C);
if ((ob != NULL) && (ob->type == OB_GPENCIL)) {
if ((ob != NULL) && (ob->type == OB_GPENCIL_LEGACY)) {
gpd = (bGPdata *)ob->data;
PropertyRNA *prop;
char name[128];
@ -536,7 +536,7 @@ enum {
static bool gpencil_layer_duplicate_object_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
@ -561,7 +561,7 @@ static int gpencil_layer_duplicate_object_exec(bContext *C, wmOperator *op)
bGPDlayer *gpl_active = BKE_gpencil_layer_active_get(gpd_src);
CTX_DATA_BEGIN (C, Object *, ob, selected_objects) {
if ((ob == ob_src) || (ob->type != OB_GPENCIL)) {
if ((ob == ob_src) || (ob->type != OB_GPENCIL_LEGACY)) {
continue;
}
bGPdata *gpd_dst = (bGPdata *)ob->data;
@ -2225,7 +2225,7 @@ static bool gpencil_vertex_group_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
Main *bmain = CTX_data_main(C);
const bGPdata *gpd = (const bGPdata *)ob->data;
if (BKE_id_is_editable(bmain, &ob->id) && BKE_id_is_editable(bmain, ob->data) &&
@ -2243,7 +2243,7 @@ static bool gpencil_vertex_group_weight_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
Main *bmain = CTX_data_main(C);
const bGPdata *gpd = (const bGPdata *)ob->data;
if (BKE_id_is_editable(bmain, &ob->id) && BKE_id_is_editable(bmain, ob->data) &&
@ -2839,7 +2839,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
bool ok = false;
/* Ensure we're in right mode and that the active object is correct */
if (!ob_active || ob_active->type != OB_GPENCIL) {
if (!ob_active || ob_active->type != OB_GPENCIL_LEGACY) {
return OPERATOR_CANCELLED;
}
@ -2850,7 +2850,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
/* Ensure all rotations are applied before */
CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) {
if (ob_iter->type == OB_GPENCIL) {
if (ob_iter->type == OB_GPENCIL_LEGACY) {
if ((ob_iter->rot[0] != 0) || (ob_iter->rot[1] != 0) || (ob_iter->rot[2] != 0)) {
BKE_report(op->reports, RPT_ERROR, "Apply all rotations before join objects");
return OPERATOR_CANCELLED;
@ -2878,7 +2878,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
/* loop and join all data */
CTX_DATA_BEGIN (C, Object *, ob_iter, selected_editable_objects) {
if ((ob_iter->type == OB_GPENCIL) && (ob_iter != ob_active)) {
if ((ob_iter->type == OB_GPENCIL_LEGACY) && (ob_iter != ob_active)) {
/* we assume that each datablock is not already used in active object */
if (ob_active->data != ob_iter->data) {
Object *ob_src = ob_iter;
@ -3046,7 +3046,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
static bool gpencil_active_material_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if (ob && ob->data && (ob->type == OB_GPENCIL)) {
if (ob && ob->data && (ob->type == OB_GPENCIL_LEGACY)) {
short *totcolp = BKE_object_material_len_p(ob);
return *totcolp > 0;
}
@ -3648,7 +3648,7 @@ void GPENCIL_OT_set_active_material(wmOperatorType *ot)
static bool gpencil_materials_copy_to_object_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
short *totcolp = BKE_object_material_len_p(ob);
@ -3667,7 +3667,7 @@ static int gpencil_materials_copy_to_object_exec(bContext *C, wmOperator *op)
Material *ma_active = BKE_gpencil_material(ob_src, ob_src->actcol);
CTX_DATA_BEGIN (C, Object *, ob, selected_objects) {
if ((ob == ob_src) || (ob->type != OB_GPENCIL)) {
if ((ob == ob_src) || (ob->type != OB_GPENCIL_LEGACY)) {
continue;
}
/* Duplicate materials. */
@ -3763,7 +3763,7 @@ bool ED_gpencil_add_lattice_modifier(const bContext *C,
static int gpencil_layer_mask_add_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return OPERATOR_CANCELLED;
}
@ -3831,7 +3831,7 @@ void GPENCIL_OT_layer_mask_add(wmOperatorType *ot)
static int gpencil_layer_mask_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return OPERATOR_CANCELLED;
}

View File

@ -91,7 +91,7 @@ static bool gpencil_stroke_edit_poll(bContext *C)
{
/* edit only supported with grease pencil objects */
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
@ -104,7 +104,7 @@ static bool gpencil_strokes_edit3d_poll(bContext *C)
{
/* edit only supported with grease pencil objects */
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
@ -119,12 +119,12 @@ static bool gpencil_editmode_toggle_poll(bContext *C)
{
/* edit only supported with grease pencil objects */
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
/* if using gpencil object, use this gpd */
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
return ob->data != NULL;
}
@ -134,7 +134,7 @@ static bool gpencil_editmode_toggle_poll(bContext *C)
static bool gpencil_stroke_not_in_curve_edit_mode(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
bGPdata *gpd = (bGPdata *)ob->data;
@ -159,7 +159,7 @@ static int gpencil_editmode_toggle_exec(bContext *C, wmOperator *op)
short mode;
/* if using a gpencil object, use this datablock */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
gpd = ob->data;
is_object = true;
}
@ -261,7 +261,7 @@ static bool gpencil_selectmode_toggle_poll(bContext *C)
{
/* edit only supported with grease pencil objects */
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL) || (ob->mode != OB_MODE_EDIT_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY) || (ob->mode != OB_MODE_EDIT_GPENCIL)) {
return false;
}
@ -341,7 +341,7 @@ static bool gpencil_paintmode_toggle_poll(bContext *C)
{
/* if using gpencil object, use this gpd */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
return ob->data != NULL;
}
return ED_gpencil_data_get_active(C) != NULL;
@ -360,7 +360,7 @@ static int gpencil_paintmode_toggle_exec(bContext *C, wmOperator *op)
short mode;
/* if using a gpencil object, use this datablock */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
gpd = ob->data;
is_object = true;
}
@ -457,7 +457,7 @@ static bool gpencil_sculptmode_toggle_poll(bContext *C)
{
/* if using gpencil object, use this gpd */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
return ob->data != NULL;
}
return ED_gpencil_data_get_active(C) != NULL;
@ -476,7 +476,7 @@ static int gpencil_sculptmode_toggle_exec(bContext *C, wmOperator *op)
short mode;
/* if using a gpencil object, use this datablock */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
gpd = ob->data;
is_object = true;
}
@ -566,7 +566,7 @@ static bool gpencil_weightmode_toggle_poll(bContext *C)
{
/* if using gpencil object, use this gpd */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
return ob->data != NULL;
}
return ED_gpencil_data_get_active(C) != NULL;
@ -585,7 +585,7 @@ static int gpencil_weightmode_toggle_exec(bContext *C, wmOperator *op)
short mode;
/* if using a gpencil object, use this datablock */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
gpd = ob->data;
is_object = true;
}
@ -678,7 +678,7 @@ static bool gpencil_vertexmode_toggle_poll(bContext *C)
{
/* if using gpencil object, use this gpd */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
return ob->data != NULL;
}
return ED_gpencil_data_get_active(C) != NULL;
@ -696,7 +696,7 @@ static int gpencil_vertexmode_toggle_exec(bContext *C, wmOperator *op)
short mode;
/* if using a gpencil object, use this datablock */
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
gpd = ob->data;
is_object = true;
}
@ -2818,7 +2818,7 @@ static bool gpencil_snap_poll(bContext *C)
ScrArea *area = CTX_wm_area(C);
Object *ob = CTX_data_active_object(C);
return (ob != NULL) && (ob->type == OB_GPENCIL) &&
return (ob != NULL) && (ob->type == OB_GPENCIL_LEGACY) &&
((area != NULL) && (area->spacetype == SPACE_VIEW3D));
}
@ -4072,7 +4072,7 @@ void GPENCIL_OT_reproject(wmOperatorType *ot)
static int gpencil_recalc_geometry_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return OPERATOR_CANCELLED;
}
@ -5775,7 +5775,7 @@ bool ED_object_gpencil_exit(struct Main *bmain, Object *ob)
static bool gpencil_merge_by_distance_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
bGPdata *gpd = (bGPdata *)ob->data;
@ -5862,7 +5862,7 @@ typedef enum eGP_NormalizeMode {
static bool gpencil_stroke_normalize_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
bGPdata *gpd = (bGPdata *)ob->data;

View File

@ -43,7 +43,7 @@
static bool gpencil_curve_edit_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
bGPdata *gpd = (bGPdata *)ob->data;

View File

@ -2325,7 +2325,7 @@ static bool gpencil_fill_poll(bContext *C)
if (ED_operator_regionactive(C)) {
ScrArea *area = CTX_wm_area(C);
if (area->spacetype == SPACE_VIEW3D) {
if ((obact == NULL) || (obact->type != OB_GPENCIL) ||
if ((obact == NULL) || (obact->type != OB_GPENCIL_LEGACY) ||
(obact->mode != OB_MODE_PAINT_GPENCIL)) {
return false;
}
@ -2480,7 +2480,7 @@ static void gpencil_fill_exit(bContext *C, wmOperator *op)
op->customdata = NULL;
/* drawing batch cache is dirty now */
if ((ob) && (ob->type == OB_GPENCIL) && (ob->data)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY) && (ob->data)) {
bGPdata *gpd2 = ob->data;
DEG_id_tag_update(&gpd2->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
gpd2->flag |= GP_DATA_CACHE_IS_DIRTY;

View File

@ -424,7 +424,7 @@ static bool gpencil_strokes_merge_poll(bContext *C)
{
/* only supported with grease pencil objects */
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
@ -459,7 +459,7 @@ static int gpencil_stroke_merge_exec(bContext *C, wmOperator *op)
Object *ob = CTX_data_active_object(C);
/* sanity checks */
if (!ob || ob->type != OB_GPENCIL) {
if (!ob || ob->type != OB_GPENCIL_LEGACY) {
return OPERATOR_CANCELLED;
}
@ -556,7 +556,7 @@ static bool gpencil_stroke_merge_material_poll(bContext *C)
{
/* only supported with grease pencil objects */
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}

View File

@ -215,7 +215,7 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op)
if (target == GP_TARGET_OB_SELECTED) {
ob_gpencil = BKE_view_layer_non_active_selected_object(scene, CTX_data_view_layer(C), v3d);
if (ob_gpencil != nullptr) {
if (ob_gpencil->type != OB_GPENCIL) {
if (ob_gpencil->type != OB_GPENCIL_LEGACY) {
BKE_report(op->reports, RPT_WARNING, "Target object not a grease pencil, ignoring!");
ob_gpencil = nullptr;
}

View File

@ -171,7 +171,7 @@ static bool gpencil_stroke_sculptmode_poll(bContext *C)
return ((gpd) && (gpd->flag & GP_DATA_STROKE_EDITMODE));
}
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
return GPENCIL_SCULPT_MODE(gpd);
}
@ -184,7 +184,7 @@ static bool gpencil_stroke_weightmode_poll(bContext *C)
bGPdata *gpd = CTX_data_gpencil_data(C);
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
return GPENCIL_WEIGHT_MODE(gpd);
}
@ -197,7 +197,7 @@ static bool gpencil_stroke_vertexmode_poll(bContext *C)
bGPdata *gpd = CTX_data_gpencil_data(C);
Object *ob = CTX_data_active_object(C);
if ((ob) && (ob->type == OB_GPENCIL)) {
if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
return (gpd && (gpd->flag & GP_DATA_STROKE_VERTEXMODE));
}

View File

@ -92,7 +92,7 @@ static int gpencil_convert_old_files_exec(bContext *C, wmOperator *op)
if ((!is_annotation) && (view_layer != NULL)) {
Object *ob;
ob = BKE_object_add_for_data(
bmain, scene, view_layer, OB_GPENCIL, "GP_Scene", &scene->gpd->id, false);
bmain, scene, view_layer, OB_GPENCIL_LEGACY, "GP_Scene", &scene->gpd->id, false);
zero_v3(ob->loc);
DEG_relations_tag_update(bmain); /* added object */

View File

@ -296,7 +296,7 @@ static bool gpencil_draw_poll(bContext *C)
/* only grease pencil object type */
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
@ -2051,7 +2051,7 @@ static bool gpencil_session_initdata(bContext *C, wmOperator *op, tGPsdata *p)
return 0;
}
if ((!obact) || (obact->type != OB_GPENCIL)) {
if ((!obact) || (obact->type != OB_GPENCIL_LEGACY)) {
View3D *v3d = p->area->spacedata.first;
/* if active object doesn't exist or isn't a GP Object, create one */
const float *cur = p->scene->cursor.location;
@ -3308,7 +3308,7 @@ static int gpencil_draw_invoke(bContext *C, wmOperator *op, const wmEvent *event
gpencil_guide_event_handling(C, op, event, p);
}
if ((ob->type == OB_GPENCIL) && ((p->gpd->flag & GP_DATA_STROKE_PAINTMODE) == 0)) {
if ((ob->type == OB_GPENCIL_LEGACY) && ((p->gpd->flag & GP_DATA_STROKE_PAINTMODE) == 0)) {
/* FIXME: use the mode switching operator, this misses notifiers, messages. */
/* Just set paintmode flag... */
p->gpd->flag |= GP_DATA_STROKE_PAINTMODE;

View File

@ -2761,7 +2761,7 @@ static bool gpencil_select_vertex_color_poll(bContext *C)
{
ToolSettings *ts = CTX_data_tool_settings(C);
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
bGPdata *gpd = (bGPdata *)ob->data;

View File

@ -312,7 +312,7 @@ static int gpencil_trace_image_exec(bContext *C, wmOperator *op)
NULL;
if (job->ob_gpencil != NULL) {
if (job->ob_gpencil->type != OB_GPENCIL) {
if (job->ob_gpencil->type != OB_GPENCIL_LEGACY) {
BKE_report(op->reports, RPT_WARNING, "Target object not a grease pencil, ignoring!");
job->ob_gpencil = NULL;
}

View File

@ -94,7 +94,7 @@ bGPdata **ED_gpencil_data_get_pointers_direct(ScrArea *area, Object *ob, Pointer
case SPACE_TOPBAR: /* Top-bar */
case SPACE_VIEW3D: /* 3D-View */
{
if (ob && (ob->type == OB_GPENCIL)) {
if (ob && (ob->type == OB_GPENCIL_LEGACY)) {
/* GP Object. */
if (r_ptr) {
RNA_id_pointer_create(&ob->id, r_ptr);
@ -244,7 +244,7 @@ bGPdata *ED_annotation_data_get_active_direct(ID *screen_id, ScrArea *area, Scen
bGPdata *ED_gpencil_data_get_active(const bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return NULL;
}
return ob->data;
@ -281,7 +281,7 @@ bool ED_gpencil_data_owner_is_annotation(PointerRNA *owner_ptr)
bool ED_gpencil_has_keyframe_v3d(Scene *UNUSED(scene), Object *ob, int cfra)
{
if (ob && ob->data && (ob->type == OB_GPENCIL)) {
if (ob && ob->data && (ob->type == OB_GPENCIL_LEGACY)) {
bGPDlayer *gpl = BKE_gpencil_layer_active_get(ob->data);
if (gpl) {
if (gpl->actframe) {
@ -313,7 +313,7 @@ bool gpencil_add_poll(bContext *C)
bool gpencil_active_layer_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
bGPdata *gpd = (bGPdata *)ob->data;
@ -894,7 +894,7 @@ void ED_gpencil_drawing_reference_get(const Scene *scene,
/* if using a gpencil object at cursor mode, can use the location of the object */
if (align_flag & GP_PROJECT_VIEWSPACE) {
if (ob && (ob->type == OB_GPENCIL)) {
if (ob && (ob->type == OB_GPENCIL_LEGACY)) {
/* fallback (no strokes) - use cursor or object location */
if (align_flag & GP_PROJECT_CURSOR) {
/* use 3D-cursor */
@ -984,7 +984,7 @@ void ED_gpencil_project_stroke_to_plane(const Scene *scene,
else if (axis < 3) {
plane_normal[axis] = 1.0f;
/* if object, apply object rotation */
if (ob && (ob->type == OB_GPENCIL)) {
if (ob && (ob->type == OB_GPENCIL_LEGACY)) {
float mat[4][4];
copy_m4_m4(mat, ob->object_to_world);
@ -1206,7 +1206,7 @@ void ED_gpencil_project_point_to_plane(const Scene *scene,
else if (axis < 3) {
plane_normal[axis] = 1.0f;
/* if object, apply object rotation */
if (ob && (ob->type == OB_GPENCIL)) {
if (ob && (ob->type == OB_GPENCIL_LEGACY)) {
float mat[4][4];
copy_m4_m4(mat, ob->object_to_world);
if ((ts->gpencil_v3d_align & GP_PROJECT_CURSOR) == 0) {
@ -1407,7 +1407,7 @@ Object *ED_gpencil_add_object(bContext *C, const float loc[3], ushort local_view
{
const float rot[3] = {0.0f};
Object *ob = ED_object_add_type(C, OB_GPENCIL, NULL, loc, rot, false, local_view_bits);
Object *ob = ED_object_add_type(C, OB_GPENCIL_LEGACY, NULL, loc, rot, false, local_view_bits);
/* create default brushes and colors */
ED_gpencil_add_defaults(C, ob);
@ -2124,7 +2124,7 @@ void ED_gpencil_update_color_uv(Main *bmain, Material *mat)
Material *gps_ma = NULL;
/* Read all strokes. */
for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = ob->data;
if (gpd == NULL) {
continue;
@ -2761,7 +2761,7 @@ void ED_gpencil_tag_scene_gpencil(Scene *scene)
/* Mark all grease pencil data-blocks of the scene. */
FOREACH_SCENE_COLLECTION_BEGIN (scene, collection) {
FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (collection, ob) {
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = (bGPdata *)ob->data;
gpd->flag |= GP_DATA_CACHE_IS_DIRTY;
DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);

View File

@ -326,7 +326,7 @@ static bool gpencil_transform_fill_poll(bContext *C)
return false;
}
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
bGPdata *gpd = (bGPdata *)ob->data;

View File

@ -99,7 +99,7 @@ static bool is_any_stroke_selected(bContext *C, const bool is_multiedit, const b
static bool gpencil_vertexpaint_mode_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
@ -799,7 +799,7 @@ static bool gpencil_material_to_vertex_poll(bContext *C)
{
/* only supported with grease pencil objects */
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}
@ -995,7 +995,7 @@ static bool gpencil_extract_palette_vertex_poll(bContext *C)
{
/* only supported with grease pencil objects */
Object *ob = CTX_data_active_object(C);
if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
if ((ob == NULL) || (ob->type != OB_GPENCIL_LEGACY)) {
return false;
}

View File

@ -417,7 +417,7 @@ void ED_gpencil_create_lineart(struct bContext *C, struct Object *ob);
/* ------------ Object Utilities ------------ */
/**
* Helper function to create new #OB_GPENCIL Object.
* Helper function to create new #OB_GPENCIL_LEGACY Object.
*/
struct Object *ED_gpencil_add_object(struct bContext *C,
const float loc[3],

View File

@ -342,7 +342,7 @@ static bool eyedropper_gpencil_poll(bContext *C)
{
/* Only valid if the current active object is grease pencil. */
Object *obact = CTX_data_active_object(C);
if ((obact == nullptr) || (obact->type != OB_GPENCIL)) {
if ((obact == nullptr) || (obact->type != OB_GPENCIL_LEGACY)) {
return false;
}

View File

@ -2377,7 +2377,7 @@ int UI_icon_from_idcode(const int idcode)
return ICON_FILE;
case ID_CU_LEGACY:
return ICON_CURVE_DATA;
case ID_GD:
case ID_GD_LEGACY:
return ICON_OUTLINER_DATA_GREASEPENCIL;
case ID_GR:
return ICON_OUTLINER_COLLECTION;

View File

@ -2482,7 +2482,7 @@ static int ui_drop_material_exec(bContext *C, wmOperator *op)
const int target_slot = RNA_int_get(&mat_slot, "slot_index") + 1;
/* only drop grease pencil material on grease pencil objects */
if ((ma->gp_style != nullptr) && (ob->type != OB_GPENCIL)) {
if ((ma->gp_style != nullptr) && (ob->type != OB_GPENCIL_LEGACY)) {
return OPERATOR_CANCELLED;
}

View File

@ -832,7 +832,7 @@ ID *ui_template_id_liboverride_hierarchy_make(
case ID_CA:
case ID_SPK:
case ID_AR:
case ID_GD:
case ID_GD_LEGACY:
case ID_CV:
case ID_PT:
case ID_VO:
@ -1102,7 +1102,7 @@ static const char *template_id_browse_tip(const StructRNA *type)
return N_("Browse Brush to be linked");
case ID_PA:
return N_("Browse Particle Settings to be linked");
case ID_GD:
case ID_GD_LEGACY:
return N_("Browse Grease Pencil Data to be linked");
case ID_MC:
return N_("Browse Movie Clip to be linked");

View File

@ -1304,7 +1304,7 @@ static bool object_gpencil_add_poll(bContext *C)
return false;
}
if (obact && obact->type == OB_GPENCIL) {
if (obact && obact->type == OB_GPENCIL_LEGACY) {
if (obact->mode != OB_MODE_OBJECT) {
return false;
}
@ -1316,7 +1316,8 @@ static bool object_gpencil_add_poll(bContext *C)
static int object_gpencil_add_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C), *ob_orig = ob;
bGPdata *gpd = (ob && (ob->type == OB_GPENCIL)) ? static_cast<bGPdata *>(ob->data) : nullptr;
bGPdata *gpd = (ob && (ob->type == OB_GPENCIL_LEGACY)) ? static_cast<bGPdata *>(ob->data) :
nullptr;
const int type = RNA_enum_get(op->ptr, "type");
const bool use_in_front = RNA_boolean_get(op->ptr, "use_in_front");
@ -1361,7 +1362,7 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op)
}
}
ob = ED_object_add_type(C, OB_GPENCIL, ob_name, loc, rot, true, local_view_bits);
ob = ED_object_add_type(C, OB_GPENCIL_LEGACY, ob_name, loc, rot, true, local_view_bits);
gpd = static_cast<bGPdata *>(ob->data);
newob = true;
}
@ -2266,7 +2267,7 @@ static int object_delete_exec(bContext *C, wmOperator *op)
}
/* if grease pencil object, set cache as dirty */
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = (bGPdata *)ob->data;
DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY);
}
@ -2761,7 +2762,7 @@ static const EnumPropertyItem convert_target_items[] = {
#else
"Mesh from Curve, Surface, Metaball, or Text objects"},
#endif
{OB_GPENCIL,
{OB_GPENCIL_LEGACY,
"GPENCIL",
ICON_OUTLINER_OB_GREASEPENCIL,
"Grease Pencil",
@ -2980,7 +2981,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
if (ob->type == OB_MESH) {
BKE_object_free_modifiers(ob, 0); /* after derivedmesh calls! */
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
BKE_object_free_modifiers(ob, 0); /* after derivedmesh calls! */
BKE_object_free_shaderfx(ob, 0);
}
@ -3013,7 +3014,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
}
}
}
else if (ob->type == OB_MESH && target == OB_GPENCIL) {
else if (ob->type == OB_MESH && target == OB_GPENCIL_LEGACY) {
ob->flag |= OB_DONE;
/* Create a new grease pencil object and copy transformations. */
@ -3245,7 +3246,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
/* Meshes doesn't use the "curve cache". */
BKE_object_free_curve_cache(newob);
}
else if (target == OB_GPENCIL) {
else if (target == OB_GPENCIL_LEGACY) {
ushort local_view_bits = (v3d && v3d->localvd) ? v3d->local_view_uuid : 0;
Object *ob_gpencil = ED_gpencil_add_object(C, newob->loc, local_view_bits);
copy_v3_v3(ob_gpencil->rot, newob->rot);
@ -3280,7 +3281,7 @@ static int object_convert_exec(bContext *C, wmOperator *op)
/* Meshes don't use the "curve cache". */
BKE_object_free_curve_cache(newob);
}
else if (target == OB_GPENCIL) {
else if (target == OB_GPENCIL_LEGACY) {
if (ob->type != OB_CURVES_LEGACY) {
ob->flag &= ~OB_DONE;
BKE_report(op->reports, RPT_ERROR, "Convert Surfaces to Grease Pencil is not supported");
@ -3528,7 +3529,7 @@ static void object_convert_ui(bContext * /*C*/, wmOperator *op)
if (target == OB_MESH) {
uiItemR(layout, op->ptr, "merge_customdata", 0, nullptr, ICON_NONE);
}
else if (target == OB_GPENCIL) {
else if (target == OB_GPENCIL_LEGACY) {
uiItemR(layout, op->ptr, "thickness", 0, nullptr, ICON_NONE);
uiItemR(layout, op->ptr, "angle", 0, nullptr, ICON_NONE);
uiItemR(layout, op->ptr, "offset", 0, nullptr, ICON_NONE);
@ -4106,7 +4107,7 @@ static bool object_join_poll(bContext *C)
return false;
}
if (ELEM(ob->type, OB_MESH, OB_CURVES_LEGACY, OB_SURF, OB_ARMATURE, OB_GPENCIL)) {
if (ELEM(ob->type, OB_MESH, OB_CURVES_LEGACY, OB_SURF, OB_ARMATURE, OB_GPENCIL_LEGACY)) {
return ED_operator_screenactive(C);
}
return false;
@ -4133,7 +4134,7 @@ static int object_join_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = (bGPdata *)ob->data;
if ((!gpd) || GPENCIL_ANY_MODE(gpd)) {
BKE_report(op->reports, RPT_ERROR, "This data does not support joining in this mode");
@ -4151,7 +4152,7 @@ static int object_join_exec(bContext *C, wmOperator *op)
else if (ob->type == OB_ARMATURE) {
ret = ED_armature_join_objects_exec(C, op);
}
else if (ob->type == OB_GPENCIL) {
else if (ob->type == OB_GPENCIL_LEGACY) {
ret = ED_gpencil_join_objects_exec(C, op);
}

View File

@ -461,7 +461,7 @@ XFormObjectData *ED_object_data_xform_create_ex(ID *id, bool is_edit_mode)
xod_base = &xod->base;
break;
}
case ID_GD: {
case ID_GD_LEGACY: {
bGPdata *gpd = (bGPdata *)id;
const int elem_array_len = BKE_gpencil_stroke_point_count(gpd);
XFormObjectData_GPencil *xod = static_cast<XFormObjectData_GPencil *>(
@ -619,7 +619,7 @@ void ED_object_data_xform_by_mat4(struct XFormObjectData *xod_base, const float
metaball_coords_and_quats_apply_with_mat4(mb, xod->elem_array, mat);
break;
}
case ID_GD: {
case ID_GD_LEGACY: {
bGPdata *gpd = (bGPdata *)xod_base->id;
XFormObjectData_GPencil *xod = (XFormObjectData_GPencil *)xod_base;
BKE_gpencil_point_coords_apply_with_mat4(gpd, xod->elem_array, mat);
@ -718,7 +718,7 @@ void ED_object_data_xform_restore(struct XFormObjectData *xod_base)
metaball_coords_and_quats_apply(mb, xod->elem_array);
break;
}
case ID_GD: {
case ID_GD_LEGACY: {
bGPdata *gpd = (bGPdata *)xod_base->id;
XFormObjectData_GPencil *xod = (XFormObjectData_GPencil *)xod_base;
BKE_gpencil_point_coords_apply(gpd, xod->elem_array);
@ -770,7 +770,7 @@ void ED_object_data_xform_tag_update(struct XFormObjectData *xod_base)
DEG_id_tag_update(&mb->id, ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE);
break;
}
case ID_GD: {
case ID_GD_LEGACY: {
/* Generic update. */
bGPdata *gpd = (bGPdata *)xod_base->id;
DEG_id_tag_update(&gpd->id, ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE);

View File

@ -1737,7 +1737,7 @@ static int object_mode_set_exec(bContext *C, wmOperator *op)
const bool toggle = RNA_boolean_get(op->ptr, "toggle");
/* by default the operator assume is a mesh, but if gp object change mode */
if ((ob->type == OB_GPENCIL) && (mode == OB_MODE_EDIT)) {
if ((ob->type == OB_GPENCIL_LEGACY) && (mode == OB_MODE_EDIT)) {
mode = OB_MODE_EDIT_GPENCIL;
}

View File

@ -60,7 +60,7 @@ GpencilModifierData *ED_object_gpencil_modifier_add(
GpencilModifierData *new_md = NULL;
const GpencilModifierTypeInfo *mti = BKE_gpencil_modifier_get_info(type);
if (ob->type != OB_GPENCIL) {
if (ob->type != OB_GPENCIL_LEGACY) {
BKE_reportf(reports, RPT_WARNING, "Modifiers cannot be added to object '%s'", ob->id.name + 2);
return NULL;
}
@ -234,7 +234,7 @@ static bool gpencil_modifier_apply_obdata(
return false;
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
if (ELEM(NULL, ob, ob->data)) {
return false;
}
@ -261,7 +261,7 @@ bool ED_object_gpencil_modifier_apply(Main *bmain,
int UNUSED(mode))
{
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
if (ob->mode != OB_MODE_OBJECT) {
BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied in paint, sculpt or edit mode");
return false;
@ -849,7 +849,7 @@ static int gpencil_modifier_copy_to_selected_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
if (obact->type != OB_GPENCIL) {
if (obact->type != OB_GPENCIL_LEGACY) {
BKE_reportf(op->reports,
RPT_ERROR,
"Source object '%s' is not a grease pencil object",
@ -862,7 +862,7 @@ static int gpencil_modifier_copy_to_selected_exec(bContext *C, wmOperator *op)
continue;
}
if (ob->type != OB_GPENCIL) {
if (ob->type != OB_GPENCIL_LEGACY) {
BKE_reportf(op->reports,
RPT_WARNING,
"Destination object '%s' is not a grease pencil object",
@ -905,7 +905,7 @@ static bool gpencil_modifier_copy_to_selected_poll(bContext *C)
continue;
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
found_supported_objects = true;
break;
}

View File

@ -136,7 +136,7 @@ bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode)
return true;
}
break;
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
if (mode & (OB_MODE_EDIT_GPENCIL | OB_MODE_ALL_PAINT_GPENCIL)) {
return true;
}
@ -193,7 +193,7 @@ bool ED_object_mode_set_ex(bContext *C, eObjectMode mode, bool use_undo, ReportL
return (mode == OB_MODE_OBJECT);
}
if ((ob->type == OB_GPENCIL) && (mode == OB_MODE_EDIT)) {
if ((ob->type == OB_GPENCIL_LEGACY) && (mode == OB_MODE_EDIT)) {
mode = OB_MODE_EDIT_GPENCIL;
}
@ -291,7 +291,7 @@ static bool ed_object_mode_generic_exit_ex(
}
ED_object_particle_edit_mode_exit_ex(scene, ob);
}
else if (ob->type == OB_GPENCIL) {
else if (ob->type == OB_GPENCIL_LEGACY) {
/* Accounted for above. */
BLI_assert((ob->mode & OB_MODE_OBJECT) == 0);
if (only_test) {
@ -355,7 +355,7 @@ void ED_object_posemode_set_for_weight_paint(bContext *C,
Object *ob,
const bool is_mode_set)
{
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
GpencilVirtualModifierData virtualModifierData;
GpencilModifierData *md = BKE_gpencil_modifiers_get_virtual_modifierlist(ob,
&virtualModifierData);

View File

@ -124,7 +124,7 @@ static void object_force_modifier_update_for_bind(Depsgraph *depsgraph, Object *
else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) {
BKE_displist_make_curveTypes(depsgraph, scene_eval, ob_eval, false);
}
else if (ob->type == OB_GPENCIL) {
else if (ob->type == OB_GPENCIL_LEGACY) {
BKE_gpencil_modifiers_calc(depsgraph, scene_eval, ob_eval);
}
else if (ob->type == OB_CURVES) {

View File

@ -733,7 +733,7 @@ bool ED_object_parent_set(ReportList *reports,
invert_m4_m4(ob->parentinv, workob.object_to_world);
}
else if (is_armature_parent && (ob->type == OB_GPENCIL) && (par->type == OB_ARMATURE)) {
else if (is_armature_parent && (ob->type == OB_GPENCIL_LEGACY) && (par->type == OB_ARMATURE)) {
if (partype == PAR_ARMATURE) {
ED_gpencil_add_armature(C, reports, ob, par);
}
@ -751,7 +751,7 @@ bool ED_object_parent_set(ReportList *reports,
invert_m4_m4(ob->parentinv, workob.object_to_world);
}
else if ((ob->type == OB_GPENCIL) && (par->type == OB_LATTICE)) {
else if ((ob->type == OB_GPENCIL_LEGACY) && (par->type == OB_LATTICE)) {
/* Add Lattice modifier */
if (partype == PAR_LATTICE) {
ED_gpencil_add_lattice_modifier(C, reports, ob, par);
@ -965,7 +965,7 @@ static int parent_set_invoke_menu(bContext *C, wmOperatorType *ot)
if (child->type == OB_MESH) {
has_children_of_type.mesh = true;
}
if (child->type == OB_GPENCIL) {
if (child->type == OB_GPENCIL_LEGACY) {
has_children_of_type.gpencil = true;
}
if (child->type == OB_CURVES) {
@ -1432,7 +1432,7 @@ static bool allow_make_links_data(const int type, Object *ob_src, Object *ob_dst
/* Linking non-grease-pencil materials to a grease-pencil object causes issues.
* We make sure that if one of the objects is a grease-pencil object, the other must be
* as well. */
((ob_src->type == OB_GPENCIL) == (ob_dst->type == OB_GPENCIL))) {
((ob_src->type == OB_GPENCIL_LEGACY) == (ob_dst->type == OB_GPENCIL_LEGACY))) {
return true;
}
break;
@ -1456,7 +1456,7 @@ static bool allow_make_links_data(const int type, Object *ob_src, Object *ob_dst
}
break;
case MAKE_LINKS_SHADERFX:
if ((ob_src->type == OB_GPENCIL) && (ob_dst->type == OB_GPENCIL)) {
if ((ob_src->type == OB_GPENCIL_LEGACY) && (ob_dst->type == OB_GPENCIL_LEGACY)) {
return true;
}
break;
@ -1892,7 +1892,7 @@ static void single_obdata_users(
ob->data,
BKE_id_copy_ex(bmain, ob->data, NULL, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS));
break;
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
ob->data = ID_NEW_SET(
ob->data,
BKE_id_copy_ex(bmain, ob->data, NULL, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS));

View File

@ -60,7 +60,7 @@ ShaderFxData *ED_object_shaderfx_add(
ShaderFxData *new_fx = NULL;
const ShaderFxTypeInfo *fxi = BKE_shaderfx_get_info(type);
if (ob->type != OB_GPENCIL) {
if (ob->type != OB_GPENCIL_LEGACY) {
BKE_reportf(reports, RPT_WARNING, "Effect cannot be added to object '%s'", ob->id.name + 2);
return NULL;
}

View File

@ -710,7 +710,7 @@ static int apply_objects_internal(bContext *C,
OB_CURVES_LEGACY,
OB_SURF,
OB_FONT,
OB_GPENCIL,
OB_GPENCIL_LEGACY,
OB_CURVES,
OB_POINTCLOUD)) {
ID *obdata = static_cast<ID *>(ob->data);
@ -770,7 +770,7 @@ static int apply_objects_internal(bContext *C,
}
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
if (gpd) {
if (gpd->layers.first) {
@ -792,7 +792,7 @@ static int apply_objects_internal(bContext *C,
"Can't apply to a GP data-block where all layers are parented: Object "
"\"%s\", %s \"%s\", aborting",
ob->id.name + 2,
BKE_idtype_idcode_to_name(ID_GD),
BKE_idtype_idcode_to_name(ID_GD_LEGACY),
gpd->id.name + 2);
changed = false;
}
@ -804,7 +804,7 @@ static int apply_objects_internal(bContext *C,
RPT_ERROR,
R"(Can't apply to GP data-block with no layers: Object "%s", %s "%s", aborting)",
ob->id.name + 2,
BKE_idtype_idcode_to_name(ID_GD),
BKE_idtype_idcode_to_name(ID_GD_LEGACY),
gpd->id.name + 2);
}
}
@ -939,7 +939,7 @@ static int apply_objects_internal(bContext *C,
cu->fsize *= scale;
}
}
else if (ob->type == OB_GPENCIL) {
else if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
BKE_gpencil_transform(gpd, mat);
}
@ -1595,7 +1595,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
lt->id.tag |= LIB_TAG_DOIT;
do_inverse_offset = true;
}
else if (ob->type == OB_GPENCIL) {
else if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
float gpcenter[3];
if (gpd) {

View File

@ -3635,7 +3635,7 @@ static int vgroup_do_remap(Object *ob, const char *name_array, wmOperator *op)
int dvert_tot = 0;
/* Grease pencil stores vertex groups separately for each stroke,
* so remap each stroke's weights separately. */
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
bGPdata *gpd = static_cast<bGPdata *>(ob->data);
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {

View File

@ -647,7 +647,7 @@ static int gather_frames_to_render_for_id(LibraryIDLinkCallbackData *cb_data)
return IDWALK_RET_STOP_RECURSION;
/* Special cases: */
case ID_GD: /* bGPdata, (Grease Pencil) */
case ID_GD_LEGACY: /* bGPdata, (Grease Pencil) */
/* In addition to regular ID's animdata, GreasePencil uses a specific frame-based animation
* system that requires specific handling here. */
gather_frames_to_render_for_grease_pencil(oglrender, (bGPdata *)id);

View File

@ -758,7 +758,7 @@ static int new_material_exec(bContext *C, wmOperator * /*op*/)
}
else {
const char *name = DATA_("Material");
if (!(ob != nullptr && ob->type == OB_GPENCIL)) {
if (!(ob != nullptr && ob->type == OB_GPENCIL_LEGACY)) {
ma = BKE_material_add(bmain, name);
}
else {

View File

@ -3084,7 +3084,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
if (ob) {
ob_to_keylist(&ads, ob, keylist, 0);
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
const bool active = !(scene->flag & SCE_KEYS_NO_SELONLY);
gpencil_to_keylist(&ads, ob->data, keylist, active);
}

View File

@ -256,7 +256,7 @@ static bool buttons_context_path_data(ButsContextPath *path, int type)
if (RNA_struct_is_a(ptr->type, &RNA_LightProbe) && ELEM(type, -1, OB_LIGHTPROBE)) {
return true;
}
if (RNA_struct_is_a(ptr->type, &RNA_GreasePencil) && ELEM(type, -1, OB_GPENCIL)) {
if (RNA_struct_is_a(ptr->type, &RNA_GreasePencil) && ELEM(type, -1, OB_GPENCIL_LEGACY)) {
return true;
}
if (RNA_struct_is_a(ptr->type, &RNA_Curves) && ELEM(type, -1, OB_CURVES)) {
@ -297,7 +297,7 @@ static bool buttons_context_path_modifier(ButsContextPath *path)
OB_FONT,
OB_SURF,
OB_LATTICE,
OB_GPENCIL,
OB_GPENCIL_LEGACY,
OB_CURVES,
OB_POINTCLOUD,
OB_VOLUME)) {
@ -319,7 +319,7 @@ static bool buttons_context_path_shaderfx(ButsContextPath *path)
if (buttons_context_path_object(path)) {
Object *ob = path->ptr[path->len - 1].data;
if (ob && ELEM(ob->type, OB_GPENCIL)) {
if (ob && ELEM(ob->type, OB_GPENCIL_LEGACY)) {
return true;
}
}

View File

@ -994,7 +994,8 @@ static void image_id_remap(ScrArea *UNUSED(area),
{
SpaceImage *simg = (SpaceImage *)slink;
if (!BKE_id_remapper_has_mapping_for(mappings, FILTER_ID_IM | FILTER_ID_GD | FILTER_ID_MSK)) {
if (!BKE_id_remapper_has_mapping_for(mappings,
FILTER_ID_IM | FILTER_ID_GD_LEGACY | FILTER_ID_MSK)) {
return;
}

View File

@ -164,7 +164,7 @@ static void stats_object(Object *ob,
stats->totlampsel++;
}
break;
case OB_GPENCIL: {
case OB_GPENCIL_LEGACY: {
if (is_selected) {
bGPdata *gpd = (bGPdata *)ob->data;
if (!BLI_gset_add(objects_gset, gpd)) {
@ -556,7 +556,7 @@ static void get_stats_string(char *info,
*ofs += BLI_snprintf_rlen(
info + *ofs, len - *ofs, TIP_("Bones:%s/%s"), stats_fmt->totbonesel, stats_fmt->totbone);
}
else if ((ob) && (ob->type == OB_GPENCIL)) {
else if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
*ofs += BLI_snprintf_rlen(info + *ofs,
len - *ofs,
TIP_("Layers:%s | Frames:%s | Strokes:%s | Points:%s"),
@ -776,7 +776,7 @@ void ED_info_draw_stats(
stats_row(col1, labels[OBJ], col2, stats_fmt.totobjsel, stats_fmt.totobj, y, height);
stats_row(col1, labels[BONES], col2, stats_fmt.totbonesel, stats_fmt.totbone, y, height);
}
else if ((ob) && (ob->type == OB_GPENCIL)) {
else if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) {
stats_row(col1, labels[LAYERS], col2, stats_fmt.totgplayer, nullptr, y, height);
stats_row(col1, labels[FRAMES], col2, stats_fmt.totgpframe, nullptr, y, height);
stats_row(col1, labels[STROKES], col2, stats_fmt.totgpstroke, nullptr, y, height);

View File

@ -950,7 +950,7 @@ static void node_id_remap_cb(ID *old_id, ID *new_id, void *user_data)
snode->from = new_id;
}
}
else if (GS(old_id->name) == ID_GD) {
else if (GS(old_id->name) == ID_GD_LEGACY) {
if ((ID *)snode->gpd == old_id) {
snode->gpd = (bGPdata *)new_id;
id_us_min(old_id);

View File

@ -636,7 +636,7 @@ static int material_drop_invoke(bContext *C, wmOperator * /*op*/, const wmEvent
}
/* only drop grease pencil material on grease pencil objects */
if ((ma->gp_style != nullptr) && (ob->type != OB_GPENCIL)) {
if ((ma->gp_style != nullptr) && (ob->type != OB_GPENCIL_LEGACY)) {
return OPERATOR_CANCELLED;
}
@ -828,7 +828,7 @@ static bool datastack_drop_are_types_valid(StackDropData *drop_data)
switch (drop_data->drag_tselem->type) {
case TSE_MODIFIER_BASE:
case TSE_MODIFIER:
return (ob_parent->type == OB_GPENCIL) == (ob_dst->type == OB_GPENCIL);
return (ob_parent->type == OB_GPENCIL_LEGACY) == (ob_dst->type == OB_GPENCIL_LEGACY);
break;
case TSE_CONSTRAINT_BASE:
case TSE_CONSTRAINT:
@ -836,7 +836,7 @@ static bool datastack_drop_are_types_valid(StackDropData *drop_data)
break;
case TSE_GPENCIL_EFFECT_BASE:
case TSE_GPENCIL_EFFECT:
return ob_parent->type == OB_GPENCIL && ob_dst->type == OB_GPENCIL;
return ob_parent->type == OB_GPENCIL_LEGACY && ob_dst->type == OB_GPENCIL_LEGACY;
break;
}
@ -949,7 +949,7 @@ static void datastack_drop_link(bContext *C, StackDropData *drop_data)
break;
}
case TSE_GPENCIL_EFFECT_BASE:
if (ob_dst->type != OB_GPENCIL) {
if (ob_dst->type != OB_GPENCIL_LEGACY) {
return;
}
@ -967,11 +967,12 @@ static void datastack_drop_copy(bContext *C, StackDropData *drop_data)
switch (drop_data->drag_tselem->type) {
case TSE_MODIFIER:
if (drop_data->ob_parent->type == OB_GPENCIL && ob_dst->type == OB_GPENCIL) {
if (drop_data->ob_parent->type == OB_GPENCIL_LEGACY && ob_dst->type == OB_GPENCIL_LEGACY) {
ED_object_gpencil_modifier_copy_to_object(
ob_dst, static_cast<GpencilModifierData *>(drop_data->drag_directdata));
}
else if (drop_data->ob_parent->type != OB_GPENCIL && ob_dst->type != OB_GPENCIL) {
else if (drop_data->ob_parent->type != OB_GPENCIL_LEGACY &&
ob_dst->type != OB_GPENCIL_LEGACY) {
ED_object_modifier_copy_to_object(C,
ob_dst,
drop_data->ob_parent,
@ -992,7 +993,7 @@ static void datastack_drop_copy(bContext *C, StackDropData *drop_data)
}
break;
case TSE_GPENCIL_EFFECT: {
if (ob_dst->type != OB_GPENCIL) {
if (ob_dst->type != OB_GPENCIL_LEGACY) {
return;
}
@ -1019,7 +1020,7 @@ static void datastack_drop_reorder(bContext *C, ReportList *reports, StackDropDa
int index = 0;
switch (drop_data->drag_tselem->type) {
case TSE_MODIFIER:
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
index = outliner_get_insert_index(
drag_te, drop_te, insert_type, &ob->greasepencil_modifiers);
ED_object_gpencil_modifier_move_to_index(

View File

@ -119,7 +119,7 @@ static bool is_object_data_in_editmode(const ID *id, const Object *obact)
const short id_type = GS(id->name);
if (id_type == ID_GD && obact && obact->data == id) {
if (id_type == ID_GD_LEGACY && obact && obact->data == id) {
bGPdata *gpd = (bGPdata *)id;
return GPENCIL_EDIT_MODE(gpd);
}
@ -2357,7 +2357,7 @@ static BIFIconID tree_element_get_icon_from_id(const ID *id)
else {
return ICON_OUTLINER_OB_EMPTY;
}
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
return ICON_OUTLINER_OB_GREASEPENCIL;
}
@ -2454,7 +2454,7 @@ static BIFIconID tree_element_get_icon_from_id(const ID *id)
}
case ID_LS:
return ICON_LINE_DATA;
case ID_GD:
case ID_GD_LEGACY:
return ICON_OUTLINER_DATA_GREASEPENCIL;
case ID_LP: {
const LightProbe *lp = (LightProbe *)id;
@ -2645,7 +2645,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
Object *ob = (Object *)tselem->id;
data.drag_id = tselem->id;
if (ob->type != OB_GPENCIL) {
if (ob->type != OB_GPENCIL_LEGACY) {
ModifierData *md = static_cast<ModifierData *>(BLI_findlink(&ob->modifiers, tselem->nr));
const ModifierTypeInfo *modifier_type = static_cast<const ModifierTypeInfo *>(
BKE_modifier_get_info((ModifierType)md->type));

View File

@ -127,7 +127,7 @@ struct TreeElementIcon {
ID_AC, \
ID_BR, \
ID_PA, \
ID_GD, \
ID_GD_LEGACY, \
ID_LS, \
ID_LP, \
ID_CV, \

View File

@ -1220,7 +1220,7 @@ static void outliner_set_properties_tab(bContext *C, TreeElement *te, TreeStoreE
case ID_KE:
case ID_SPK:
case ID_AR:
case ID_GD:
case ID_GD_LEGACY:
case ID_LP:
case ID_CV:
case ID_PT:
@ -1270,7 +1270,7 @@ static void outliner_set_properties_tab(bContext *C, TreeElement *te, TreeStoreE
if (tselem->type != TSE_MODIFIER_BASE) {
Object *ob = (Object *)tselem->id;
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
BKE_gpencil_modifier_panel_expand(static_cast<GpencilModifierData *>(te->directdata));
}
else {

View File

@ -153,7 +153,7 @@ static void get_element_operation_type(
case ID_NT:
case ID_BR:
case ID_PA:
case ID_GD:
case ID_GD_LEGACY:
case ID_MC:
case ID_MSK:
case ID_PAL:

View File

@ -511,7 +511,7 @@ static void outliner_add_object_contents(SpaceOutliner *space_outliner,
}
/* vertex groups */
if (ELEM(ob->type, OB_MESH, OB_GPENCIL, OB_LATTICE)) {
if (ELEM(ob->type, OB_MESH, OB_GPENCIL_LEGACY, OB_LATTICE)) {
const ListBase *defbase = BKE_object_defgroup_list(ob);
if (!BLI_listbase_is_empty(defbase)) {
TreeElement *tenla = outliner_add_element(
@ -727,7 +727,7 @@ static void outliner_add_id_contents(SpaceOutliner *space_outliner,
}
break;
}
case ID_GD: {
case ID_GD_LEGACY: {
bGPdata *gpd = (bGPdata *)id;
if (outliner_animdata_test(gpd->adt)) {
@ -1438,8 +1438,8 @@ static bool outliner_element_visible_get(const Scene *scene,
return false;
}
break;
case OB_GPENCIL:
if (exclude_filter & SO_FILTER_NO_OB_GPENCIL) {
case OB_GPENCIL_LEGACY:
if (exclude_filter & SO_FILTER_NO_OB_GPENCIL_LEGACY) {
return false;
}
break;

View File

@ -58,7 +58,7 @@ std::unique_ptr<TreeElementID> TreeElementID::createFromID(TreeElement &legacy_t
case ID_MSK:
case ID_LS:
case ID_LP:
case ID_GD:
case ID_GD_LEGACY:
case ID_WS:
case ID_CV:
case ID_PT:

View File

@ -882,7 +882,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
BKE_view_layer_synced_ensure(scene_eval, view_layer_eval);
Object *ob_eval = BKE_view_layer_active_object_get(view_layer_eval);
Object *obedit = CTX_data_edit_object(C);
const bGPdata *gpd_eval = ob_eval && (ob_eval->type == OB_GPENCIL) ? ob_eval->data : NULL;
const bGPdata *gpd_eval = ob_eval && (ob_eval->type == OB_GPENCIL_LEGACY) ? ob_eval->data : NULL;
const bool is_gp_edit = gpd_eval ? GPENCIL_ANY_MODE(gpd_eval) : false;
const bool is_face_map = ((is_gp_edit == false) && region->gizmo_map &&
WM_gizmomap_is_any_selected(region->gizmo_map));

View File

@ -3088,7 +3088,7 @@ static int view3d_select_exec(bContext *C, wmOperator *op)
Object *obedit = CTX_data_edit_object(C);
Object *obact = CTX_data_active_object(C);
if (obact && obact->type == OB_GPENCIL && GPENCIL_ANY_MODE((bGPdata *)obact->data)) {
if (obact && obact->type == OB_GPENCIL_LEGACY && GPENCIL_ANY_MODE((bGPdata *)obact->data)) {
/* Prevent acting on Grease Pencil (when not in object mode), it implements its own selection
* operator in other modes. We might still fall trough to here (because that operator uses
* OPERATOR_PASS_THROUGH to make tweak work) but if we don't stop here code below assumes we
@ -3664,8 +3664,7 @@ static bool do_mesh_box_select(ViewContext *vc,
}
if (ts->selectmode & SCE_SELECT_EDGE) {
/* Does both use_zbuf and non-use_zbuf versions (need screen cos for both) */
struct BoxSelectUserData_ForMeshEdge cb_data {
};
struct BoxSelectUserData_ForMeshEdge cb_data {};
cb_data.data = &data;
cb_data.esel = use_zbuf ? esel : nullptr;
cb_data.backbuf_offset = use_zbuf ? DRW_select_buffer_context_offset_for_object_elem(

View File

@ -623,7 +623,7 @@ int view3d_opengl_select_ex(ViewContext *vc,
/* While this uses 'alloca' in a loop (which we typically avoid),
* the number of items is nearly always 1, maybe 2..3 in rare cases. */
LinkNode *ob_pose_list = NULL;
if (obact->type == OB_GPENCIL) {
if (obact->type == OB_GPENCIL_LEGACY) {
GpencilVirtualModifierData virtualModifierData;
const GpencilModifierData *md = BKE_gpencil_modifiers_get_virtual_modifierlist(
obact, &virtualModifierData);

View File

@ -66,7 +66,8 @@ bool transdata_check_local_islands(TransInfo *t, short around)
if (t->options & (CTX_CURSOR | CTX_TEXTURE_SPACE)) {
return false;
}
return ((around == V3D_AROUND_LOCAL_ORIGINS) && ELEM(t->obedit_type, OB_MESH, OB_GPENCIL));
return ((around == V3D_AROUND_LOCAL_ORIGINS) &&
ELEM(t->obedit_type, OB_MESH, OB_GPENCIL_LEGACY));
}
/* ************************** SPACE DEPENDENT CODE **************************** */

View File

@ -705,7 +705,7 @@ void postTrans(bContext *C, TransInfo *t)
if (t->data_len_all != 0) {
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
/* free data malloced per trans-data */
if (ELEM(t->obedit_type, OB_CURVES_LEGACY, OB_SURF, OB_GPENCIL) ||
if (ELEM(t->obedit_type, OB_CURVES_LEGACY, OB_SURF, OB_GPENCIL_LEGACY) ||
(t->spacetype == SPACE_GRAPH)) {
TransData *td = tc->data;
for (int a = 0; a < tc->data_len; a++, td++) {

View File

@ -142,7 +142,7 @@ static void gizmo_mesh_extrude_setup(const bContext *C, wmGizmoGroup *gzgroup)
/* Grease pencil does not use `obedit`. */
/* GPXX: Remove if OB_MODE_EDIT_GPENCIL is merged with OB_MODE_EDIT */
const Object *obact = CTX_data_active_object(C);
if (obact->type == OB_GPENCIL) {
if (obact->type == OB_GPENCIL_LEGACY) {
op_idname = "GPENCIL_OT_extrude_move";
}
else if (obact->type == OB_MESH) {

View File

@ -55,12 +55,13 @@ eTfmMode transform_mode_really_used(bContext *C, eTfmMode mode)
bool transdata_check_local_center(const TransInfo *t, short around)
{
return ((around == V3D_AROUND_LOCAL_ORIGINS) &&
((t->options & (CTX_OBJECT | CTX_POSE_BONE)) ||
/* implicit: (t->flag & T_EDIT) */
ELEM(t->obedit_type, OB_MESH, OB_CURVES_LEGACY, OB_MBALL, OB_ARMATURE, OB_GPENCIL) ||
(t->spacetype == SPACE_GRAPH) ||
(t->options & (CTX_MOVIECLIP | CTX_MASK | CTX_PAINT_CURVE | CTX_SEQUENCER_IMAGE))));
return (
(around == V3D_AROUND_LOCAL_ORIGINS) &&
((t->options & (CTX_OBJECT | CTX_POSE_BONE)) ||
/* implicit: (t->flag & T_EDIT) */
ELEM(t->obedit_type, OB_MESH, OB_CURVES_LEGACY, OB_MBALL, OB_ARMATURE, OB_GPENCIL_LEGACY) ||
(t->spacetype == SPACE_GRAPH) ||
(t->options & (CTX_MOVIECLIP | CTX_MASK | CTX_PAINT_CURVE | CTX_SEQUENCER_IMAGE))));
}
bool transform_mode_is_changeable(const int mode)

View File

@ -2968,7 +2968,7 @@ static eSnapMode snap_obj_fn(SnapObjectContext *sctx,
break;
}
case OB_EMPTY:
case OB_GPENCIL:
case OB_GPENCIL_LEGACY:
case OB_LAMP:
retval = snap_object_center(
sctx, ob_eval, obmat, dt->dist_px, sctx->ret.loc, sctx->ret.no, &sctx->ret.index);

View File

@ -178,7 +178,7 @@ static void ed_undo_step_pre(bContext *C,
if (area && (area->spacetype == SPACE_VIEW3D)) {
Object *obact = CTX_data_active_object(C);
if (obact && (obact->type == OB_GPENCIL)) {
if (obact && (obact->type == OB_GPENCIL_LEGACY)) {
ED_gpencil_toggle_brush_cursor(C, false, nullptr);
}
}
@ -212,7 +212,7 @@ static void ed_undo_step_post(bContext *C,
/* Set special modes for grease pencil */
if (area != nullptr && (area->spacetype == SPACE_VIEW3D)) {
Object *obact = CTX_data_active_object(C);
if (obact && (obact->type == OB_GPENCIL)) {
if (obact && (obact->type == OB_GPENCIL_LEGACY)) {
/* set cursor */
if (obact->mode & OB_MODE_ALL_PAINT_GPENCIL) {
ED_gpencil_toggle_brush_cursor(C, true, nullptr);

View File

@ -101,7 +101,7 @@ void ED_editors_init(bContext *C)
/* For multi-edit mode we may already have mode data. */
continue;
}
if (ob->type == OB_GPENCIL) {
if (ob->type == OB_GPENCIL_LEGACY) {
/* Grease pencil does not need a toggle of mode. However we may have a non-active object
* stuck in a grease-pencil edit mode. */
if (ob != obact) {

View File

@ -40,7 +40,7 @@ static bool gpencil_modifier_ui_poll(const bContext *C, PanelType *UNUSED(pt))
{
Object *ob = ED_object_active_context(C);
return (ob != NULL) && (ob->type == OB_GPENCIL);
return (ob != NULL) && (ob->type == OB_GPENCIL_LEGACY);
}
/* -------------------------------------------------------------------- */

Some files were not shown because too many files have changed in this diff Show More