diff options
author | Joseph Eagar <joeedh@gmail.com> | 2009-08-11 11:49:35 +0400 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2009-08-11 11:49:35 +0400 |
commit | eb34e3ad7c367acc2bd06f52c3b815cdef7a21c3 (patch) | |
tree | 77eff7990517eabd24633949abca8626e97c8eee /source/blender/blenkernel/BKE_customdata.h | |
parent | 31421e07966205d22318cb8eb0204b053cb9db65 (diff) |
Brought Extrude all the way back. The contextual menu works,
as does only edges and individual faces extrude (individual vert
extrude already did).
Note that I need to port this, after we all figure out how to handle
operators with variable transform follow-ons.
I also implemented the merge->collapse function, which is currently
accessable under ctrl->v, Bmesh Test Operator. I still need to
implement the other merge modes, and properly hook everything into
the merge menu tool, which I plan on doing soon (tomorrow hopefully).
The cool thing about the collapse tool, is not only does it handle (all)
UV layers, it handles vcols as well. To do this, I had to add a few math
functions to the customdata API, which seem to be working well.
Diffstat (limited to 'source/blender/blenkernel/BKE_customdata.h')
-rw-r--r-- | source/blender/blenkernel/BKE_customdata.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index a7980f65be6..e9937a44bfe 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -37,6 +37,9 @@ struct CustomData; struct CustomDataLayer; typedef unsigned int CustomDataMask; +/*a data type large enough to hold 1 element from any customdata layer type*/ +typedef struct {unsigned char data[64];} CDBlockBytes; + extern const CustomDataMask CD_MASK_BAREMESH; extern const CustomDataMask CD_MASK_MESH; extern const CustomDataMask CD_MASK_EDITMESH; @@ -59,6 +62,20 @@ extern const CustomDataMask CD_MASK_FACECORNERS; #define CD_DUPLICATE 4 /* do a full copy of all layers, only allowed if source has same number of elements */ +/* Checks if the layer at physical offset layern (in data->layers) support math + * the below operations. + */ +int CustomData_layer_has_math(struct CustomData *data, int layern); + +/* compares if data1 is equal to data2. type is a valid CustomData type + * enum (e.g. CD_MLOOPUV). the layer type's equal function is used to compare + * the data, if it exists, otherwise memcmp is used.*/ +int CustomData_data_equals(int type, void *data1, void *data2); +void CustomData_data_initminmax(int type, void *min, void *max); +void CustomData_data_dominmax(int type, void *data, void *min, void *max); +void CustomData_data_multiply(int type, void *data, float fac); +void CustomData_data_add(int type, void *data1, void *data2); + /* initialises a CustomData object with the same layer setup as source. * mask is a bitfield where (mask & (1 << (layer type))) indicates * if a layer should be copied or not. alloctype must be one of the above. */ @@ -192,6 +209,10 @@ void *CustomData_em_get_n(const struct CustomData *data, void *block, int type, void *CustomData_bmesh_get(const struct CustomData *data, void *block, int type); void *CustomData_bmesh_get_n(const struct CustomData *data, void *block, int type, int n); +/* gets the layer at physical index n, with no type checking. + */ +void *CustomData_bmesh_get_layer_n(const struct CustomData *data, void *block, int n); + /* gets a pointer to the active or first layer of type * returns NULL if there is no layer of type */ @@ -227,6 +248,11 @@ void CustomData_bmesh_set(const struct CustomData *data, void *block, int type, void CustomData_bmesh_set_n(struct CustomData *data, void *block, int type, int n, void *source); +/*sets the data of the block at physical layer n. no real type checking + *is performed. + */ +void CustomData_bmesh_set_layer_n(struct CustomData *data, void *block, int n, + void *source); /* set the pointer of to the first layer of type. the old data is not freed. * returns the value of ptr if the layer is found, NULL otherwise |