Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_modifier.h
| Show All 29 Lines | |||||
| #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 ID; | struct ID; | ||||
| struct Depsgraph; | struct Depsgraph; | ||||
| struct DerivedMesh; | struct DerivedMesh; | ||||
| struct bContext; /* NOTE: gp_bakeModifier() - called from UI - needs to create new datablocks, hence the need for this */ | |||||
| struct Mesh; | struct Mesh; | ||||
| struct Object; | struct Object; | ||||
| struct Scene; | struct Scene; | ||||
| struct ViewLayer; | struct ViewLayer; | ||||
| struct ListBase; | struct ListBase; | ||||
| struct bArmature; | struct bArmature; | ||||
| struct Main; | struct Main; | ||||
| struct ModifierData; | struct ModifierData; | ||||
| struct BMEditMesh; | struct BMEditMesh; | ||||
| struct DepsNodeHandle; | struct DepsNodeHandle; | ||||
| struct bGPDlayer; | |||||
| struct bGPDframe; | |||||
| struct bGPDstroke; | |||||
| typedef enum { | typedef enum { | ||||
| /* Should not be used, only for None modifier type */ | /* Should not be used, only for None modifier type */ | ||||
| eModifierTypeType_None, | eModifierTypeType_None, | ||||
| /* Modifier only does deformation, implies that modifier | /* Modifier only does deformation, implies that modifier | ||||
| * type should have a valid deformVerts function. OnlyDeform | * type should have a valid deformVerts function. OnlyDeform | ||||
| * style modifiers implicitly accept either mesh or CV | * style modifiers implicitly accept either mesh or CV | ||||
| Show All 9 Lines | typedef enum { | ||||
| * unless it's a mesh and can be exploded -> curve can also emit particles | * unless it's a mesh and can be exploded -> curve can also emit particles | ||||
| */ | */ | ||||
| eModifierTypeType_DeformOrConstruct, | eModifierTypeType_DeformOrConstruct, | ||||
| /* Like eModifierTypeType_Nonconstructive, but does not affect the geometry | /* Like eModifierTypeType_Nonconstructive, but does not affect the geometry | ||||
| * of the object, rather some of its CustomData layers. | * of the object, rather some of its CustomData layers. | ||||
| * E.g. UVProject and WeightVG modifiers. */ | * E.g. UVProject and WeightVG modifiers. */ | ||||
| eModifierTypeType_NonGeometrical, | eModifierTypeType_NonGeometrical, | ||||
| /* special mode for grease pencil modifiers */ | |||||
| eModifierTypeType_Gpencil, | |||||
| } ModifierTypeType; | } ModifierTypeType; | ||||
| typedef enum { | typedef enum { | ||||
| eModifierTypeFlag_AcceptsMesh = (1 << 0), | eModifierTypeFlag_AcceptsMesh = (1 << 0), | ||||
| eModifierTypeFlag_AcceptsCVs = (1 << 1), | eModifierTypeFlag_AcceptsCVs = (1 << 1), | ||||
| eModifierTypeFlag_SupportsMapping = (1 << 2), | eModifierTypeFlag_SupportsMapping = (1 << 2), | ||||
| eModifierTypeFlag_SupportsEditmode = (1 << 3), | eModifierTypeFlag_SupportsEditmode = (1 << 3), | ||||
| Show All 18 Lines | typedef enum { | ||||
| eModifierTypeFlag_Single = (1 << 7), | eModifierTypeFlag_Single = (1 << 7), | ||||
| /* Some modifier can't be added manually by user */ | /* Some modifier can't be added manually by user */ | ||||
| eModifierTypeFlag_NoUserAdd = (1 << 8), | eModifierTypeFlag_NoUserAdd = (1 << 8), | ||||
| /* For modifiers that use CD_PREVIEW_MCOL for preview. */ | /* For modifiers that use CD_PREVIEW_MCOL for preview. */ | ||||
| eModifierTypeFlag_UsesPreview = (1 << 9), | eModifierTypeFlag_UsesPreview = (1 << 9), | ||||
| eModifierTypeFlag_AcceptsLattice = (1 << 10), | eModifierTypeFlag_AcceptsLattice = (1 << 10), | ||||
| /* Grease pencil modifiers (do not change mesh, only is placeholder) */ | |||||
| eModifierTypeFlag_GpencilMod = (1 << 11), | |||||
| } ModifierTypeFlag; | } ModifierTypeFlag; | ||||
| /* IMPORTANT! Keep ObjectWalkFunc and IDWalkFunc signatures compatible. */ | /* IMPORTANT! Keep ObjectWalkFunc and IDWalkFunc signatures compatible. */ | ||||
| typedef void (*ObjectWalkFunc)(void *userData, struct Object *ob, struct Object **obpoin, int cb_flag); | typedef void (*ObjectWalkFunc)(void *userData, struct Object *ob, struct Object **obpoin, int cb_flag); | ||||
| typedef void (*IDWalkFunc)(void *userData, struct Object *ob, struct ID **idpoin, int cb_flag); | typedef void (*IDWalkFunc)(void *userData, struct Object *ob, struct ID **idpoin, int cb_flag); | ||||
| typedef void (*TexWalkFunc)(void *userData, struct Object *ob, struct ModifierData *md, const char *propname); | typedef void (*TexWalkFunc)(void *userData, struct Object *ob, struct ModifierData *md, const char *propname); | ||||
| typedef enum ModifierApplyFlag { | typedef enum ModifierApplyFlag { | ||||
| ▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | typedef struct ModifierTypeInfo { | ||||
| * are expected from editmode objects. The same qualifications regarding | * are expected from editmode objects. The same qualifications regarding | ||||
| * mesh apply as for applyModifier. | * mesh apply as for applyModifier. | ||||
| */ | */ | ||||
| struct Mesh *(*applyModifierEM)(struct ModifierData *md, const struct ModifierEvalContext *ctx, | struct Mesh *(*applyModifierEM)(struct ModifierData *md, const struct ModifierEvalContext *ctx, | ||||
| struct BMEditMesh *editData, | struct BMEditMesh *editData, | ||||
| struct Mesh *mesh); | struct Mesh *mesh); | ||||
| /******************* GP modifier functions *********************/ | |||||
| /* Callback for GP "stroke" modifiers that operate on the | |||||
| * shape and parameters of the provided strokes (e.g. Thickness, Noise, etc.) | |||||
| * | |||||
| * The gpl parameter contains the GP layer that the strokes come from. | |||||
| * While access is provided to this data, you should not directly access | |||||
| * the gpl->frames data from the modifier. Instead, use the gpf parameter | |||||
| * instead. | |||||
| * | |||||
| * The gps parameter contains the GP stroke to operate on. This is usually a copy | |||||
| * of the original (unmodified and saved to files) stroke data. | |||||
| */ | |||||
| void (*gp_deformStroke)(struct ModifierData *md, struct Depsgraph *depsgraph, | |||||
| struct Object *ob, struct bGPDlayer *gpl, struct bGPDstroke *gps); | |||||
| /* Callback for GP "geometry" modifiers that create extra geometry | |||||
| * in the frame (e.g. Array) | |||||
| * | |||||
| * The gpf parameter contains the GP frame/strokes to operate on. This is | |||||
| * usually a copy of the original (unmodified and saved to files) stroke data. | |||||
| * Modifiers should only add any generated strokes to this frame (and not one accessed | |||||
| * via the gpl parameter). | |||||
| * | |||||
| * The modifier_index parameter indicates where the modifier is | |||||
| * in the modifier stack in relation to other modifiers. | |||||
| */ | |||||
| void (*gp_generateStrokes)(struct ModifierData *md, struct Depsgraph *depsgraph, | |||||
| struct Object *ob, struct bGPDlayer *gpl, struct bGPDframe *gpf); | |||||
| /* Bake-down GP modifier's effects into the GP datablock. | |||||
| * | |||||
| * This gets called when the user clicks the "Apply" button in the UI. | |||||
| * As such, this callback needs to go through all layers/frames in the | |||||
| * datablock, mutating the geometry and/or creating new datablocks/objects | |||||
| */ | |||||
| void (*gp_bakeModifier)(struct Main *bmain, struct Depsgraph *depsgraph, | |||||
| struct ModifierData *md, struct Object *ob); | |||||
| /********************* Optional functions *********************/ | /********************* Optional functions *********************/ | ||||
| /* 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); | ||||
| ▲ Show 20 Lines • Show All 281 Lines • Show Last 20 Lines | |||||