Blender V4.3
ModifierTypeInfo Struct Reference

#include <BKE_modifier.hh>

Public Attributes

char idname [64]
 
char name [64]
 
char struct_name [64]
 
int struct_size
 
StructRNAsrna
 
ModifierTypeType type
 
ModifierTypeFlag flags
 
int icon
 
void(* copy_data )(const ModifierData *md, ModifierData *target, int flag)
 
void(* deform_verts )(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, blender::MutableSpan< blender::float3 > positions)
 
void(* deform_matrices )(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, blender::MutableSpan< blender::float3 > positions, blender::MutableSpan< blender::float3x3 > matrices)
 
void(* deform_verts_EM )(ModifierData *md, const ModifierEvalContext *ctx, const BMEditMesh *em, Mesh *mesh, blender::MutableSpan< blender::float3 > positions)
 
void(* deform_matrices_EM )(ModifierData *md, const ModifierEvalContext *ctx, const BMEditMesh *em, Mesh *mesh, blender::MutableSpan< blender::float3 > positions, blender::MutableSpan< blender::float3x3 > matrices)
 
Mesh *(* modify_mesh )(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh)
 
void(* modify_geometry_set )(ModifierData *md, const ModifierEvalContext *ctx, blender::bke::GeometrySet *geometry_set)
 
void(* init_data )(ModifierData *md)
 
void(* required_data_mask )(ModifierData *md, CustomData_MeshMasks *r_cddata_masks)
 
void(* free_data )(ModifierData *md)
 
bool(* is_disabled )(const Scene *scene, ModifierData *md, bool use_render_params)
 
void(* update_depsgraph )(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
 
bool(* depends_on_time )(Scene *scene, ModifierData *md)
 
bool(* depends_on_normals )(ModifierData *md)
 
void(* foreach_ID_link )(ModifierData *md, Object *ob, IDWalkFunc walk, void *user_data)
 
void(* foreach_tex_link )(ModifierData *md, Object *ob, TexWalkFunc walk, void *user_data)
 
void(* free_runtime_data )(void *runtime_data)
 
void(* panel_register )(ARegionType *region_type)
 
void(* blend_write )(BlendWriter *writer, const ID *id_owner, const ModifierData *md)
 
void(* blend_read )(BlendDataReader *reader, ModifierData *md)
 
void(* foreach_cache )(Object *object, ModifierData *md, blender::FunctionRef< void(const IDCacheKey &cache_key, void **cache_p, uint flags)> fn)
 

Detailed Description

Definition at line 171 of file BKE_modifier.hh.

Member Data Documentation

◆ blend_read

void(* ModifierTypeInfo::blend_read) (BlendDataReader *reader, 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 388 of file BKE_modifier.hh.

Referenced by BKE_modifier_blend_read_data().

◆ blend_write

void(* ModifierTypeInfo::blend_write) (BlendWriter *writer, const ID *id_owner, const 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 380 of file BKE_modifier.hh.

Referenced by BKE_modifier_blend_write().

◆ copy_data

void(* ModifierTypeInfo::copy_data) (const ModifierData *md, 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.hh's LIB_ID_COPY_... flags for more).

Definition at line 204 of file BKE_modifier.hh.

Referenced by BKE_modifier_copydata_ex().

◆ deform_matrices

void(* ModifierTypeInfo::deform_matrices) (ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, blender::MutableSpan< blender::float3 > positions, blender::MutableSpan< blender::float3x3 > matrices)

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

Definition at line 221 of file BKE_modifier.hh.

Referenced by BKE_crazyspace_build_sculpt(), and BKE_sculpt_get_first_deform_matrices().

◆ deform_matrices_EM

void(* ModifierTypeInfo::deform_matrices_EM) (ModifierData *md, const ModifierEvalContext *ctx, const BMEditMesh *em, Mesh *mesh, blender::MutableSpan< blender::float3 > positions, blender::MutableSpan< blender::float3x3 > matrices)

◆ deform_verts

void(* ModifierTypeInfo::deform_verts) (ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh, blender::MutableSpan< blender::float3 > positions)

Apply a deformation to the positions in the positions array. If the mesh argument is non-null, if will contain proper (not wrapped) mesh data. The positions array may or may not be the same as the mesh's position attribute.

Definition at line 213 of file BKE_modifier.hh.

Referenced by BKE_crazyspace_build_sculpt(), BKE_curve_calc_modifiers_pre(), BKE_lattice_modifiers_calc(), BKE_modifier_deform_verts(), blender::ed::object::create_applied_mesh_for_modifier(), curve_calc_modifiers_post(), and blender::ed::object::modifier_apply_obdata().

◆ deform_verts_EM

void(* ModifierTypeInfo::deform_verts_EM) (ModifierData *md, const ModifierEvalContext *ctx, const BMEditMesh *em, Mesh *mesh, blender::MutableSpan< blender::float3 > positions)

Like deform_verts but called during edit-mode if supported. The mesh argument might be a wrapper around edit BMesh data.

Definition at line 230 of file BKE_modifier.hh.

Referenced by BKE_modifier_deform_vertsEM(), and blender::bke::editbmesh_calc_modifiers().

◆ depends_on_normals

bool(* ModifierTypeInfo::depends_on_normals) (ModifierData *md)

Returns true when a deform modifier uses mesh normals as input. This callback is only required for deform modifiers that support deforming positions with an edit mesh (when deform_verts_EM is implemented).

Definition at line 335 of file BKE_modifier.hh.

Referenced by BKE_modifier_deform_vertsEM().

◆ depends_on_time

bool(* ModifierTypeInfo::depends_on_time) (Scene *scene, 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 328 of file BKE_modifier.hh.

Referenced by BKE_modifier_depends_ontime().

◆ flags

◆ foreach_cache

void(* ModifierTypeInfo::foreach_cache) (Object *object, ModifierData *md, blender::FunctionRef< void(const IDCacheKey &cache_key, void **cache_p, uint flags)> fn)

Iterate over all cache pointers of given modifier. Also see IDTypeInfo::foreach_cache.

Definition at line 393 of file BKE_modifier.hh.

◆ foreach_ID_link

void(* ModifierTypeInfo::foreach_ID_link) (ModifierData *md, Object *ob, IDWalkFunc walk, void *user_data)

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 345 of file BKE_modifier.hh.

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

◆ foreach_tex_link

void(* ModifierTypeInfo::foreach_tex_link) (ModifierData *md, Object *ob, TexWalkFunc walk, void *user_data)

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 355 of file BKE_modifier.hh.

Referenced by BKE_modifiers_foreach_tex_link().

◆ free_data

void(* ModifierTypeInfo::free_data) (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 302 of file BKE_modifier.hh.

Referenced by BKE_modifier_copydata_generic(), and BKE_modifier_free_ex().

◆ free_runtime_data

void(* ModifierTypeInfo::free_runtime_data) (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 368 of file BKE_modifier.hh.

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

◆ icon

int ModifierTypeInfo::icon

◆ idname

char ModifierTypeInfo::idname[64]

Definition at line 174 of file BKE_modifier.hh.

Referenced by BKE_modifier_type_panel_id().

◆ init_data

void(* ModifierTypeInfo::init_data) (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 276 of file BKE_modifier.hh.

Referenced by modifier_allocate_and_init().

◆ is_disabled

bool(* ModifierTypeInfo::is_disabled) (const Scene *scene, ModifierData *md, bool use_render_params)

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 313 of file BKE_modifier.hh.

Referenced by BKE_lattice_modifiers_calc(), BKE_modifier_couldbe_cage(), BKE_modifier_is_enabled(), BKE_modifier_supports_cage(), BKE_modifiers_get_cage_index(), blender::ed::object::create_applied_mesh_for_modifier(), blender::ed::object::modifier_apply_obdata(), blender::ed::object::modifier_apply_shape(), and modifier_panel_header().

◆ modify_geometry_set

void(* ModifierTypeInfo::modify_geometry_set) (ModifierData *md, const ModifierEvalContext *ctx, blender::bke::GeometrySet *geometry_set)

◆ modify_mesh

Mesh *(* ModifierTypeInfo::modify_mesh) (ModifierData *md, const ModifierEvalContext *ctx, 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 257 of file BKE_modifier.hh.

Referenced by BKE_modifier_modify_mesh(), BKE_multires_create_mesh(), blender::ed::object::create_applied_mesh_for_modifier(), and curve_calc_modifiers_post().

◆ name

char ModifierTypeInfo::name[64]

◆ panel_register

void(* ModifierTypeInfo::panel_register) (ARegionType *region_type)

Register the panel types for the modifier's UI.

Definition at line 371 of file BKE_modifier.hh.

Referenced by ED_spacetype_buttons(), and uiTemplateModifiers().

◆ required_data_mask

void(* ModifierTypeInfo::required_data_mask) (ModifierData *md, 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 292 of file BKE_modifier.hh.

Referenced by BKE_modifier_calc_data_masks(), blender::bke::editbmesh_calc_modifiers(), and blender::bke::mesh_calc_modifiers().

◆ srna

StructRNA* ModifierTypeInfo::srna

Definition at line 188 of file BKE_modifier.hh.

◆ struct_name

char ModifierTypeInfo::struct_name[64]

Definition at line 182 of file BKE_modifier.hh.

Referenced by BKE_modifier_blend_write(), and modifier_allocate_and_init().

◆ struct_size

int ModifierTypeInfo::struct_size

Definition at line 185 of file BKE_modifier.hh.

Referenced by BKE_modifier_copydata_generic(), and modifier_allocate_and_init().

◆ type

◆ update_depsgraph

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

Add the appropriate relations to the dependency graph.

This function is optional.

Definition at line 320 of file BKE_modifier.hh.

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


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