Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-07-13 19:10:34 +0300
committerHans Goudey <h.goudey@me.com>2021-07-13 19:10:34 +0300
commit3b6ee8cee7080af200e25e944fe30d310240e138 (patch)
tree724f298a53b12811e17425b84a909f2aaf2557a3 /source/blender/makesdna
parent52b94049f2a71a74f52247f83657cf3a5c8712b4 (diff)
Refactor: Move vertex group names to object data
This commit moves the storage of `bDeformGroup` and the active index to `Mesh`, `Lattice`, and `bGPdata` instead of `Object`. Utility functions are added to allow easy access to the vertex groups given an object or an ID. As explained in T88951, the list of vertex group names is currently stored separately per object, even though vertex group data is stored on the geometry. This tends to complicate code and cause bugs, especially as geometry is created procedurally and tied less closely to an object. The "Copy Vertex Groups to Linked" operator is removed, since they are stored on the geometry anyway. This patch leaves the object-level python API for vertex groups in place. Creating a geometry-level RNA API can be a separate step; the changes in this commit are invasive enough as it is. Note that opening a file saved in 3.0 in an earlier version means the vertex groups will not be available. Differential Revision: https://developer.blender.org/D11689
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h6
-rw-r--r--source/blender/makesdna/DNA_lattice_types.h5
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h10
-rw-r--r--source/blender/makesdna/DNA_object_types.h5
4 files changed, 18 insertions, 8 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index c573de6b54e..0952c45e81f 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -666,6 +666,9 @@ typedef struct bGPdata {
/** List of bGPDpalette's - Deprecated (2.78 - 2.79 only). */
ListBase palettes DNA_DEPRECATED;
+ /** List of bDeformGroup names and flag only. */
+ ListBase vertex_group_names;
+
/* 3D Viewport/Appearance Settings */
/** Factor to define pixel size conversion. */
float pixfactor;
@@ -715,7 +718,8 @@ typedef struct bGPdata {
/** Stroke selection last index. Used to generate a unique selection index. */
int select_last_index;
- char _pad3[4];
+
+ int vertex_group_active_index;
bGPgrid grid;
diff --git a/source/blender/makesdna/DNA_lattice_types.h b/source/blender/makesdna/DNA_lattice_types.h
index 48eb8d90702..361893db893 100644
--- a/source/blender/makesdna/DNA_lattice_types.h
+++ b/source/blender/makesdna/DNA_lattice_types.h
@@ -72,6 +72,11 @@ typedef struct Lattice {
struct MDeformVert *dvert;
/** Multiply the influence, MAX_VGROUP_NAME. */
char vgroup[64];
+ /** List of bDeformGroup names and flag only. */
+ ListBase vertex_group_names;
+ int vertex_group_active_index;
+
+ char _pad0[4];
struct EditLatt *editlatt;
void *batch_cache;
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 2f089b28048..2a569c8db50 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -166,6 +166,8 @@ typedef struct Mesh {
struct MEdge *medge;
/** 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 */
@@ -189,7 +191,7 @@ typedef struct Mesh {
/* END BMESH ONLY */
int attributes_active_index;
- int _pad3;
+ int vertex_group_active_index;
/* the last selected vertex/edge/face are used for the active face however
* this means the active face must always be selected, this is to keep track
@@ -279,9 +281,9 @@ enum {
/* We can't have both flags enabled at once,
* flags defined in DNA_scene_types.h */
#define ME_EDIT_PAINT_SEL_MODE(_me) \
- (((_me)->editflag & ME_EDIT_PAINT_FACE_SEL) ? \
- SCE_SELECT_FACE : \
- ((_me)->editflag & ME_EDIT_PAINT_VERT_SEL) ? SCE_SELECT_VERTEX : 0)
+ (((_me)->editflag & ME_EDIT_PAINT_FACE_SEL) ? SCE_SELECT_FACE : \
+ ((_me)->editflag & ME_EDIT_PAINT_VERT_SEL) ? SCE_SELECT_VERTEX : \
+ 0)
/* me->flag */
enum {
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index 605cd28c793..dd31e85647d 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -272,8 +272,7 @@ typedef struct Object {
ListBase constraintChannels DNA_DEPRECATED; /* XXX deprecated... old animation system */
ListBase effect DNA_DEPRECATED; /* XXX deprecated... keep for readfile */
- /** List of bDeformGroup (vertex groups) names and flag only. */
- ListBase defbase;
+ ListBase defbase DNA_DEPRECATED; /* Only for versioning, moved to object data. */
/** List of ModifierData structures. */
ListBase modifiers;
/** List of GpencilModifierData structures. */
@@ -375,7 +374,7 @@ typedef struct Object {
/** Custom index, for renderpasses. */
short index;
/** Current deformation group, NOTE: index starts at 1. */
- unsigned short actdef;
+ unsigned short actdef DNA_DEPRECATED;
/** Current face map, NOTE: index starts at 1. */
unsigned short actfmap;
char _pad2[2];