As described in T91186, this commit moves mesh vertex normals into a contiguous array of float vectors in a custom data layer, how face normals are currently stored. The main interface is documented in `BKE_mesh.h`. Vertex and face normals are now calculated on-demand and cached, retrieved with an "ensure" function. Since the logical state of a mesh is now "has normals when necessary", they can be retrieved from a `const` mesh. The goal is to use on-demand calculation for all derived data, but leave room for eager calculation for performance purposes (modifier evaluation is threaded, but viewport data generation is not). **Benefits** This moves us closer to a SoA approach rather than the current AoS paradigm. Accessing a contiguous `float3` is much more efficient than retrieving data from a larger struct. The memory requirements for accessing only normals or vertex locations are smaller, and at the cost of more memory usage for just normals, they now don't have to be converted between float and short, which also simplifies code In the future, the remaining items can be removed from `MVert`, leaving only `float3`, which has similar benefits (see T93602). Removing the combination of derived and original data makes it conceptually simpler to only calculate normals when necessary. This is especially important now that we have more opportunities for temporary meshes in geometry nodes. **Performance** In addition to the theoretical future performance improvements by making `MVert == float3`, I've done some basic performance testing on this patch directly. The data is fairly rough, but it gives an idea about where things stand generally. - Mesh line primitive 4m Verts: 1.16x faster (36 -> 31 ms), showing that accessing just `MVert` is now more efficient. - Spring Splash Screen: 1.03-1.06 -> 1.06-1.11 FPS, a very slight change that at least shows there is no regression. - Sprite Fright Snail Smoosh: 3.30-3.40 -> 3.42-3.50 FPS, a small but observable speedup. - Set Position Node with Scaled Normal: 1.36x faster (53 -> 39 ms), shows that using normals in geometry nodes is faster. - Normal Calculation 1.6m Vert Cube: 1.19x faster (25 -> 21 ms), shows that calculating normals is slightly faster now. - File Size of 1.6m Vert Cube: 1.03x smaller (214.7 -> 208.4 MB), Normals are not saved in files, which can help with large meshes. As for memory usage, it may be slightly more in some cases, but I didn't observe any difference in the production files I tested. **Tests** Some modifiers and cycles test results need to be updated with this commit, for two reasons: - The subdivision surface modifier is not responsible for calculating normals anymore. In master, the modifier creates different normals than the result of the `Mesh` normal calculation, so this is a bug fix. - There are small differences in the results of some modifiers that use normals because they are not converted to and from `short` anymore. **Future improvements** - Remove `ModifierTypeInfo::dependsOnNormals`. Code in each modifier already retrieves normals if they are needed anyway. - Copy normals as part of a better CoW system for attributes. - Make more areas use lazy instead of eager normal calculation. - Remove `BKE_mesh_normals_tag_dirty` in more places since that is now the default state of a new mesh. - Possibly apply a similar change to derived face corner normals. Differential Revision: https://developer.blender.org/D12770
514 lines
16 KiB
C
514 lines
16 KiB
C
/*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
* The Original Code is Copyright (C) 2005 by the Blender Foundation.
|
|
* All rights reserved.
|
|
*/
|
|
|
|
/** \file
|
|
* \ingroup modifiers
|
|
*/
|
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
#include "BLI_math.h"
|
|
|
|
#include "BLT_translation.h"
|
|
|
|
#include "DNA_defaults.h"
|
|
#include "DNA_mesh_types.h"
|
|
#include "DNA_meshdata_types.h"
|
|
#include "DNA_object_types.h"
|
|
#include "DNA_scene_types.h"
|
|
#include "DNA_screen_types.h"
|
|
|
|
#include "BKE_context.h"
|
|
#include "BKE_deform.h"
|
|
#include "BKE_editmesh.h"
|
|
#include "BKE_lib_id.h"
|
|
#include "BKE_lib_query.h"
|
|
#include "BKE_mesh.h"
|
|
#include "BKE_mesh_wrapper.h"
|
|
#include "BKE_scene.h"
|
|
#include "BKE_screen.h"
|
|
#include "BKE_texture.h"
|
|
|
|
#include "UI_interface.h"
|
|
#include "UI_resources.h"
|
|
|
|
#include "RNA_access.h"
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
#include "RE_texture.h"
|
|
|
|
#include "MOD_modifiertypes.h"
|
|
#include "MOD_ui_common.h"
|
|
#include "MOD_util.h"
|
|
|
|
#include "DEG_depsgraph.h"
|
|
#include "DEG_depsgraph_query.h"
|
|
|
|
static void initData(ModifierData *md)
|
|
{
|
|
WaveModifierData *wmd = (WaveModifierData *)md;
|
|
|
|
BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(wmd, modifier));
|
|
|
|
MEMCPY_STRUCT_AFTER(wmd, DNA_struct_default_get(WaveModifierData), modifier);
|
|
}
|
|
|
|
static bool dependsOnTime(struct Scene *UNUSED(scene),
|
|
ModifierData *UNUSED(md),
|
|
const int UNUSED(dag_eval_mode))
|
|
{
|
|
return true;
|
|
}
|
|
|
|
static void foreachIDLink(ModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
|
|
{
|
|
WaveModifierData *wmd = (WaveModifierData *)md;
|
|
|
|
walk(userData, ob, (ID **)&wmd->texture, IDWALK_CB_USER);
|
|
walk(userData, ob, (ID **)&wmd->objectcenter, IDWALK_CB_NOP);
|
|
walk(userData, ob, (ID **)&wmd->map_object, IDWALK_CB_NOP);
|
|
}
|
|
|
|
static void foreachTexLink(ModifierData *md, Object *ob, TexWalkFunc walk, void *userData)
|
|
{
|
|
walk(userData, ob, md, "texture");
|
|
}
|
|
|
|
static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
|
|
{
|
|
WaveModifierData *wmd = (WaveModifierData *)md;
|
|
bool need_transform_relation = false;
|
|
|
|
if (wmd->objectcenter != NULL) {
|
|
DEG_add_object_relation(ctx->node, wmd->objectcenter, DEG_OB_COMP_TRANSFORM, "Wave Modifier");
|
|
need_transform_relation = true;
|
|
}
|
|
|
|
if (wmd->texture != NULL) {
|
|
DEG_add_generic_id_relation(ctx->node, &wmd->texture->id, "Wave Modifier");
|
|
|
|
if ((wmd->texmapping == MOD_DISP_MAP_OBJECT) && wmd->map_object != NULL) {
|
|
MOD_depsgraph_update_object_bone_relation(
|
|
ctx->node, wmd->map_object, wmd->map_bone, "Wave Modifier");
|
|
need_transform_relation = true;
|
|
}
|
|
else if (wmd->texmapping == MOD_DISP_MAP_GLOBAL) {
|
|
need_transform_relation = true;
|
|
}
|
|
}
|
|
|
|
if (need_transform_relation) {
|
|
DEG_add_modifier_to_transform_relation(ctx->node, "Wave Modifier");
|
|
}
|
|
}
|
|
|
|
static void requiredDataMask(Object *UNUSED(ob),
|
|
ModifierData *md,
|
|
CustomData_MeshMasks *r_cddata_masks)
|
|
{
|
|
WaveModifierData *wmd = (WaveModifierData *)md;
|
|
|
|
/* ask for UV coordinates if we need them */
|
|
if (wmd->texture && wmd->texmapping == MOD_DISP_MAP_UV) {
|
|
r_cddata_masks->fmask |= CD_MASK_MTFACE;
|
|
}
|
|
|
|
/* ask for vertexgroups if we need them */
|
|
if (wmd->defgrp_name[0] != '\0') {
|
|
r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT;
|
|
}
|
|
}
|
|
|
|
static bool dependsOnNormals(ModifierData *md)
|
|
{
|
|
WaveModifierData *wmd = (WaveModifierData *)md;
|
|
|
|
return (wmd->flag & MOD_WAVE_NORM) != 0;
|
|
}
|
|
|
|
static void waveModifier_do(WaveModifierData *md,
|
|
const ModifierEvalContext *ctx,
|
|
Object *ob,
|
|
Mesh *mesh,
|
|
float (*vertexCos)[3],
|
|
int numVerts)
|
|
{
|
|
WaveModifierData *wmd = (WaveModifierData *)md;
|
|
MVert *mvert = NULL;
|
|
MDeformVert *dvert;
|
|
int defgrp_index;
|
|
float ctime = DEG_get_ctime(ctx->depsgraph);
|
|
float minfac = (float)(1.0 / exp(wmd->width * wmd->narrow * wmd->width * wmd->narrow));
|
|
float lifefac = wmd->height;
|
|
float(*tex_co)[3] = NULL;
|
|
const int wmd_axis = wmd->flag & (MOD_WAVE_X | MOD_WAVE_Y);
|
|
const float falloff = wmd->falloff;
|
|
float falloff_fac = 1.0f; /* when falloff == 0.0f this stays at 1.0f */
|
|
const bool invert_group = (wmd->flag & MOD_WAVE_INVERT_VGROUP) != 0;
|
|
|
|
const float(*vert_normals)[3] = NULL;
|
|
if ((wmd->flag & MOD_WAVE_NORM) && (mesh != NULL)) {
|
|
mvert = mesh->mvert;
|
|
vert_normals = BKE_mesh_vertex_normals_ensure(mesh);
|
|
}
|
|
|
|
if (wmd->objectcenter != NULL) {
|
|
float mat[4][4];
|
|
/* get the control object's location in local coordinates */
|
|
invert_m4_m4(ob->imat, ob->obmat);
|
|
mul_m4_m4m4(mat, ob->imat, wmd->objectcenter->obmat);
|
|
|
|
wmd->startx = mat[3][0];
|
|
wmd->starty = mat[3][1];
|
|
}
|
|
|
|
/* get the index of the deform group */
|
|
MOD_get_vgroup(ob, mesh, wmd->defgrp_name, &dvert, &defgrp_index);
|
|
|
|
if (wmd->damp == 0.0f) {
|
|
wmd->damp = 10.0f;
|
|
}
|
|
|
|
if (wmd->lifetime != 0.0f) {
|
|
float x = ctime - wmd->timeoffs;
|
|
|
|
if (x > wmd->lifetime) {
|
|
lifefac = x - wmd->lifetime;
|
|
|
|
if (lifefac > wmd->damp) {
|
|
lifefac = 0.0;
|
|
}
|
|
else {
|
|
lifefac = (float)(wmd->height * (1.0f - sqrtf(lifefac / wmd->damp)));
|
|
}
|
|
}
|
|
}
|
|
|
|
Tex *tex_target = wmd->texture;
|
|
if (mesh != NULL && tex_target != NULL) {
|
|
tex_co = MEM_malloc_arrayN(numVerts, sizeof(*tex_co), "waveModifier_do tex_co");
|
|
MOD_get_texture_coords((MappingInfoModifierData *)wmd, ctx, ob, mesh, vertexCos, tex_co);
|
|
|
|
MOD_init_texture((MappingInfoModifierData *)wmd, ctx);
|
|
}
|
|
|
|
if (lifefac != 0.0f) {
|
|
/* avoid divide by zero checks within the loop */
|
|
float falloff_inv = falloff != 0.0f ? 1.0f / falloff : 1.0f;
|
|
int i;
|
|
|
|
for (i = 0; i < numVerts; i++) {
|
|
float *co = vertexCos[i];
|
|
float x = co[0] - wmd->startx;
|
|
float y = co[1] - wmd->starty;
|
|
float amplit = 0.0f;
|
|
float def_weight = 1.0f;
|
|
|
|
/* get weights */
|
|
if (dvert) {
|
|
def_weight = invert_group ? 1.0f - BKE_defvert_find_weight(&dvert[i], defgrp_index) :
|
|
BKE_defvert_find_weight(&dvert[i], defgrp_index);
|
|
|
|
/* if this vert isn't in the vgroup, don't deform it */
|
|
if (def_weight == 0.0f) {
|
|
continue;
|
|
}
|
|
}
|
|
|
|
switch (wmd_axis) {
|
|
case MOD_WAVE_X | MOD_WAVE_Y:
|
|
amplit = sqrtf(x * x + y * y);
|
|
break;
|
|
case MOD_WAVE_X:
|
|
amplit = x;
|
|
break;
|
|
case MOD_WAVE_Y:
|
|
amplit = y;
|
|
break;
|
|
}
|
|
|
|
/* this way it makes nice circles */
|
|
amplit -= (ctime - wmd->timeoffs) * wmd->speed;
|
|
|
|
if (wmd->flag & MOD_WAVE_CYCL) {
|
|
amplit = (float)fmodf(amplit - wmd->width, 2.0f * wmd->width) + wmd->width;
|
|
}
|
|
|
|
if (falloff != 0.0f) {
|
|
float dist = 0.0f;
|
|
|
|
switch (wmd_axis) {
|
|
case MOD_WAVE_X | MOD_WAVE_Y:
|
|
dist = sqrtf(x * x + y * y);
|
|
break;
|
|
case MOD_WAVE_X:
|
|
dist = fabsf(x);
|
|
break;
|
|
case MOD_WAVE_Y:
|
|
dist = fabsf(y);
|
|
break;
|
|
}
|
|
|
|
falloff_fac = (1.0f - (dist * falloff_inv));
|
|
CLAMP(falloff_fac, 0.0f, 1.0f);
|
|
}
|
|
|
|
/* GAUSSIAN */
|
|
if ((falloff_fac != 0.0f) && (amplit > -wmd->width) && (amplit < wmd->width)) {
|
|
amplit = amplit * wmd->narrow;
|
|
amplit = (float)(1.0f / expf(amplit * amplit) - minfac);
|
|
|
|
/* Apply texture. */
|
|
if (tex_co) {
|
|
Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
|
|
TexResult texres;
|
|
texres.nor = NULL;
|
|
BKE_texture_get_value(scene, tex_target, tex_co[i], &texres, false);
|
|
amplit *= texres.tin;
|
|
}
|
|
|
|
/* Apply weight & falloff. */
|
|
amplit *= def_weight * falloff_fac;
|
|
|
|
if (mvert) {
|
|
/* move along normals */
|
|
if (wmd->flag & MOD_WAVE_NORM_X) {
|
|
co[0] += (lifefac * amplit) * vert_normals[i][0];
|
|
}
|
|
if (wmd->flag & MOD_WAVE_NORM_Y) {
|
|
co[1] += (lifefac * amplit) * vert_normals[i][1];
|
|
}
|
|
if (wmd->flag & MOD_WAVE_NORM_Z) {
|
|
co[2] += (lifefac * amplit) * vert_normals[i][2];
|
|
}
|
|
}
|
|
else {
|
|
/* move along local z axis */
|
|
co[2] += lifefac * amplit;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
MEM_SAFE_FREE(tex_co);
|
|
}
|
|
|
|
static void deformVerts(ModifierData *md,
|
|
const ModifierEvalContext *ctx,
|
|
Mesh *mesh,
|
|
float (*vertexCos)[3],
|
|
int numVerts)
|
|
{
|
|
WaveModifierData *wmd = (WaveModifierData *)md;
|
|
Mesh *mesh_src = NULL;
|
|
|
|
if (wmd->flag & MOD_WAVE_NORM) {
|
|
mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, vertexCos, numVerts, true, false);
|
|
}
|
|
else if (wmd->texture != NULL || wmd->defgrp_name[0] != '\0') {
|
|
mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, NULL, numVerts, false, false);
|
|
}
|
|
|
|
waveModifier_do(wmd, ctx, ctx->object, mesh_src, vertexCos, numVerts);
|
|
|
|
if (!ELEM(mesh_src, NULL, mesh)) {
|
|
BKE_id_free(NULL, mesh_src);
|
|
}
|
|
}
|
|
|
|
static void deformVertsEM(ModifierData *md,
|
|
const ModifierEvalContext *ctx,
|
|
struct BMEditMesh *editData,
|
|
Mesh *mesh,
|
|
float (*vertexCos)[3],
|
|
int numVerts)
|
|
{
|
|
WaveModifierData *wmd = (WaveModifierData *)md;
|
|
Mesh *mesh_src = NULL;
|
|
|
|
if (wmd->flag & MOD_WAVE_NORM) {
|
|
mesh_src = MOD_deform_mesh_eval_get(
|
|
ctx->object, editData, mesh, vertexCos, numVerts, true, false);
|
|
}
|
|
else if (wmd->texture != NULL || wmd->defgrp_name[0] != '\0') {
|
|
mesh_src = MOD_deform_mesh_eval_get(ctx->object, editData, mesh, NULL, numVerts, false, false);
|
|
}
|
|
|
|
/* TODO(Campbell): use edit-mode data only (remove this line). */
|
|
if (mesh_src != NULL) {
|
|
BKE_mesh_wrapper_ensure_mdata(mesh_src);
|
|
}
|
|
|
|
waveModifier_do(wmd, ctx, ctx->object, mesh_src, vertexCos, numVerts);
|
|
|
|
if (!ELEM(mesh_src, NULL, mesh)) {
|
|
BKE_id_free(NULL, mesh_src);
|
|
}
|
|
}
|
|
|
|
static void panel_draw(const bContext *UNUSED(C), Panel *panel)
|
|
{
|
|
uiLayout *sub, *row, *col;
|
|
uiLayout *layout = panel->layout;
|
|
|
|
PointerRNA ob_ptr;
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr);
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
row = uiLayoutRowWithHeading(layout, true, IFACE_("Motion"));
|
|
uiItemR(row, ptr, "use_x", UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE, NULL, ICON_NONE);
|
|
uiItemR(row, ptr, "use_y", UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE, NULL, ICON_NONE);
|
|
|
|
uiItemR(layout, ptr, "use_cyclic", 0, NULL, ICON_NONE);
|
|
|
|
row = uiLayoutRowWithHeading(layout, true, IFACE_("Along Normals"));
|
|
uiItemR(row, ptr, "use_normal", 0, "", ICON_NONE);
|
|
sub = uiLayoutRow(row, true);
|
|
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_normal"));
|
|
uiItemR(sub, ptr, "use_normal_x", UI_ITEM_R_TOGGLE, "X", ICON_NONE);
|
|
uiItemR(sub, ptr, "use_normal_y", UI_ITEM_R_TOGGLE, "Y", ICON_NONE);
|
|
uiItemR(sub, ptr, "use_normal_z", UI_ITEM_R_TOGGLE, "Z", ICON_NONE);
|
|
|
|
col = uiLayoutColumn(layout, false);
|
|
uiItemR(col, ptr, "falloff_radius", 0, "Falloff", ICON_NONE);
|
|
uiItemR(col, ptr, "height", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
uiItemR(col, ptr, "width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
uiItemR(col, ptr, "narrowness", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
|
|
modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL);
|
|
|
|
modifier_panel_end(layout, ptr);
|
|
}
|
|
|
|
static void position_panel_draw(const bContext *UNUSED(C), Panel *panel)
|
|
{
|
|
uiLayout *col;
|
|
uiLayout *layout = panel->layout;
|
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL);
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
uiItemR(layout, ptr, "start_position_object", 0, IFACE_("Object"), ICON_NONE);
|
|
|
|
col = uiLayoutColumn(layout, true);
|
|
uiItemR(col, ptr, "start_position_x", 0, "Start Position X", ICON_NONE);
|
|
uiItemR(col, ptr, "start_position_y", 0, "Y", ICON_NONE);
|
|
}
|
|
|
|
static void time_panel_draw(const bContext *UNUSED(C), Panel *panel)
|
|
{
|
|
uiLayout *col;
|
|
uiLayout *layout = panel->layout;
|
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL);
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
col = uiLayoutColumn(layout, false);
|
|
uiItemR(col, ptr, "time_offset", 0, "Offset", ICON_NONE);
|
|
uiItemR(col, ptr, "lifetime", 0, "Life", ICON_NONE);
|
|
uiItemR(col, ptr, "damping_time", 0, "Damping", ICON_NONE);
|
|
uiItemR(col, ptr, "speed", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
|
}
|
|
|
|
static void texture_panel_draw(const bContext *C, Panel *panel)
|
|
{
|
|
uiLayout *col;
|
|
uiLayout *layout = panel->layout;
|
|
|
|
PointerRNA ob_ptr;
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr);
|
|
|
|
int texture_coords = RNA_enum_get(ptr, "texture_coords");
|
|
|
|
uiTemplateID(layout, C, ptr, "texture", "texture.new", NULL, NULL, 0, ICON_NONE, NULL);
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
col = uiLayoutColumn(layout, false);
|
|
uiItemR(col, ptr, "texture_coords", 0, IFACE_("Coordinates"), ICON_NONE);
|
|
if (texture_coords == MOD_DISP_MAP_OBJECT) {
|
|
uiItemR(col, ptr, "texture_coords_object", 0, IFACE_("Object"), ICON_NONE);
|
|
PointerRNA texture_coords_obj_ptr = RNA_pointer_get(ptr, "texture_coords_object");
|
|
if (!RNA_pointer_is_null(&texture_coords_obj_ptr) &&
|
|
(RNA_enum_get(&texture_coords_obj_ptr, "type") == OB_ARMATURE)) {
|
|
PointerRNA texture_coords_obj_data_ptr = RNA_pointer_get(&texture_coords_obj_ptr, "data");
|
|
uiItemPointerR(col,
|
|
ptr,
|
|
"texture_coords_bone",
|
|
&texture_coords_obj_data_ptr,
|
|
"bones",
|
|
IFACE_("Bone"),
|
|
ICON_NONE);
|
|
}
|
|
}
|
|
else if (texture_coords == MOD_DISP_MAP_UV && RNA_enum_get(&ob_ptr, "type") == OB_MESH) {
|
|
PointerRNA obj_data_ptr = RNA_pointer_get(&ob_ptr, "data");
|
|
uiItemPointerR(col, ptr, "uv_layer", &obj_data_ptr, "uv_layers", NULL, ICON_NONE);
|
|
}
|
|
}
|
|
|
|
static void panelRegister(ARegionType *region_type)
|
|
{
|
|
PanelType *panel_type = modifier_panel_register(region_type, eModifierType_Wave, panel_draw);
|
|
modifier_subpanel_register(
|
|
region_type, "position", "Start Position", NULL, position_panel_draw, panel_type);
|
|
modifier_subpanel_register(region_type, "time", "Time", NULL, time_panel_draw, panel_type);
|
|
modifier_subpanel_register(
|
|
region_type, "texture", "Texture", NULL, texture_panel_draw, panel_type);
|
|
}
|
|
|
|
ModifierTypeInfo modifierType_Wave = {
|
|
/* name */ "Wave",
|
|
/* structName */ "WaveModifierData",
|
|
/* structSize */ sizeof(WaveModifierData),
|
|
/* srna */ &RNA_WaveModifier,
|
|
/* type */ eModifierTypeType_OnlyDeform,
|
|
/* flags */ eModifierTypeFlag_AcceptsCVs | eModifierTypeFlag_AcceptsVertexCosOnly |
|
|
eModifierTypeFlag_SupportsEditmode,
|
|
/* icon */ ICON_MOD_WAVE,
|
|
|
|
/* copyData */ BKE_modifier_copydata_generic,
|
|
|
|
/* deformVerts */ deformVerts,
|
|
/* deformMatrices */ NULL,
|
|
/* deformVertsEM */ deformVertsEM,
|
|
/* deformMatricesEM */ NULL,
|
|
/* modifyMesh */ NULL,
|
|
/* modifyHair */ NULL,
|
|
/* modifyGeometrySet */ NULL,
|
|
|
|
/* initData */ initData,
|
|
/* requiredDataMask */ requiredDataMask,
|
|
/* freeData */ NULL,
|
|
/* isDisabled */ NULL,
|
|
/* updateDepsgraph */ updateDepsgraph,
|
|
/* dependsOnTime */ dependsOnTime,
|
|
/* dependsOnNormals */ dependsOnNormals,
|
|
/* foreachIDLink */ foreachIDLink,
|
|
/* foreachTexLink */ foreachTexLink,
|
|
/* freeRuntimeData */ NULL,
|
|
/* panelRegister */ panelRegister,
|
|
/* blendWrite */ NULL,
|
|
/* blendRead */ NULL,
|
|
};
|