Blender  V3.3
Public Attributes | List of all members
ModifierTypeInfo Struct Reference

#include <BKE_modifier.h>

Public Attributes

char name [32]
 
char structName [32]
 
int structSize
 
struct StructRNAsrna
 
ModifierTypeType type
 
ModifierTypeFlag flags
 
int icon
 
void(* copyData )(const struct ModifierData *md, struct ModifierData *target, int flag)
 
void(* deformVerts )(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *mesh, float(*vertexCos)[3], int numVerts)
 
void(* deformMatrices )(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *mesh, float(*vertexCos)[3], float(*defMats)[3][3], int numVerts)
 
void(* deformVertsEM )(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct BMEditMesh *editData, struct Mesh *mesh, float(*vertexCos)[3], int numVerts)
 
void(* deformMatricesEM )(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct BMEditMesh *editData, struct Mesh *mesh, float(*vertexCos)[3], float(*defMats)[3][3], int numVerts)
 
struct Mesh *(* modifyMesh )(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *mesh)
 
void(* modifyGeometrySet )(struct ModifierData *md, const struct ModifierEvalContext *ctx, struct GeometrySet *geometry_set)
 
void(* initData )(struct ModifierData *md)
 
void(* requiredDataMask )(struct Object *ob, struct ModifierData *md, struct CustomData_MeshMasks *r_cddata_masks)
 
void(* freeData )(struct ModifierData *md)
 
bool(* isDisabled )(const struct Scene *scene, struct ModifierData *md, bool userRenderParams)
 
void(* updateDepsgraph )(struct ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 
bool(* dependsOnTime )(struct Scene *scene, struct ModifierData *md)
 
bool(* dependsOnNormals )(struct ModifierData *md)
 
void(* foreachIDLink )(struct ModifierData *md, struct Object *ob, IDWalkFunc walk, void *userData)
 
void(* foreachTexLink )(struct ModifierData *md, struct Object *ob, TexWalkFunc walk, void *userData)
 
void(* freeRuntimeData )(void *runtime_data)
 
void(* panelRegister )(struct ARegionType *region_type)
 
void(* blendWrite )(struct BlendWriter *writer, const struct ID *id_owner, const struct ModifierData *md)
 
void(* blendRead )(struct BlendDataReader *reader, struct ModifierData *md)
 

Detailed Description

Definition at line 145 of file BKE_modifier.h.

Member Data Documentation

◆ blendRead

void(* ModifierTypeInfo::blendRead) (struct BlendDataReader *reader, struct ModifierData *md)

Is called when the modifier is read from a file.

It can be used to update pointers to arrays and other structs. Furthermore, fields that have not been written (e.g. runtime data) can be reset.

Definition at line 377 of file BKE_modifier.h.

Referenced by BKE_modifier_blend_read_data().

◆ blendWrite

void(* ModifierTypeInfo::blendWrite) (struct BlendWriter *writer, const struct ID *id_owner, const struct ModifierData *md)

Is called when the modifier is written to a file. The modifier data struct itself is written already.

This method should write any additional arrays and referenced structs that should be stored in the file.

Definition at line 367 of file BKE_modifier.h.

Referenced by BKE_modifier_blend_write().

◆ copyData

void(* ModifierTypeInfo::copyData) (const struct ModifierData *md, struct ModifierData *target, int flag)

Copy instance data for this modifier type. Should copy all user level settings to the target modifier.

Parameters
flagCopying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).

Definition at line 174 of file BKE_modifier.h.

Referenced by BKE_modifier_copydata_ex().

◆ deformMatrices

void(* ModifierTypeInfo::deformMatrices) (struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *mesh, float(*vertexCos)[3], float(*defMats)[3][3], int numVerts)

Like deformMatricesEM but called from object mode (for supporting modifiers in sculpt mode).

Definition at line 193 of file BKE_modifier.h.

Referenced by BKE_crazyspace_build_sculpt(), and BKE_sculpt_get_first_deform_matrices().

◆ deformMatricesEM

void(* ModifierTypeInfo::deformMatricesEM) (struct ModifierData *md, const struct ModifierEvalContext *ctx, struct BMEditMesh *editData, struct Mesh *mesh, float(*vertexCos)[3], float(*defMats)[3][3], int numVerts)

◆ deformVerts

void(* ModifierTypeInfo::deformVerts) (struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *mesh, float(*vertexCos)[3], int numVerts)

Only for deform types, should apply the deformation to the given vertex array. If the deformer requires information from the object it can obtain it from the mesh argument if non-NULL, and otherwise the ob argument.

Definition at line 184 of file BKE_modifier.h.

Referenced by BKE_crazyspace_build_sculpt(), BKE_curve_calc_modifiers_pre(), BKE_lattice_modifiers_calc(), BKE_mesh_create_derived_for_modifier(), BKE_modifier_deform_verts(), curve_calc_modifiers_post(), and modifier_apply_obdata().

◆ deformVertsEM

void(* ModifierTypeInfo::deformVertsEM) (struct ModifierData *md, const struct ModifierEvalContext *ctx, struct BMEditMesh *editData, struct Mesh *mesh, float(*vertexCos)[3], int numVerts)

Like deformVerts but called during editmode (for supporting modifiers)

Definition at line 202 of file BKE_modifier.h.

Referenced by BKE_modifier_deform_vertsEM(), and editbmesh_calc_modifiers().

◆ dependsOnNormals

bool(* ModifierTypeInfo::dependsOnNormals) (struct ModifierData *md)

True when a deform modifier uses normals, the requiredDataMask can't be used here because that refers to a normal layer whereas in this case we need to know if the deform modifier uses normals.

this is needed because applying 2 deform modifiers will give the second modifier bogus normals.

Definition at line 316 of file BKE_modifier.h.

Referenced by BKE_modifier_deform_verts(), BKE_modifier_deform_vertsEM(), BKE_modifier_modify_mesh(), editbmesh_calc_modifiers(), and mesh_calc_modifiers().

◆ dependsOnTime

bool(* ModifierTypeInfo::dependsOnTime) (struct Scene *scene, struct ModifierData *md)

Should return true if the modifier needs to be recalculated on time changes.

This function is optional (assumes false if not present).

Definition at line 306 of file BKE_modifier.h.

Referenced by BKE_modifier_depends_ontime().

◆ flags

ModifierTypeFlag ModifierTypeInfo::flags

◆ foreachIDLink

void(* ModifierTypeInfo::foreachIDLink) (struct ModifierData *md, struct Object *ob, IDWalkFunc walk, void *userData)

Should call the given walk function with a pointer to each ID pointer (i.e. each data-block pointer) that the modifier data stores. This is used for linking on file load and for unlinking data-blocks or forwarding data-block references.

This function is optional.

Definition at line 326 of file BKE_modifier.h.

Referenced by BKE_modifier_copydata_ex(), BKE_modifier_free_ex(), BKE_modifiers_foreach_ID_link(), and BKE_particlesystem_id_loop().

◆ foreachTexLink

void(* ModifierTypeInfo::foreachTexLink) (struct ModifierData *md, struct Object *ob, TexWalkFunc walk, void *userData)

Should call the given walk function for each texture that the modifier data stores. This is used for finding all textures in the context for the UI.

This function is optional. If it is not present, it will be assumed the modifier has no textures.

Definition at line 339 of file BKE_modifier.h.

Referenced by BKE_modifiers_foreach_tex_link().

◆ freeData

void(* ModifierTypeInfo::freeData) (struct ModifierData *md)

Free internal modifier data variables, this function should not free the md variable itself.

This function is responsible for freeing the runtime data as well.

This function is optional.

Definition at line 280 of file BKE_modifier.h.

Referenced by BKE_modifier_copydata_generic(), and BKE_modifier_free_ex().

◆ freeRuntimeData

void(* ModifierTypeInfo::freeRuntimeData) (void *runtime_data)

Free given run-time data.

This data is coming from a modifier of the corresponding type, but actual modifier data is not known here.

Notes:

  • The data itself is to be de-allocated as well.
  • This callback is allowed to receive NULL pointer as a data, so it's more like "ensure the data is freed".

Definition at line 355 of file BKE_modifier.h.

Referenced by blender::deg::ObjectRuntimeBackup::restore_modifier_runtime_data().

◆ icon

int ModifierTypeInfo::icon

Definition at line 164 of file BKE_modifier.h.

Referenced by tree_element_get_icon().

◆ initData

void(* ModifierTypeInfo::initData) (struct ModifierData *md)

Initialize new instance data for this modifier type, this function should set modifier variables to their default values.

This function is optional.

Definition at line 252 of file BKE_modifier.h.

Referenced by modifier_allocate_and_init().

◆ isDisabled

bool(* ModifierTypeInfo::isDisabled) (const struct Scene *scene, struct ModifierData *md, bool userRenderParams)

Return a boolean value indicating if this modifier is able to be calculated based on the modifier data. This is not regarding the md->flag, that is tested by the system, this is just if the data validates (for example, a lattice will return false if the lattice object is not defined).

This function is optional (assumes never disabled if not present).

Definition at line 291 of file BKE_modifier.h.

Referenced by BKE_lattice_modifiers_calc(), BKE_mesh_create_derived_for_modifier(), BKE_modifier_couldbe_cage(), BKE_modifier_is_enabled(), BKE_modifier_supports_cage(), BKE_modifiers_get_cage_index(), modifier_apply_obdata(), modifier_apply_shape(), and modifier_panel_header().

◆ modifyGeometrySet

void(* ModifierTypeInfo::modifyGeometrySet) (struct ModifierData *md, const struct ModifierEvalContext *ctx, struct GeometrySet *geometry_set)

The modifier has to change the geometry set in-place. The geometry set can contain zero or more geometry components. This callback can be used by modifiers that don't work on any specific type of geometry (e.g. mesh).

Definition at line 240 of file BKE_modifier.h.

Referenced by BKE_object_support_modifier_type_check(), curve_calc_modifiers_post(), curves_evaluate_modifiers(), modifier_apply_obdata(), modifier_modify_mesh_and_geometry_set(), pointcloud_evaluate_modifiers(), and volume_evaluate_modifiers().

◆ modifyMesh

struct Mesh*(* ModifierTypeInfo::modifyMesh) (struct ModifierData *md, const struct ModifierEvalContext *ctx, struct Mesh *mesh)

For non-deform types: apply the modifier and return a mesh data-block.

The mesh argument should always be non-NULL; the modifier should use the passed in mesh data-block rather than object->data, as it contains the mesh with modifier applied up to this point.

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.

Definition at line 210 of file BKE_modifier.h.

Referenced by BKE_mesh_create_derived_for_modifier(), BKE_modifier_modify_mesh(), BKE_multires_create_mesh(), and curve_calc_modifiers_post().

◆ name

char ModifierTypeInfo::name[32]

◆ panelRegister

void(* ModifierTypeInfo::panelRegister) (struct ARegionType *region_type)

Register the panel types for the modifier's UI.

Definition at line 358 of file BKE_modifier.h.

Referenced by ED_spacetype_buttons(), and uiTemplateModifiers().

◆ requiredDataMask

void(* ModifierTypeInfo::requiredDataMask) (struct Object *ob, struct ModifierData *md, struct CustomData_MeshMasks *r_cddata_masks)

Should add to passed r_cddata_masks the data types that this modifier needs. If (mask & (1 << (layer type))) != 0, this modifier 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.

If this function is not present, it is assumed that no extra data is needed.

This function is optional.

Definition at line 268 of file BKE_modifier.h.

Referenced by BKE_modifier_calc_data_masks(), editbmesh_calc_modifiers(), and mesh_calc_modifiers().

◆ srna

struct StructRNA* ModifierTypeInfo::srna

Definition at line 158 of file BKE_modifier.h.

◆ structName

char ModifierTypeInfo::structName[32]

Definition at line 152 of file BKE_modifier.h.

Referenced by BKE_modifier_blend_write(), and modifier_allocate_and_init().

◆ structSize

int ModifierTypeInfo::structSize

Definition at line 155 of file BKE_modifier.h.

Referenced by BKE_modifier_copydata_generic(), and modifier_allocate_and_init().

◆ type

ModifierTypeType ModifierTypeInfo::type

◆ updateDepsgraph

void(* ModifierTypeInfo::updateDepsgraph) (struct ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)

Add the appropriate relations to the dependency graph.

This function is optional.

Definition at line 298 of file BKE_modifier.h.

Referenced by blender::deg::DepsgraphRelationBuilder::build_object_data_geometry().


The documentation for this struct was generated from the following file: