Commit: 53a6201c471e538368acac837f129eb7615a72fe Author: Hans Goudey Date: Mon Jul 5 07:40:11 2021 -0500 Branches: refactor-vertex-group-names https://developer.blender.org/rB53a6201c471e538368acac837f129eb7615a72fe
Merge branch 'master' into refactor-vertex-group-names =================================================================== =================================================================== diff --cc source/blender/blenkernel/BKE_blender_version.h index d5baeb08ccc,d5baeb08ccc..9d286b94b04 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@@ -39,7 -39,7 +39,7 @@@ extern "C" /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION --#define BLENDER_FILE_SUBVERSION 7 ++#define BLENDER_FILE_SUBVERSION 8 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file diff --cc source/blender/blenkernel/intern/deform.c index 9a885bf2359,19840a70bf0..f457ab19f29 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@@ -1507,14 -1373,12 +1507,14 @@@ bool data_transfer_layersmapping_vgroup } if (tolayers >= 0) { - /* Note: in this case we assume layer exists! */ + /* NOTE: in this case we assume layer exists! */ idx_dst = tolayers; - BLI_assert(idx_dst < BLI_listbase_count(&ob_dst->defbase)); + const ListBase *dst_defbase = BKE_object_defgroup_list_for_read(ob_dst); + BLI_assert(idx_dst < BLI_listbase_count(dst_defbase)); + UNUSED_VARS_NDEBUG(dst_defbase); } else if (tolayers == DT_LAYERS_ACTIVE_DST) { - if ((idx_dst = ob_dst->actdef - 1) == -1) { + if ((idx_dst = BKE_object_defgroup_active_index_get(ob_dst) - 1) == -1) { bDeformGroup *dg_src; if (!use_create) { return true; diff --cc source/blender/blenloader/intern/versioning_300.c index 9d239a0aec0,ecee14d3d58..fdc4e6006cb --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@@ -145,10 -131,6 +145,10 @@@ void do_versions_after_linking_300(Mai assert_sorted_ids(bmain); } - if (!MAIN_VERSION_ATLEAST(bmain, 300, 7)) { ++ if (!MAIN_VERSION_ATLEAST(bmain, 300, 8)) { + move_vertex_group_names_to_object_data(bmain); + } + /** * Versioning code until next subversion bump goes here. * diff --cc source/blender/editors/object/object_vgroup.c index cb34bbeb13b,37075a29b92..2dd0bd13088 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@@ -1008,9 -1000,9 +1008,9 @@@ float ED_vgroup_vert_weight(Object *ob void ED_vgroup_select_by_name(Object *ob, const char *name) { - /* note: actdef==0 signals on painting to create a new one, - /* NOTE: ob->actdef==0 signals on painting to create a new one, ++ /* NOTE: actdef==0 signals on painting to create a new one, * if a bone in posemode is selected */ - ob->actdef = BKE_object_defgroup_name_index(ob, name) + 1; + BKE_object_defgroup_active_index_set(ob, BKE_object_defgroup_name_index(ob, name) + 1); } /** \} */ @@@ -1138,13 -1127,13 +1138,13 @@@ static void vgroup_duplicate(Object *ob BLI_strncpy(cdg->name, name, sizeof(cdg->name)); BKE_object_defgroup_unique_name(cdg, ob); - BLI_addtail(&ob->defbase, cdg); + BLI_addtail(defbase, cdg); - idg = (ob->actdef - 1); - ob->actdef = BLI_listbase_count(&ob->defbase); - icdg = (ob->actdef - 1); + idg = BKE_object_defgroup_active_index_get(ob) - 1; + BKE_object_defgroup_active_index_set(ob, BLI_listbase_count(defbase)); + icdg = BKE_object_defgroup_active_index_get(ob) - 1; - /* TODO, we might want to allow only copy selected verts here? - campbell */ + /* TODO(campbell): we might want to allow only copy selected verts here? */ ED_vgroup_parray_alloc(ob->data, &dvert_array, &dvert_tot, false); if (dvert_array) { diff --cc source/blender/makesdna/DNA_mesh_types.h index 1c7acd50abc,2f089b28048..2a569c8db50 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@@ -164,11 -164,8 +164,10 @@@ typedef struct Mesh struct MVert *mvert; /** Array of edges. */ struct MEdge *medge; - - /** Deformgroup vertices. */ + /** Deform-group vertices. */ struct MDeformVert *dvert; + /** List of bDeformGroup names and flag only. */ + ListBase vertex_group_names; /* array of colors for the tessellated faces, must be number of tessellated * faces * 4 in length */ diff --cc source/blender/makesdna/DNA_object_types.h index aa43097cf83,262d650c1ef..1577e727127 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@@ -381,9 -380,9 +381,9 @@@ typedef struct Object /** Custom index, for renderpasses. */ short index; - /** Current deformation group, note: index starts at 1. */ + /** Current deformation group, NOTE: index starts at 1. */ - unsigned short actdef; + unsigned short actdef DNA_DEPRECATED; - /** Current face map, note: index starts at 1. */ + /** Current face map, NOTE: index starts at 1. */ unsigned short actfmap; char _pad2[2]; /** Object color (in most cases the material color is used for drawing). */ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs