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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-03-07 13:13:40 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-03-07 13:29:50 +0300
commitab0bc65c24bdf68c356adb2566f3669153c931ea (patch)
tree23909478874a13d84e504a905809eb211e62a9e2 /source/blender/blenkernel/BKE_modifier.h
parentcee53160d2bd9067a3d43cc862ce61e36ff70454 (diff)
Refactor CDData masks, to have one mask per mesh elem type.
We already have different storages for cddata of verts, edges etc., 'simply' do the same for the mask flags we use all around Blender code to request some data, or limit some operation to some layers, etc. Reason we need this is that some cddata types (like Normals) are actually shared between verts/polys/loops, and we don’t want to generate clnors everytime we request vnors! As a side note, this also does final fix to T59338, which was the trigger for this patch (need to request computed loop normals for another mesh than evaluated one). Reviewers: brecht, campbellbarton, sergey Differential Revision: https://developer.blender.org/D4407
Diffstat (limited to 'source/blender/blenkernel/BKE_modifier.h')
-rw-r--r--source/blender/blenkernel/BKE_modifier.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index 51fb6d8a591..1a1e510b9e1 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -25,6 +25,7 @@
#include "BKE_customdata.h"
struct BMEditMesh;
+struct CustomData_MeshMasks;
struct DepsNodeHandle;
struct Depsgraph;
struct DerivedMesh;
@@ -214,23 +215,20 @@ typedef struct ModifierTypeInfo {
*/
void (*initData)(struct ModifierData *md);
- /* Should return a CustomDataMask indicating what data this
+ /* Should add to passed \a r_cddata_masks the data types that this
* modifier needs. If (mask & (1 << (layer type))) != 0, this modifier
- * needs that custom data layer. This function's return value can change
+ * needs that custom data layer. It can change required layers
* depending on the modifier's settings.
*
* Note that this means extra data (e.g. vertex groups) - it is assumed
* that all modifiers need mesh data and deform modifiers need vertex
* coordinates.
*
- * Note that this limits the number of custom data layer types to 32.
- *
- * If this function is not present or it returns 0, it is assumed that
- * no extra data is needed.
+ * If this function is not present, it is assumed that no extra data is needed.
*
* This function is optional.
*/
- CustomDataMask (*requiredDataMask)(struct Object *ob, struct ModifierData *md);
+ void (*requiredDataMask)(struct Object *ob, struct ModifierData *md, struct CustomData_MeshMasks *r_cddata_masks);
/* Free internal modifier data variables, this function should
* not free the md variable itself.
@@ -365,10 +363,10 @@ bool modifiers_isPreview(struct Object *ob);
typedef struct CDMaskLink {
struct CDMaskLink *next;
- CustomDataMask mask;
+ struct CustomData_MeshMasks mask;
} CDMaskLink;
-/* Calculates and returns a linked list of CustomDataMasks indicating the
+/* Calculates and returns a linked list of CustomData_MeshMasks indicating the
* data required by each modifier in the stack pointed to by md for correct
* evaluation, assuming the data indicated by dataMask is required at the
* end of the stack.
@@ -376,9 +374,10 @@ typedef struct CDMaskLink {
struct CDMaskLink *modifiers_calcDataMasks(struct Scene *scene,
struct Object *ob,
struct ModifierData *md,
- CustomDataMask dataMask,
+ const struct CustomData_MeshMasks *dataMask,
int required_mode,
- ModifierData *previewmd, CustomDataMask previewmask);
+ ModifierData *previewmd,
+ const struct CustomData_MeshMasks *previewmask);
struct ModifierData *modifiers_getLastPreview(struct Scene *scene,
struct ModifierData *md,
int required_mode);