diff options
author | Brecht Van Lommel <brecht> | 2020-04-21 14:09:41 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-04-22 15:20:31 +0300 |
commit | aa09a46fd736061668746e027877b512cc124950 (patch) | |
tree | 3de73bd85aac0d93f0aff4f2002496040fef6302 /source/blender/blenkernel/BKE_modifier.h | |
parent | dfe22c2900722e122199549f1a6c0b7c51eedc72 (diff) |
Objects: add infrastructure for hair, pointcloud, volume modifiers
There is no user visible difference in standard builds, as there are no
volume modifiers yet. When using WITH_NEW_OBJECT_TYPES some deform only
modifiers are now available for hair and pointcloud objects.
Differential Revision: https://developer.blender.org/D7141
Diffstat (limited to 'source/blender/blenkernel/BKE_modifier.h')
-rw-r--r-- | source/blender/blenkernel/BKE_modifier.h | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index c37e56149eb..3a3be7e82c2 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -100,7 +100,7 @@ typedef enum { /* For modifiers that use CD_PREVIEW_MCOL for preview. */ eModifierTypeFlag_UsesPreview = (1 << 9), - eModifierTypeFlag_AcceptsLattice = (1 << 10), + eModifierTypeFlag_AcceptsVertexCosOnly = (1 << 10), } ModifierTypeFlag; /* IMPORTANT! Keep ObjectWalkFunc and IDWalkFunc signatures compatible. */ @@ -211,18 +211,28 @@ typedef struct ModifierTypeInfo { /********************* Non-deform modifier functions *********************/ - /* For non-deform types: apply the modifier and return a mesh object. + /* For non-deform types: apply the modifier and return a mesh datablock. * - * The mesh argument should always be non-NULL; the modifier - * should read the object data from the mesh object instead of the - * actual object data. + * The mesh argument should always be non-NULL; the modifier should use the + * passed in mesh datablock rather than object->data, as it contains the mesh + * with modifier applied up to this point. * - * The modifier may reuse the mesh argument (i.e. return it in - * modified form), but must not release it. + * The modifier may modify and return the mesh argument, but must not free it + * and must ensure any referenced data layers are converted to non-referenced + * before modification. */ - struct Mesh *(*applyModifier)(struct ModifierData *md, - const struct ModifierEvalContext *ctx, - struct Mesh *mesh); + struct Mesh *(*modifyMesh)(struct ModifierData *md, + const struct ModifierEvalContext *ctx, + struct Mesh *mesh); + struct Hair *(*modifyHair)(struct ModifierData *md, + const struct ModifierEvalContext *ctx, + struct Hair *hair); + struct PointCloud *(*modifyPointCloud)(struct ModifierData *md, + const struct ModifierEvalContext *ctx, + struct PointCloud *pointcloud); + struct Volume *(*modifyVolume)(struct ModifierData *md, + const struct ModifierEvalContext *ctx, + struct Volume *volume); /********************* Optional functions *********************/ @@ -450,9 +460,9 @@ struct ModifierData *modifier_get_evaluated(struct Depsgraph *depsgraph, /* wrappers for modifier callbacks that ensure valid normals */ -struct Mesh *modwrap_applyModifier(ModifierData *md, - const struct ModifierEvalContext *ctx, - struct Mesh *me); +struct Mesh *modwrap_modifyMesh(ModifierData *md, + const struct ModifierEvalContext *ctx, + struct Mesh *me); void modwrap_deformVerts(ModifierData *md, const struct ModifierEvalContext *ctx, |