diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-07-03 16:30:04 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-09-09 18:01:17 +0300 |
commit | 565510bd7fd87ae146cabafb27f1dfd550450f58 (patch) | |
tree | 57ff84b2aa4ba7e5c1dc0511be858d6b3bf156e6 /source/blender/makesdna | |
parent | a5db981b0ea044313239c3cc2ee92d19a8f682ea (diff) |
Geometry: add .attributes in the Python API for Mesh, Hair and Point Cloud
This puts all generic float/int/vector/color/string geometry attributes in a new
.attributes property. For meshes it provides a more general API for existing
attributes, for point clouds attributes will be used as an essential part of
particle nodes.
This patch was implemented by @lichtwerk, with further changes by me. It's
still a work in progress, but posting here to show what is going on and for
early feedback.
Ref T76659
Differential Revision: https://developer.blender.org/D8200
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_customdata_types.h | 10 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_hair_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_pointcloud_types.h | 2 |
4 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index 2990fa85c27..51b233449bf 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -209,17 +209,17 @@ typedef enum CustomDataType { #define CD_MASK_PROP_FLOAT3 (1ULL << CD_PROP_FLOAT3) #define CD_MASK_PROP_FLOAT2 (1ULL << CD_PROP_FLOAT2) -/** Data types that may be defined for all mesh elements types. */ -#define CD_MASK_GENERIC_DATA \ - (CD_MASK_PROP_FLOAT | CD_MASK_PROP_INT32 | CD_MASK_PROP_STRING | CD_MASK_PROP_FLOAT3 | \ - CD_MASK_PROP_FLOAT2) - /** Multires loop data. */ #define CD_MASK_MULTIRES_GRIDS (CD_MASK_MDISPS | CD_GRID_PAINT_MASK) /* All data layers. */ #define CD_MASK_ALL (~0LL) +/* All generic attributes. */ +#define CD_MASK_PROP_ALL \ + (CD_MASK_PROP_FLOAT | CD_MASK_PROP_FLOAT2 | CD_MASK_PROP_FLOAT3 | CD_MASK_PROP_INT32 | \ + CD_MASK_PROP_COLOR | CD_MASK_PROP_STRING | CD_MASK_MLOOPCOL) + typedef struct CustomData_MeshMasks { uint64_t vmask; uint64_t emask; diff --git a/source/blender/makesdna/DNA_hair_types.h b/source/blender/makesdna/DNA_hair_types.h index d120e61cfef..27799560395 100644 --- a/source/blender/makesdna/DNA_hair_types.h +++ b/source/blender/makesdna/DNA_hair_types.h @@ -56,6 +56,8 @@ typedef struct Hair { /* Custom Data */ struct CustomData pdata; struct CustomData cdata; + int attributes_active_index; + int _pad3; /* Material */ struct Material **mat; diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index a6aef5b08ad..abfa3cc1b2e 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -191,6 +191,9 @@ typedef struct Mesh { int totpoly, totloop; /* END BMESH ONLY */ + int attributes_active_index; + int _pad3; + /* 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 * of the last selected face and is similar to the old active face flag where diff --git a/source/blender/makesdna/DNA_pointcloud_types.h b/source/blender/makesdna/DNA_pointcloud_types.h index d3b687c2c68..86cff098096 100644 --- a/source/blender/makesdna/DNA_pointcloud_types.h +++ b/source/blender/makesdna/DNA_pointcloud_types.h @@ -38,6 +38,8 @@ typedef struct PointCloud { /* Custom Data */ struct CustomData pdata; + int attributes_active_index; + int _pad4; /* Material */ struct Material **mat; |