diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h index be13a3c1d2a..02e6088e483 100644 --- a/source/blender/blenkernel/BKE_idtype.h +++ b/source/blender/blenkernel/BKE_idtype.h @@ -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; diff --git a/source/blender/blenkernel/intern/armature_deform.c b/source/blender/blenkernel/intern/armature_deform.c index 973fdbd0c57..21e1208cc82 100644 --- a/source/blender/blenkernel/intern/armature_deform.c +++ b/source/blender/blenkernel/intern/armature_deform.c @@ -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) { diff --git a/source/blender/blenkernel/intern/deform.cc b/source/blender/blenkernel/intern/deform.cc index 048e719c38c..15d37d13f30 100644 --- a/source/blender/blenkernel/intern/deform.cc +++ b/source/blender/blenkernel/intern/deform.cc @@ -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 <->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; } diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 67b52f67cfc..af1b4b5e52c 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -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; } diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c index bf73b9d6ed6..fa3c9b900c7 100644 --- a/source/blender/blenkernel/intern/gpencil_curve.c +++ b/source/blender/blenkernel/intern/gpencil_curve.c @@ -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; } diff --git a/source/blender/blenkernel/intern/gpencil_geom.cc b/source/blender/blenkernel/intern/gpencil_geom.cc index db42ea806c1..3a7ba981aa6 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.cc +++ b/source/blender/blenkernel/intern/gpencil_geom.cc @@ -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; } diff --git a/source/blender/blenkernel/intern/idtype.c b/source/blender/blenkernel/intern/idtype.c index 923582dff4c..c194dff45fd 100644 --- a/source/blender/blenkernel/intern/idtype.c +++ b/source/blender/blenkernel/intern/idtype.c @@ -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); diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c index d09511ec4b3..4d606bbe724 100644 --- a/source/blender/blenkernel/intern/lib_id.c +++ b/source/blender/blenkernel/intern/lib_id.c @@ -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; diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c index f74a6cadd67..303f9e99cdf 100644 --- a/source/blender/blenkernel/intern/lib_query.c +++ b/source/blender/blenkernel/intern/lib_query.c @@ -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; diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c index 0fb52a531ac..a2c5f7a91af 100644 --- a/source/blender/blenkernel/intern/main.c +++ b/source/blender/blenkernel/intern/main.c @@ -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); diff --git a/source/blender/blenkernel/intern/material.cc b/source/blender/blenkernel/intern/material.cc index b34e92837a9..070df777625 100644 --- a/source/blender/blenkernel/intern/material.cc +++ b/source/blender/blenkernel/intern/material.cc @@ -328,7 +328,7 @@ Material ***BKE_object_material_array_p(Object *ob) MetaBall *mb = static_cast(ob->data); return &(mb->mat); } - if (ob->type == OB_GPENCIL) { + if (ob->type == OB_GPENCIL_LEGACY) { bGPdata *gpd = static_cast(ob->data); return &(gpd->mat); } @@ -361,7 +361,7 @@ short *BKE_object_material_len_p(Object *ob) MetaBall *mb = static_cast(ob->data); return &(mb->totcol); } - if (ob->type == OB_GPENCIL) { + if (ob->type == OB_GPENCIL_LEGACY) { bGPdata *gpd = static_cast(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(ob->data), remap, ob->totcol); } - else if (ob->type == OB_GPENCIL) { + else if (ob->type == OB_GPENCIL_LEGACY) { BKE_gpencil_material_remap(static_cast(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); } diff --git a/source/blender/blenkernel/intern/modifier.cc b/source/blender/blenkernel/intern/modifier.cc index 285cd3207aa..5b09b59fdb4 100644 --- a/source/blender/blenkernel/intern/modifier.cc +++ b/source/blender/blenkernel/intern/modifier.cc @@ -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( diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index 97114c6c624..bdcf27a04a1 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -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); } /** \} */ diff --git a/source/blender/blenkernel/intern/object_deform.c b/source/blender/blenkernel/intern/object_deform.c index c1fe10dca6b..5670df70cff 100644 --- a/source/blender/blenkernel/intern/object_deform.c +++ b/source/blender/blenkernel/intern/object_deform.c @@ -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 { diff --git a/source/blender/blenkernel/intern/object_update.cc b/source/blender/blenkernel/intern/object_update.cc index e5bb1b529df..ca513599ccc 100644 --- a/source/blender/blenkernel/intern/object_update.cc +++ b/source/blender/blenkernel/intern/object_update.cc @@ -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: diff --git a/source/blender/blenloader/intern/readfile.cc b/source/blender/blenloader/intern/readfile.cc index 891a9f81358..c49a9ddcb82 100644 --- a/source/blender/blenloader/intern/readfile.cc +++ b/source/blender/blenloader/intern/readfile.cc @@ -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"; diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index fb806a0b124..094ec062381 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -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 */ diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 17b833b56b7..7a809533ff7 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -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; } diff --git a/source/blender/blenloader/intern/versioning_290.cc b/source/blender/blenloader/intern/versioning_290.cc index 646dd089daf..8af830e6e32 100644 --- a/source/blender/blenloader/intern/versioning_290.cc +++ b/source/blender/blenloader/intern/versioning_290.cc @@ -553,7 +553,7 @@ void do_versions_after_linking_290(FileData * /*fd*/, Main *bmain) Scene *scene = static_cast(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(ob->data); diff --git a/source/blender/blenloader/intern/versioning_300.cc b/source/blender/blenloader/intern/versioning_300.cc index 7d6eb591923..f451da4e419 100644 --- a/source/blender/blenloader/intern/versioning_300.cc +++ b/source/blender/blenloader/intern/versioning_300.cc @@ -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; diff --git a/source/blender/blenloader/intern/versioning_defaults.cc b/source/blender/blenloader/intern/versioning_defaults.cc index d19616223cd..a0dca0e01cd 100644 --- a/source/blender/blenloader/intern/versioning_defaults.cc +++ b/source/blender/blenloader/intern/versioning_defaults.cc @@ -464,7 +464,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template) Object *ob = static_cast( 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; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 9c02d8045c0..6625c99f157 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -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, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index b1f5b86ff76..8263cc2b386 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -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; diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 2df65bf15aa..21d9cf60870 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -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; diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 4d2a9a7e850..67da62059d0 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -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; } diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup.cc b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup.cc index 9ccd7ed447b..79f764ddb12 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup.cc @@ -60,7 +60,7 @@ void RuntimeBackup::init_from_id(ID *id) case ID_VO: volume_backup.init_from_volume(reinterpret_cast(id)); break; - case ID_GD: + case ID_GD_LEGACY: gpencil_backup.init_from_gpencil(reinterpret_cast(id)); break; default: @@ -103,7 +103,7 @@ void RuntimeBackup::restore_to_id(ID *id) case ID_VO: volume_backup.restore_to_volume(reinterpret_cast(id)); break; - case ID_GD: + case ID_GD_LEGACY: gpencil_backup.restore_to_gpencil(reinterpret_cast(id)); break; default: diff --git a/source/blender/draw/engines/eevee_next/eevee_instance.cc b/source/blender/draw/engines/eevee_next/eevee_instance.cc index f57e15bd422..cc5a61d661b 100644 --- a/source/blender/draw/engines/eevee_next/eevee_instance.cc +++ b/source/blender/draw/engines/eevee_next/eevee_instance.cc @@ -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: diff --git a/source/blender/draw/engines/eevee_next/eevee_material.hh b/source/blender/draw/engines/eevee_next/eevee_material.hh index c85ff5f8665..0546c2e06bb 100644 --- a/source/blender/draw/engines/eevee_next/eevee_material.hh +++ b/source/blender/draw/engines/eevee_next/eevee_material.hh @@ -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; diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c index 20b515414b8..9cabb729c45 100644 --- a/source/blender/draw/engines/external/external_engine.c +++ b/source/blender/draw/engines/external/external_engine.c @@ -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; diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 16437300dba..759c2441b28 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -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. */ diff --git a/source/blender/draw/engines/gpencil/gpencil_render.c b/source/blender/draw/engines/gpencil/gpencil_render.c index c7ef8677336..b5304237225 100644 --- a/source/blender/draw/engines/gpencil/gpencil_render.c +++ b/source/blender/draw/engines/gpencil/gpencil_render.c @@ -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); } diff --git a/source/blender/draw/engines/overlay/overlay_engine.cc b/source/blender/draw/engines/overlay/overlay_engine.cc index 5b414c8c5f0..0fcfc76e5ca 100644 --- a/source/blender/draw/engines/overlay/overlay_engine.cc +++ b/source/blender/draw/engines/overlay/overlay_engine.cc @@ -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; } diff --git a/source/blender/draw/engines/overlay/overlay_extra.cc b/source/blender/draw/engines/overlay/overlay_extra.cc index 6f32c3ae6ac..d645c75dce2 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.cc +++ b/source/blender/draw/engines/overlay/overlay_extra.cc @@ -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 && diff --git a/source/blender/draw/engines/overlay/overlay_gpencil.cc b/source/blender/draw/engines/overlay/overlay_gpencil.cc index f5988d91e72..9b98978c40f 100644 --- a/source/blender/draw/engines/overlay/overlay_gpencil.cc +++ b/source/blender/draw/engines/overlay/overlay_gpencil.cc @@ -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; } diff --git a/source/blender/draw/engines/overlay/overlay_outline.cc b/source/blender/draw/engines/overlay/overlay_outline.cc index 14ec4481472..f0bba6f2d4c 100644 --- a/source/blender/draw/engines/overlay/overlay_outline.cc +++ b/source/blender/draw/engines/overlay/overlay_outline.cc @@ -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; } diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.cc b/source/blender/draw/engines/overlay/overlay_wireframe.cc index 7053d0039cf..16374c9e06e 100644 --- a/source/blender/draw/engines/overlay/overlay_wireframe.cc +++ b/source/blender/draw/engines/overlay/overlay_wireframe.cc @@ -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); } diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 0d346d56de6..f954f548508 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -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); diff --git a/source/blender/draw/intern/draw_cache_impl_gpencil.cc b/source/blender/draw/intern/draw_cache_impl_gpencil.cc index 5f61cc3f926..820cccb9a65 100644 --- a/source/blender/draw/intern/draw_cache_impl_gpencil.cc +++ b/source/blender/draw/intern/draw_cache_impl_gpencil.cc @@ -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]; diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 0b4d3e2bf35..d2dc71ce25a 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -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 (°_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; } diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index c58d92d39ed..277c3ed386c 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -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; diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index ac73b7995f2..2d5fa1b7a4f 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -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); } } diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c index 579583eb4ea..3a2e4552ac6 100644 --- a/source/blender/editors/armature/armature_naming.c +++ b/source/blender/editors/armature/armature_naming.c @@ -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) { diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c index 21938ad8727..138d0c491d6 100644 --- a/source/blender/editors/armature/pose_select.c +++ b/source/blender/editors/armature/pose_select.c @@ -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); diff --git a/source/blender/editors/gpencil/gpencil_armature.c b/source/blender/editors/gpencil/gpencil_armature.c index 664988d395c..d669345f504 100644 --- a/source/blender/editors/gpencil/gpencil_armature.c +++ b/source/blender/editors/gpencil/gpencil_armature.c @@ -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; } diff --git a/source/blender/editors/gpencil/gpencil_bake_animation.cc b/source/blender/editors/gpencil/gpencil_bake_animation.cc index 4ef2cf9ffd6..cb80469b16a 100644 --- a/source/blender/editors/gpencil/gpencil_bake_animation.cc +++ b/source/blender/editors/gpencil/gpencil_bake_animation.cc @@ -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(__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(__func__); elem->ob = ob; BLI_addtail(list, elem); diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index 5cea5cc0780..c1fd5fa844a 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -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; } diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index c876832bc0c..db53bbaac83 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -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; } diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 6ede4726821..e00be982739 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -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; diff --git a/source/blender/editors/gpencil/gpencil_edit_curve.c b/source/blender/editors/gpencil/gpencil_edit_curve.c index cf29ce0755b..39d4761dc03 100644 --- a/source/blender/editors/gpencil/gpencil_edit_curve.c +++ b/source/blender/editors/gpencil/gpencil_edit_curve.c @@ -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; diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index 20e9cc32c69..f1fe3428875 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -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; diff --git a/source/blender/editors/gpencil/gpencil_merge.c b/source/blender/editors/gpencil/gpencil_merge.c index 8ff3f20cef3..a12c5c3a691 100644 --- a/source/blender/editors/gpencil/gpencil_merge.c +++ b/source/blender/editors/gpencil/gpencil_merge.c @@ -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; } diff --git a/source/blender/editors/gpencil/gpencil_mesh.cc b/source/blender/editors/gpencil/gpencil_mesh.cc index 2b01fce5bf8..3343c5caa8c 100644 --- a/source/blender/editors/gpencil/gpencil_mesh.cc +++ b/source/blender/editors/gpencil/gpencil_mesh.cc @@ -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; } diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index 85cc281ca90..d8c0abaedad 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -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)); } diff --git a/source/blender/editors/gpencil/gpencil_ops_versioning.c b/source/blender/editors/gpencil/gpencil_ops_versioning.c index 60b58b6f513..4ebf6f2d3b2 100644 --- a/source/blender/editors/gpencil/gpencil_ops_versioning.c +++ b/source/blender/editors/gpencil/gpencil_ops_versioning.c @@ -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 */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 669b09ed279..675d6862d66 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -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; diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index 05718eb95e0..113502ccba2 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -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; diff --git a/source/blender/editors/gpencil/gpencil_trace_ops.c b/source/blender/editors/gpencil/gpencil_trace_ops.c index 1a18e10412e..e4fca5ac62a 100644 --- a/source/blender/editors/gpencil/gpencil_trace_ops.c +++ b/source/blender/editors/gpencil/gpencil_trace_ops.c @@ -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; } diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 0d61cbbdc6f..950ababd3b0 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -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); diff --git a/source/blender/editors/gpencil/gpencil_uv.c b/source/blender/editors/gpencil/gpencil_uv.c index 0144ffa07c7..3ed92e922d5 100644 --- a/source/blender/editors/gpencil/gpencil_uv.c +++ b/source/blender/editors/gpencil/gpencil_uv.c @@ -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; diff --git a/source/blender/editors/gpencil/gpencil_vertex_ops.c b/source/blender/editors/gpencil/gpencil_vertex_ops.c index 41f939813e4..c1430d61fa3 100644 --- a/source/blender/editors/gpencil/gpencil_vertex_ops.c +++ b/source/blender/editors/gpencil/gpencil_vertex_ops.c @@ -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; } diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index c95e58f9559..bedbad8232f 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -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], diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_gpencil_color.cc b/source/blender/editors/interface/eyedroppers/eyedropper_gpencil_color.cc index 0c33b9034ad..617f374b797 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_gpencil_color.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_gpencil_color.cc @@ -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; } diff --git a/source/blender/editors/interface/interface_icons.cc b/source/blender/editors/interface/interface_icons.cc index ed46d980fd0..ee77c64b6ed 100644 --- a/source/blender/editors/interface/interface_icons.cc +++ b/source/blender/editors/interface/interface_icons.cc @@ -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; diff --git a/source/blender/editors/interface/interface_ops.cc b/source/blender/editors/interface/interface_ops.cc index 6e9d73f9847..604c493c989 100644 --- a/source/blender/editors/interface/interface_ops.cc +++ b/source/blender/editors/interface/interface_ops.cc @@ -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; } diff --git a/source/blender/editors/interface/interface_templates.cc b/source/blender/editors/interface/interface_templates.cc index 5cde372222a..922c4f7943f 100644 --- a/source/blender/editors/interface/interface_templates.cc +++ b/source/blender/editors/interface/interface_templates.cc @@ -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"); diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc index f2badb37624..ab69c3fe20f 100644 --- a/source/blender/editors/object/object_add.cc +++ b/source/blender/editors/object/object_add.cc @@ -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(ob->data) : nullptr; + bGPdata *gpd = (ob && (ob->type == OB_GPENCIL_LEGACY)) ? static_cast(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(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); } diff --git a/source/blender/editors/object/object_data_transform.cc b/source/blender/editors/object/object_data_transform.cc index ff07a12ef10..8e236f8e966 100644 --- a/source/blender/editors/object/object_data_transform.cc +++ b/source/blender/editors/object/object_data_transform.cc @@ -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( @@ -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); diff --git a/source/blender/editors/object/object_edit.cc b/source/blender/editors/object/object_edit.cc index be015017282..f595258d1ba 100644 --- a/source/blender/editors/object/object_edit.cc +++ b/source/blender/editors/object/object_edit.cc @@ -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; } diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index e85947534cd..416d95c728d 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -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; } diff --git a/source/blender/editors/object/object_modes.cc b/source/blender/editors/object/object_modes.cc index f0874c48f6e..d54e18b0dea 100644 --- a/source/blender/editors/object/object_modes.cc +++ b/source/blender/editors/object/object_modes.cc @@ -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); diff --git a/source/blender/editors/object/object_modifier.cc b/source/blender/editors/object/object_modifier.cc index 0301564f06c..8cfe7b4a63a 100644 --- a/source/blender/editors/object/object_modifier.cc +++ b/source/blender/editors/object/object_modifier.cc @@ -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) { diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 0ceec68e0db..c3f6acaa5c4 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -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)); diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index 4b721cb65a1..d4e7931f238 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -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; } diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc index de4a61a829f..9cb4f29bb5b 100644 --- a/source/blender/editors/object/object_transform.cc +++ b/source/blender/editors/object/object_transform.cc @@ -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(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(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(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(ob->data); float gpcenter[3]; if (gpd) { diff --git a/source/blender/editors/object/object_vgroup.cc b/source/blender/editors/object/object_vgroup.cc index d8e17ac86b7..9cf1ff916fc 100644 --- a/source/blender/editors/object/object_vgroup.cc +++ b/source/blender/editors/object/object_vgroup.cc @@ -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(ob->data); LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { diff --git a/source/blender/editors/render/render_opengl.cc b/source/blender/editors/render/render_opengl.cc index fe50513fa64..7a61f3e11f3 100644 --- a/source/blender/editors/render/render_opengl.cc +++ b/source/blender/editors/render/render_opengl.cc @@ -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); diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index 5ea01677a8e..5f21c51e28b 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -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 { diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 8b0f9154ed5..a9c6ff11a53 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -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); } diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 463e1a14954..046bfda288b 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -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; } } diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index a460f624d84..678ca8bcab4 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -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; } diff --git a/source/blender/editors/space_info/info_stats.cc b/source/blender/editors/space_info/info_stats.cc index f7163c03a57..6fc3229f948 100644 --- a/source/blender/editors/space_info/info_stats.cc +++ b/source/blender/editors/space_info/info_stats.cc @@ -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); diff --git a/source/blender/editors/space_node/space_node.cc b/source/blender/editors/space_node/space_node.cc index 0e82227b855..5bb265924c8 100644 --- a/source/blender/editors/space_node/space_node.cc +++ b/source/blender/editors/space_node/space_node.cc @@ -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); diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.cc b/source/blender/editors/space_outliner/outliner_dragdrop.cc index 3ef63405fe4..90da334e930 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.cc +++ b/source/blender/editors/space_outliner/outliner_dragdrop.cc @@ -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(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( diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index 4682ea661dc..b582064e463 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -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(BLI_findlink(&ob->modifiers, tselem->nr)); const ModifierTypeInfo *modifier_type = static_cast( BKE_modifier_get_info((ModifierType)md->type)); diff --git a/source/blender/editors/space_outliner/outliner_intern.hh b/source/blender/editors/space_outliner/outliner_intern.hh index ad5d653949c..72b48c48b67 100644 --- a/source/blender/editors/space_outliner/outliner_intern.hh +++ b/source/blender/editors/space_outliner/outliner_intern.hh @@ -127,7 +127,7 @@ struct TreeElementIcon { ID_AC, \ ID_BR, \ ID_PA, \ - ID_GD, \ + ID_GD_LEGACY, \ ID_LS, \ ID_LP, \ ID_CV, \ diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index c2975833dcc..ab4c4ebe546 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -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(te->directdata)); } else { diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index a639ccd74ae..b483daf0e93 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -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: diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc index 0adbc073938..938c7906d38 100644 --- a/source/blender/editors/space_outliner/outliner_tree.cc +++ b/source/blender/editors/space_outliner/outliner_tree.cc @@ -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; diff --git a/source/blender/editors/space_outliner/tree/tree_element_id.cc b/source/blender/editors/space_outliner/tree/tree_element_id.cc index 86f5fd4eff5..d4f6865fb75 100644 --- a/source/blender/editors/space_outliner/tree/tree_element_id.cc +++ b/source/blender/editors/space_outliner/tree/tree_element_id.cc @@ -58,7 +58,7 @@ std::unique_ptr 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: diff --git a/source/blender/editors/space_view3d/view3d_navigate.c b/source/blender/editors/space_view3d/view3d_navigate.c index 9f4710b28a0..f360a9d1543 100644 --- a/source/blender/editors/space_view3d/view3d_navigate.c +++ b/source/blender/editors/space_view3d/view3d_navigate.c @@ -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)); diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc index edccb0b4e14..91ba37deed8 100644 --- a/source/blender/editors/space_view3d/view3d_select.cc +++ b/source/blender/editors/space_view3d/view3d_select.cc @@ -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( diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 4cc282a1cab..39fd673b2d9 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -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); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 2ded01255c5..7f5b23f0489 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -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 **************************** */ diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 05590494be5..e24323072d3 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -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++) { diff --git a/source/blender/editors/transform/transform_gizmo_extrude_3d.c b/source/blender/editors/transform/transform_gizmo_extrude_3d.c index 6eb5a5e3449..01270df5f14 100644 --- a/source/blender/editors/transform/transform_gizmo_extrude_3d.c +++ b/source/blender/editors/transform/transform_gizmo_extrude_3d.c @@ -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) { diff --git a/source/blender/editors/transform/transform_mode.c b/source/blender/editors/transform/transform_mode.c index ebfb746f24c..c222a89be70 100644 --- a/source/blender/editors/transform/transform_mode.c +++ b/source/blender/editors/transform/transform_mode.c @@ -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) diff --git a/source/blender/editors/transform/transform_snap_object.cc b/source/blender/editors/transform/transform_snap_object.cc index a2ba0a60729..d50b95899b4 100644 --- a/source/blender/editors/transform/transform_snap_object.cc +++ b/source/blender/editors/transform/transform_snap_object.cc @@ -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); diff --git a/source/blender/editors/undo/ed_undo.cc b/source/blender/editors/undo/ed_undo.cc index b4a42f9e1ea..9c055f3d097 100644 --- a/source/blender/editors/undo/ed_undo.cc +++ b/source/blender/editors/undo/ed_undo.cc @@ -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); diff --git a/source/blender/editors/util/ed_util.cc b/source/blender/editors/util/ed_util.cc index 77e5be4e0dd..f95aca6a096 100644 --- a/source/blender/editors/util/ed_util.cc +++ b/source/blender/editors/util/ed_util.cc @@ -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) { diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencil_ui_common.c b/source/blender/gpencil_modifiers/intern/MOD_gpencil_ui_common.c index 7b2d44c2853..ac6d4b69ccc 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencil_ui_common.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencil_ui_common.c @@ -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); } /* -------------------------------------------------------------------- */ diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c index 45ceb646361..7bbe4d03ae8 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c @@ -174,7 +174,7 @@ typedef struct LineartBakeJob { static bool lineart_gpencil_bake_single_target(LineartBakeJob *bj, Object *ob, int frame) { bool touched = false; - if (ob->type != OB_GPENCIL || G.is_break) { + if (ob->type != OB_GPENCIL_LEGACY || G.is_break) { return false; } @@ -285,7 +285,7 @@ static int lineart_gpencil_bake_common(bContext *C, if (!bake_all_targets) { Object *ob = CTX_data_active_object(C); - if (!ob || ob->type != OB_GPENCIL) { + if (!ob || ob->type != OB_GPENCIL_LEGACY) { WM_report(RPT_ERROR, "No active object or active object isn't a GPencil object."); return OPERATOR_FINISHED; } @@ -294,7 +294,7 @@ static int lineart_gpencil_bake_common(bContext *C, else { /* #CTX_DATA_BEGIN is not available for iterating in objects while using the job system. */ CTX_DATA_BEGIN (C, Object *, ob, visible_objects) { - if (ob->type == OB_GPENCIL) { + if (ob->type == OB_GPENCIL_LEGACY) { LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) { if (md->type == eGpencilModifierType_Lineart) { BLI_linklist_prepend(&bj->objects, ob); @@ -384,7 +384,7 @@ static int lineart_gpencil_bake_strokes_commom_modal(bContext *C, static void lineart_gpencil_clear_strokes_exec_common(Object *ob) { /* TODO: move these checks to an operator poll function. */ - if ((ob == NULL) || ob->type != OB_GPENCIL) { + if ((ob == NULL) || ob->type != OB_GPENCIL_LEGACY) { return; } LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) { diff --git a/source/blender/io/alembic/exporter/abc_hierarchy_iterator.cc b/source/blender/io/alembic/exporter/abc_hierarchy_iterator.cc index ab62694b802..968dd651b96 100644 --- a/source/blender/io/alembic/exporter/abc_hierarchy_iterator.cc +++ b/source/blender/io/alembic/exporter/abc_hierarchy_iterator.cc @@ -211,7 +211,7 @@ ABCAbstractWriter *ABCHierarchyIterator::create_data_writer_for_object_type( case OB_LIGHTPROBE: case OB_LATTICE: case OB_ARMATURE: - case OB_GPENCIL: + case OB_GPENCIL_LEGACY: return nullptr; case OB_TYPE_MAX: BLI_assert_msg(0, "OB_TYPE_MAX should not be used"); diff --git a/source/blender/io/collada/SceneExporter.cpp b/source/blender/io/collada/SceneExporter.cpp index b98ff27c89e..1d389247ea3 100644 --- a/source/blender/io/collada/SceneExporter.cpp +++ b/source/blender/io/collada/SceneExporter.cpp @@ -46,7 +46,7 @@ void SceneExporter::exportHierarchy() case OB_CAMERA: case OB_LAMP: case OB_EMPTY: - case OB_GPENCIL: + case OB_GPENCIL_LEGACY: case OB_ARMATURE: base_objects.add(ob); break; diff --git a/source/blender/io/gpencil/intern/gpencil_io_base.cc b/source/blender/io/gpencil/intern/gpencil_io_base.cc index 215dc20c5b4..90d1b12c4c8 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_base.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_base.cc @@ -136,7 +136,7 @@ void GpencilIO::create_object_list() LISTBASE_FOREACH (Base *, base, BKE_view_layer_object_bases_get(view_layer)) { Object *object = base->object; - if (object->type != OB_GPENCIL) { + if (object->type != OB_GPENCIL_LEGACY) { continue; } if ((params_.select_mode == GP_EXPORT_ACTIVE) && (params_.ob != object)) { diff --git a/source/blender/io/gpencil/intern/gpencil_io_import_base.cc b/source/blender/io/gpencil/intern/gpencil_io_import_base.cc index f6d02d36a17..e3f20305a8f 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_import_base.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_import_base.cc @@ -34,7 +34,7 @@ Object *GpencilImporter::create_object() ushort(0); Object *ob_gpencil = ED_object_add_type(params_.C, - OB_GPENCIL, + OB_GPENCIL_LEGACY, (params_.filename[0] != '\0') ? params_.filename : nullptr, cur_loc, diff --git a/source/blender/io/usd/intern/usd_hierarchy_iterator.cc b/source/blender/io/usd/intern/usd_hierarchy_iterator.cc index abf6c0cb0f9..8b7af8e076f 100644 --- a/source/blender/io/usd/intern/usd_hierarchy_iterator.cc +++ b/source/blender/io/usd/intern/usd_hierarchy_iterator.cc @@ -117,7 +117,7 @@ AbstractHierarchyWriter *USDHierarchyIterator::create_data_writer(const Hierarch case OB_LIGHTPROBE: case OB_LATTICE: case OB_ARMATURE: - case OB_GPENCIL: + case OB_GPENCIL_LEGACY: case OB_POINTCLOUD: case OB_CURVES: return nullptr; diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 44e8ea517cf..bc1954c0206 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -1063,7 +1063,7 @@ typedef enum IDRecalcFlag { #define FILTER_ID_BR (1ULL << 2) #define FILTER_ID_CA (1ULL << 3) #define FILTER_ID_CU_LEGACY (1ULL << 4) -#define FILTER_ID_GD (1ULL << 5) +#define FILTER_ID_GD_LEGACY (1ULL << 5) #define FILTER_ID_GR (1ULL << 6) #define FILTER_ID_IM (1ULL << 7) #define FILTER_ID_LA (1ULL << 8) @@ -1100,12 +1100,12 @@ typedef enum IDRecalcFlag { #define FILTER_ID_ALL \ (FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR | FILTER_ID_CA | FILTER_ID_CU_LEGACY | \ - FILTER_ID_GD | FILTER_ID_GR | FILTER_ID_IM | FILTER_ID_LA | FILTER_ID_LS | FILTER_ID_LT | \ - FILTER_ID_MA | FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME | FILTER_ID_MSK | FILTER_ID_NT | \ - FILTER_ID_OB | FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_SCE | FILTER_ID_SPK | \ - FILTER_ID_SO | FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_WO | FILTER_ID_CF | \ - FILTER_ID_WS | FILTER_ID_LP | FILTER_ID_CV | FILTER_ID_PT | FILTER_ID_VO | FILTER_ID_SIM | \ - FILTER_ID_KE | FILTER_ID_SCR | FILTER_ID_WM | FILTER_ID_LI) + FILTER_ID_GD_LEGACY | FILTER_ID_GR | FILTER_ID_IM | FILTER_ID_LA | FILTER_ID_LS | \ + FILTER_ID_LT | FILTER_ID_MA | FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME | FILTER_ID_MSK | \ + FILTER_ID_NT | FILTER_ID_OB | FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_SCE | \ + FILTER_ID_SPK | FILTER_ID_SO | FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_WO | \ + FILTER_ID_CF | FILTER_ID_WS | FILTER_ID_LP | FILTER_ID_CV | FILTER_ID_PT | FILTER_ID_VO | \ + FILTER_ID_SIM | FILTER_ID_KE | FILTER_ID_SCR | FILTER_ID_WM | FILTER_ID_LI) /** * This enum defines the index assigned to each type of IDs in the array returned by @@ -1149,7 +1149,7 @@ enum { * other ID types, including node trees e.g. * So there is no proper place for those, for now keep close to the lower end of the processing * hierarchy, but we may want to re-evaluate that at some point. */ - INDEX_ID_GD, + INDEX_ID_GD_LEGACY, /* Node trees, abstraction for procedural data, potentially used by many other ID types. * diff --git a/source/blender/makesdna/DNA_ID_enums.h b/source/blender/makesdna/DNA_ID_enums.h index 94ab24511d8..d632c062a1a 100644 --- a/source/blender/makesdna/DNA_ID_enums.h +++ b/source/blender/makesdna/DNA_ID_enums.h @@ -68,7 +68,7 @@ typedef enum ID_Type { ID_NT = MAKE_ID2('N', 'T'), /* bNodeTree */ ID_BR = MAKE_ID2('B', 'R'), /* Brush */ ID_PA = MAKE_ID2('P', 'A'), /* ParticleSettings */ - ID_GD = MAKE_ID2('G', 'D'), /* bGPdata, (Grease Pencil) */ + ID_GD_LEGACY = MAKE_ID2('G', 'D'), /* bGPdata, (legacy Grease Pencil) */ ID_WM = MAKE_ID2('W', 'M'), /* WindowManager */ ID_MC = MAKE_ID2('M', 'C'), /* MovieClip */ ID_MSK = MAKE_ID2('M', 'S'), /* Mask */ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index e217ff3ad9c..f6d2ea3d71a 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -514,7 +514,7 @@ enum { OB_ARMATURE = 25, /** Grease Pencil object used in 3D view but not used for annotation in 2D. */ - OB_GPENCIL = 26, + OB_GPENCIL_LEGACY = 26, OB_CURVES = 27, @@ -528,7 +528,8 @@ enum { /* check if the object type supports materials */ #define OB_TYPE_SUPPORT_MATERIAL(_type) \ - (((_type) >= OB_MESH && (_type) <= OB_MBALL) || ((_type) >= OB_GPENCIL && (_type) <= OB_VOLUME)) + (((_type) >= OB_MESH && (_type) <= OB_MBALL) || \ + ((_type) >= OB_GPENCIL_LEGACY && (_type) <= OB_VOLUME)) /** Does the object have some render-able geometry (unlike empties, cameras, etc.). */ #define OB_TYPE_IS_GEOMETRY(_type) \ (ELEM(_type, \ @@ -536,11 +537,11 @@ enum { OB_SURF, \ OB_FONT, \ OB_MBALL, \ - OB_GPENCIL, \ + OB_GPENCIL_LEGACY, \ OB_CURVES, \ OB_POINTCLOUD, \ OB_VOLUME)) -#define OB_TYPE_SUPPORT_VGROUP(_type) (ELEM(_type, OB_MESH, OB_LATTICE, OB_GPENCIL)) +#define OB_TYPE_SUPPORT_VGROUP(_type) (ELEM(_type, OB_MESH, OB_LATTICE, OB_GPENCIL_LEGACY)) #define OB_TYPE_SUPPORT_EDITMODE(_type) \ (ELEM(_type, \ OB_MESH, \ @@ -569,7 +570,7 @@ enum { ID_LP, \ ID_CA, \ ID_LT, \ - ID_GD, \ + ID_GD_LEGACY, \ ID_AR, \ ID_CV, \ ID_PT, \ @@ -584,7 +585,7 @@ enum { case ID_LP: \ case ID_CA: \ case ID_LT: \ - case ID_GD: \ + case ID_GD_LEGACY: \ case ID_AR: \ case ID_CV: \ case ID_PT: \ diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 94fa1d8f287..68270af0a67 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -341,12 +341,12 @@ typedef enum eSpaceOutliner_Filter { SO_FILTER_ID_TYPE = (1 << 19), - SO_FILTER_NO_OB_GPENCIL = (1 << 20), + SO_FILTER_NO_OB_GPENCIL_LEGACY = (1 << 20), } eSpaceOutliner_Filter; #define SO_FILTER_OB_TYPE \ (SO_FILTER_NO_OB_MESH | SO_FILTER_NO_OB_ARMATURE | SO_FILTER_NO_OB_EMPTY | \ - SO_FILTER_NO_OB_LAMP | SO_FILTER_NO_OB_CAMERA | SO_FILTER_NO_OB_GPENCIL | \ + SO_FILTER_NO_OB_LAMP | SO_FILTER_NO_OB_CAMERA | SO_FILTER_NO_OB_GPENCIL_LEGACY | \ SO_FILTER_NO_OB_OTHERS) #define SO_FILTER_OB_STATE \ diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index a1e1448314d..b430bf2a931 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -40,7 +40,7 @@ const EnumPropertyItem rna_enum_id_type_items[] = { {ID_CU_LEGACY, "CURVE", ICON_CURVE_DATA, "Curve", ""}, {ID_CV, "CURVES", ICON_CURVES_DATA, "Curves", ""}, {ID_VF, "FONT", ICON_FONT_DATA, "Font", ""}, - {ID_GD, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil", ""}, + {ID_GD_LEGACY, "GREASEPENCIL", ICON_GREASEPENCIL, "Grease Pencil", ""}, {ID_IM, "IMAGE", ICON_IMAGE_DATA, "Image", ""}, {ID_KE, "KEY", ICON_SHAPEKEY_DATA, "Key", ""}, {ID_LT, "LATTICE", ICON_LATTICE_DATA, "Lattice", ""}, @@ -128,7 +128,7 @@ const struct IDFilterEnumPropertyItem rna_enum_id_type_filter_items[] = { {FILTER_ID_CA, "filter_camera", ICON_CAMERA_DATA, "Cameras", "Show Camera data-blocks"}, {FILTER_ID_CF, "filter_cachefile", ICON_FILE, "Cache Files", "Show Cache File data-blocks"}, {FILTER_ID_CU_LEGACY, "filter_curve", ICON_CURVE_DATA, "Curves", "Show Curve data-blocks"}, - {FILTER_ID_GD, + {FILTER_ID_GD_LEGACY, "filter_grease_pencil", ICON_GREASEPENCIL, "Grease Pencil", @@ -361,7 +361,7 @@ short RNA_type_to_ID_code(const StructRNA *type) return ID_CU_LEGACY; } if (base_type == &RNA_GreasePencil) { - return ID_GD; + return ID_GD_LEGACY; } if (base_type == &RNA_Collection) { return ID_GR; @@ -482,7 +482,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) return &RNA_CacheFile; case ID_CU_LEGACY: return &RNA_Curve; - case ID_GD: + case ID_GD_LEGACY: return &RNA_GreasePencil; case ID_GR: return &RNA_Collection; diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index abb709473e1..3213a67bbad 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -481,7 +481,7 @@ static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr) { bGPdata *gpd = (bGPdata *)ptr->owner_id; - if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */ + if (GS(gpd->id.name) == ID_GD_LEGACY) { /* why would this ever be not GD */ bGPDlayer *gl; for (gl = gpd->layers.first; gl; gl = gl->next) { @@ -513,7 +513,7 @@ static void rna_GPencil_active_layer_set(PointerRNA *ptr, return; } - if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */ + if (GS(gpd->id.name) == ID_GD_LEGACY) { /* why would this ever be not GD */ bGPDlayer *gl; for (gl = gpd->layers.first; gl; gl = gl->next) { diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c index 35678f2f1dd..3ceab3d62ff 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -839,7 +839,7 @@ RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures, ID_AR) RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions, ID_AC) RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles, ID_PA) RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL) -RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils, ID_GD) +RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils, ID_GD_LEGACY) RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips, ID_MC) RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks, ID_MSK) RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles, ID_LS) diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index d1b601e6f96..6621b5ed7c4 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -110,7 +110,7 @@ static void rna_MaterialGpencil_update(Main *bmain, Scene *scene, PointerRNA *pt /* Need set all caches as dirty. */ for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { - if (ob->type == OB_GPENCIL) { + if (ob->type == OB_GPENCIL_LEGACY) { bGPdata *gpd = (bGPdata *)ob->data; DEG_id_tag_update(&gpd->id, ID_RECALC_GEOMETRY); } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 56c66ddca3e..6b651ecdbce 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -255,7 +255,7 @@ const EnumPropertyItem rna_enum_object_type_items[] = { {OB_CURVES, "CURVES", ICON_OUTLINER_OB_CURVES, "Hair Curves", ""}, {OB_POINTCLOUD, "POINTCLOUD", ICON_OUTLINER_OB_POINTCLOUD, "Point Cloud", ""}, {OB_VOLUME, "VOLUME", ICON_OUTLINER_OB_VOLUME, "Volume", ""}, - {OB_GPENCIL, "GPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", ""}, + {OB_GPENCIL_LEGACY, "GPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", ""}, RNA_ENUM_ITEM_SEPR, {OB_ARMATURE, "ARMATURE", ICON_OUTLINER_OB_ARMATURE, "Armature", ""}, {OB_LATTICE, "LATTICE", ICON_OUTLINER_OB_LATTICE, "Lattice", ""}, @@ -382,7 +382,7 @@ static void rna_Object_duplicator_visibility_flag_update(Main *UNUSED(bmain), static void rna_MaterialIndex_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Object *ob = (Object *)ptr->owner_id; - if (ob && ob->type == OB_GPENCIL) { + if (ob && ob->type == OB_GPENCIL_LEGACY) { /* Notifying material property in top-bar. */ WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, NULL); } @@ -391,7 +391,7 @@ static void rna_MaterialIndex_update(Main *UNUSED(bmain), Scene *UNUSED(scene), static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Object *ob = (Object *)ptr->owner_id; - if (ob && ob->type == OB_GPENCIL) { + if (ob && ob->type == OB_GPENCIL_LEGACY) { bGPdata *gpd = (bGPdata *)ob->data; DEG_id_tag_update(&gpd->id, ID_RECALC_GEOMETRY); WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL); @@ -600,7 +600,7 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr) return &RNA_Speaker; case OB_LIGHTPROBE: return &RNA_LightProbe; - case OB_GPENCIL: + case OB_GPENCIL_LEGACY: return &RNA_GreasePencil; case OB_CURVES: return &RNA_Curves; @@ -617,7 +617,7 @@ static bool rna_Object_data_poll(PointerRNA *ptr, const PointerRNA value) { Object *ob = (Object *)ptr->data; - if (ob->type == OB_GPENCIL) { + if (ob->type == OB_GPENCIL_LEGACY) { /* GP Object - Don't allow using "Annotation" GP datablocks here */ bGPdata *gpd = value.data; return (gpd->flag & GP_DATA_ANNOTATIONS) == 0; @@ -1138,7 +1138,7 @@ static void rna_Object_active_material_set(PointerRNA *ptr, BLI_assert(BKE_id_is_in_global_main(value.data)); BKE_object_material_assign(G_MAIN, ob, value.data, ob->actcol, BKE_MAT_ASSIGN_EXISTING); - if (ob->type == OB_GPENCIL) { + if (ob->type == OB_GPENCIL_LEGACY) { /* notifying material property in topbar */ WM_main_add_notifier(NC_SPACE | ND_SPACE_VIEW3D, NULL); } @@ -1377,7 +1377,7 @@ static bool rna_MaterialSlot_material_poll(PointerRNA *ptr, PointerRNA value) Object *ob = (Object *)ptr->owner_id; Material *ma = (Material *)value.data; - if (ob->type == OB_GPENCIL) { + if (ob->type == OB_GPENCIL_LEGACY) { /* GP Materials only */ return (ma->gp_style != NULL); } @@ -2237,7 +2237,7 @@ bool rna_Light_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) bool rna_GPencil_object_poll(PointerRNA *UNUSED(ptr), PointerRNA value) { - return ((Object *)value.owner_id)->type == OB_GPENCIL; + return ((Object *)value.owner_id)->type == OB_GPENCIL_LEGACY; } bool rna_Object_use_dynamic_topology_sculpting_get(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 2629373f452..d31d789f453 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -724,7 +724,7 @@ static void rna_Gpencil_extend_selection(bContext *C, PointerRNA *UNUSED(ptr)) ViewLayer *view_layer = CTX_data_view_layer(C); BKE_view_layer_synced_ensure(scene, view_layer); Object *ob = BKE_view_layer_active_object_get(view_layer); - if ((ob) && (ob->type == OB_GPENCIL)) { + if ((ob) && (ob->type == OB_GPENCIL_LEGACY)) { bGPdata *gpd = (bGPdata *)ob->data; CTX_DATA_BEGIN (C, bGPDstroke *, gps, editable_gpencil_strokes) { if ((gps->flag & GP_STROKE_SELECT) && (gps->totpoints > 1)) { diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 1aea7338283..059d3bff493 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -923,7 +923,7 @@ static void rna_GPencil_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *UN bool changed = false; /* need set all caches as dirty to recalculate onion skinning */ for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { - if (ob->type == OB_GPENCIL) { + if (ob->type == OB_GPENCIL_LEGACY) { bGPdata *gpd = (bGPdata *)ob->data; DEG_id_tag_update(&gpd->id, ID_RECALC_GEOMETRY); changed = true; @@ -3394,8 +3394,8 @@ static struct IDFilterEnumPropertyItem rna_enum_space_file_id_filter_categories[ ICON_WORLD_DATA, "Environment", "Show worlds, lights, cameras and speakers"}, - {FILTER_ID_BR | FILTER_ID_GD | FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | FILTER_ID_TXT | - FILTER_ID_VF | FILTER_ID_CF | FILTER_ID_WS, + {FILTER_ID_BR | FILTER_ID_GD_LEGACY | FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC | + FILTER_ID_TXT | FILTER_ID_VF | FILTER_ID_CF | FILTER_ID_WS, "category_misc", ICON_GREASEPENCIL, "Miscellaneous", @@ -3909,7 +3909,7 @@ static void rna_def_space_outliner(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); prop = RNA_def_property(srna, "use_filter_object_grease_pencil", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_GPENCIL); + RNA_def_property_boolean_negative_sdna(prop, NULL, "filter", SO_FILTER_NO_OB_GPENCIL_LEGACY); RNA_def_property_ui_text(prop, "Show Grease Pencil", "Show grease pencil objects"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_OUTLINER, NULL); diff --git a/source/blender/makesrna/intern/rna_space_api.c b/source/blender/makesrna/intern/rna_space_api.c index 9790a85e1c8..464aeb0a2b3 100644 --- a/source/blender/makesrna/intern/rna_space_api.c +++ b/source/blender/makesrna/intern/rna_space_api.c @@ -152,7 +152,7 @@ void rna_def_object_type_visibility_flags_common(StructRNA *srna, {"show_object_viewport_lattice", "show_object_select_lattice"}}, {"Empty", (1 << OB_EMPTY), {"show_object_viewport_empty", "show_object_select_empty"}}, {"Grease Pencil", - (1 << OB_GPENCIL), + (1 << OB_GPENCIL_LEGACY), {"show_object_viewport_grease_pencil", "show_object_select_grease_pencil"}}, {"Camera", (1 << OB_CAMERA), {"show_object_viewport_camera", "show_object_select_camera"}}, {"Light", (1 << OB_LAMP), {"show_object_viewport_light", "show_object_select_light"}}, diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index 98adb456b23..abd831a66b9 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -99,7 +99,7 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte /* If not using envelopes, * create relations to individual bones for more rigging flexibility. */ if ((amd->deformflag & ARM_DEF_ENVELOPE) == 0 && (amd->object->pose != NULL) && - ELEM(ctx->object->type, OB_MESH, OB_LATTICE, OB_GPENCIL)) { + ELEM(ctx->object->type, OB_MESH, OB_LATTICE, OB_GPENCIL_LEGACY)) { /* If neither vertex groups nor envelopes are used, the modifier has no bone dependencies. */ if ((amd->deformflag & ARM_DEF_VGROUP) != 0) { /* Enumerate groups that match existing bones. */ diff --git a/source/blender/modifiers/intern/MOD_ui_common.c b/source/blender/modifiers/intern/MOD_ui_common.c index f88fb971b9c..17eabfbbd7a 100644 --- a/source/blender/modifiers/intern/MOD_ui_common.c +++ b/source/blender/modifiers/intern/MOD_ui_common.c @@ -44,7 +44,7 @@ static bool 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); } /* -------------------------------------------------------------------- */ diff --git a/source/blender/shader_fx/intern/FX_ui_common.c b/source/blender/shader_fx/intern/FX_ui_common.c index afbd75cee75..ffb70843016 100644 --- a/source/blender/shader_fx/intern/FX_ui_common.c +++ b/source/blender/shader_fx/intern/FX_ui_common.c @@ -215,7 +215,7 @@ static bool shaderfx_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); } PanelType *shaderfx_panel_register(ARegionType *region_type, ShaderFxType type, PanelDrawFn draw)