diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-11-28 12:17:29 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-04-20 13:15:15 +0300 |
commit | 991ee8a57094dda66338966a2ef9e26185645ab5 (patch) | |
tree | 6ef60f99a8a5cb56e2febc0bec34b3daec850154 /source/blender/bmesh/intern/bmesh_interp.c | |
parent | e43ef55e7fc460d3531f1a5ab90c74903e389cdd (diff) |
First customdata layer for particle mass.
This is more for testing purposes, since currently there is only a
single mass property for the psys as a whole. This should change in the
future though, to allow variable mass per strand or vertex.
Conflicts:
source/blender/bmesh/intern/bmesh_interp.c
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_interp.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_interp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index f745972293e..f01f0f961a2 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -905,6 +905,18 @@ void BM_elem_float_data_set(CustomData *cd, void *element, int type, const float if (f) *f = val; } +float BM_elem_float_data_named_get(CustomData *cd, void *element, int type, const char *name) +{ + const float *f = CustomData_bmesh_get_named(cd, ((BMHeader *)element)->data, type, name); + return f ? *f : 0.0f; +} + +void BM_elem_float_data_named_set(CustomData *cd, void *element, int type, const char *name, const float val) +{ + float *f = CustomData_bmesh_get_named(cd, ((BMHeader *)element)->data, type, name); + if (f) *f = val; +} + /** \name Loop interpolation functions: BM_vert_loop_groups_data_layer_*** * * Handling loop custom-data such as UV's, while keeping contiguous fans is rather tedious. |