Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_modifier.h
| Show All 19 Lines | |||||
| * \ingroup bke | * \ingroup bke | ||||
| */ | */ | ||||
| #include "DNA_modifier_types.h" /* needed for all enum typdefs */ | #include "DNA_modifier_types.h" /* needed for all enum typdefs */ | ||||
| #include "BLI_compiler_attrs.h" | #include "BLI_compiler_attrs.h" | ||||
| #include "BKE_customdata.h" | #include "BKE_customdata.h" | ||||
| struct BMEditMesh; | struct BMEditMesh; | ||||
| struct CustomData_MeshMasks; | |||||
| struct DepsNodeHandle; | struct DepsNodeHandle; | ||||
| struct Depsgraph; | struct Depsgraph; | ||||
| struct DerivedMesh; | struct DerivedMesh; | ||||
| struct ID; | struct ID; | ||||
| struct ListBase; | struct ListBase; | ||||
| struct Main; | struct Main; | ||||
| struct Mesh; | struct Mesh; | ||||
| struct ModifierData; | struct ModifierData; | ||||
| ▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | typedef struct ModifierTypeInfo { | ||||
| /* Initialize new instance data for this modifier type, this function | /* Initialize new instance data for this modifier type, this function | ||||
| * should set modifier variables to their default values. | * should set modifier variables to their default values. | ||||
| * | * | ||||
| * This function is optional. | * This function is optional. | ||||
| */ | */ | ||||
| void (*initData)(struct ModifierData *md); | 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 | * 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. | * depending on the modifier's settings. | ||||
| * | * | ||||
| * Note that this means extra data (e.g. vertex groups) - it is assumed | * Note that this means extra data (e.g. vertex groups) - it is assumed | ||||
| * that all modifiers need mesh data and deform modifiers need vertex | * that all modifiers need mesh data and deform modifiers need vertex | ||||
| * coordinates. | * coordinates. | ||||
| * | * | ||||
| * Note that this limits the number of custom data layer types to 32. | * If this function is not present, it is assumed that no extra data is needed. | ||||
| * | |||||
| * If this function is not present or it returns 0, it is assumed that | |||||
| * no extra data is needed. | |||||
| * | * | ||||
| * This function is optional. | * 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 | /* Free internal modifier data variables, this function should | ||||
| * not free the md variable itself. | * not free the md variable itself. | ||||
| * | * | ||||
| * This function is optional. | * This function is optional. | ||||
| */ | */ | ||||
| void (*freeData)(struct ModifierData *md); | void (*freeData)(struct ModifierData *md); | ||||
| ▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | |||||
| struct Object *modifiers_isDeformedByCurve(struct Object *ob); | struct Object *modifiers_isDeformedByCurve(struct Object *ob); | ||||
| bool modifiers_usesArmature(struct Object *ob, struct bArmature *arm); | bool modifiers_usesArmature(struct Object *ob, struct bArmature *arm); | ||||
| bool modifiers_isCorrectableDeformed(struct Scene *scene, struct Object *ob); | bool modifiers_isCorrectableDeformed(struct Scene *scene, struct Object *ob); | ||||
| void modifier_freeTemporaryData(struct ModifierData *md); | void modifier_freeTemporaryData(struct ModifierData *md); | ||||
| bool modifiers_isPreview(struct Object *ob); | bool modifiers_isPreview(struct Object *ob); | ||||
| typedef struct CDMaskLink { | typedef struct CDMaskLink { | ||||
| struct CDMaskLink *next; | struct CDMaskLink *next; | ||||
| CustomDataMask mask; | struct CustomData_MeshMasks mask; | ||||
| } CDMaskLink; | } 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 | * 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 | * evaluation, assuming the data indicated by dataMask is required at the | ||||
| * end of the stack. | * end of the stack. | ||||
| */ | */ | ||||
| struct CDMaskLink *modifiers_calcDataMasks(struct Scene *scene, | struct CDMaskLink *modifiers_calcDataMasks(struct Scene *scene, | ||||
| struct Object *ob, | struct Object *ob, | ||||
| struct ModifierData *md, | struct ModifierData *md, | ||||
| CustomDataMask dataMask, | const struct CustomData_MeshMasks *dataMask, | ||||
| int required_mode, | int required_mode, | ||||
| ModifierData *previewmd, CustomDataMask previewmask); | ModifierData *previewmd, | ||||
| const struct CustomData_MeshMasks *previewmask); | |||||
| struct ModifierData *modifiers_getLastPreview(struct Scene *scene, | struct ModifierData *modifiers_getLastPreview(struct Scene *scene, | ||||
| struct ModifierData *md, | struct ModifierData *md, | ||||
| int required_mode); | int required_mode); | ||||
| typedef struct VirtualModifierData { | typedef struct VirtualModifierData { | ||||
| ArmatureModifierData amd; | ArmatureModifierData amd; | ||||
| CurveModifierData cmd; | CurveModifierData cmd; | ||||
| LatticeModifierData lmd; | LatticeModifierData lmd; | ||||
| ▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines | |||||