2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2005 Blender Foundation. All rights reserved. */
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup modifiers
|
2011-02-25 13:57:17 +00:00
|
|
|
*/
|
|
|
|
|
|
2019-02-25 11:39:14 +01:00
|
|
|
#include "MEM_guardedalloc.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2011-01-07 18:36:47 +00:00
|
|
|
#include "BLI_utildefines.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2019-02-25 11:39:14 +01:00
|
|
|
#include "BLI_math.h"
|
|
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "BLT_translation.h"
|
|
|
|
|
|
2020-10-01 09:38:00 -05:00
|
|
|
#include "DNA_defaults.h"
|
2019-02-25 11:39:14 +01:00
|
|
|
#include "DNA_mesh_types.h"
|
|
|
|
|
#include "DNA_meshdata_types.h"
|
2020-12-15 10:47:58 +11:00
|
|
|
#include "DNA_object_types.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "DNA_screen_types.h"
|
2011-12-24 03:03:42 +00:00
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "BKE_context.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "BKE_deform.h"
|
2018-05-08 16:42:01 +02:00
|
|
|
#include "BKE_editmesh.h"
|
2020-02-10 12:58:59 +01:00
|
|
|
#include "BKE_lib_id.h"
|
2023-03-12 22:29:15 +01:00
|
|
|
#include "BKE_mesh.hh"
|
2020-06-10 22:32:06 +10:00
|
|
|
#include "BKE_mesh_wrapper.h"
|
2016-12-28 17:30:58 +01:00
|
|
|
#include "BKE_particle.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "BKE_screen.h"
|
|
|
|
|
|
|
|
|
|
#include "UI_interface.h"
|
|
|
|
|
#include "UI_resources.h"
|
|
|
|
|
|
|
|
|
|
#include "RNA_access.h"
|
2022-03-14 16:54:46 +01:00
|
|
|
#include "RNA_prototypes.h"
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
#include "MOD_modifiertypes.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "MOD_ui_common.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
#include "MOD_util.h"
|
|
|
|
|
|
|
|
|
|
static void initData(ModifierData *md)
|
|
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
SmoothModifierData *smd = (SmoothModifierData *)md;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2020-10-01 09:38:00 -05:00
|
|
|
BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(smd, modifier));
|
|
|
|
|
|
|
|
|
|
MEMCPY_STRUCT_AFTER(smd, DNA_struct_default_get(SmoothModifierData), modifier);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
2023-03-01 17:32:12 +01:00
|
|
|
static bool isDisabled(const Scene * /*scene*/, ModifierData *md, bool /*useRenderParams*/)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
SmoothModifierData *smd = (SmoothModifierData *)md;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2019-09-25 21:44:39 +02:00
|
|
|
const short flag = smd->flag & (MOD_SMOOTH_X | MOD_SMOOTH_Y | MOD_SMOOTH_Z);
|
2010-04-11 22:12:30 +00:00
|
|
|
|
|
|
|
|
/* disable if modifier is off for X, Y and Z or if factor is 0 */
|
2019-09-25 21:44:39 +02:00
|
|
|
if (smd->fac == 0.0f || flag == 0) {
|
|
|
|
|
return true;
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2019-09-25 21:44:39 +02:00
|
|
|
return false;
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
2022-09-14 14:49:40 -05:00
|
|
|
static void requiredDataMask(ModifierData *md, CustomData_MeshMasks *r_cddata_masks)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
|
|
|
|
SmoothModifierData *smd = (SmoothModifierData *)md;
|
|
|
|
|
|
|
|
|
|
/* ask for vertexgroups if we need them */
|
Refactor CDData masks, to have one mask per mesh elem type.
We already have different storages for cddata of verts, edges etc.,
'simply' do the same for the mask flags we use all around Blender code
to request some data, or limit some operation to some layers, etc.
Reason we need this is that some cddata types (like Normals) are
actually shared between verts/polys/loops, and we don’t want to generate
clnors everytime we request vnors!
As a side note, this also does final fix to T59338, which was the
trigger for this patch (need to request computed loop normals for
another mesh than evaluated one).
Reviewers: brecht, campbellbarton, sergey
Differential Revision: https://developer.blender.org/D4407
2019-03-07 11:13:40 +01:00
|
|
|
if (smd->defgrp_name[0] != '\0') {
|
|
|
|
|
r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT;
|
|
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void smoothModifier_do(
|
2022-03-28 12:29:47 +11:00
|
|
|
SmoothModifierData *smd, Object *ob, Mesh *mesh, float (*vertexCos)[3], int verts_num)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2023-03-01 17:32:12 +01:00
|
|
|
if (mesh == nullptr) {
|
2019-09-25 21:44:39 +02:00
|
|
|
return;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-03-01 17:32:12 +01:00
|
|
|
float(*accumulated_vecs)[3] = static_cast<float(*)[3]>(
|
2023-03-03 16:22:49 +11:00
|
|
|
MEM_calloc_arrayN(size_t(verts_num), sizeof(*accumulated_vecs), __func__));
|
2019-09-25 21:44:39 +02:00
|
|
|
if (!accumulated_vecs) {
|
2010-04-11 22:12:30 +00:00
|
|
|
return;
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2019-09-25 21:44:39 +02:00
|
|
|
|
2023-03-01 17:32:12 +01:00
|
|
|
uint *accumulated_vecs_count = static_cast<uint *>(
|
2023-03-03 16:22:49 +11:00
|
|
|
MEM_calloc_arrayN(size_t(verts_num), sizeof(*accumulated_vecs_count), __func__));
|
2022-03-28 12:29:47 +11:00
|
|
|
if (!accumulated_vecs_count) {
|
2021-01-04 14:02:58 +11:00
|
|
|
MEM_freeN(accumulated_vecs);
|
2010-04-11 22:12:30 +00:00
|
|
|
return;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-25 21:44:39 +02:00
|
|
|
const float fac_new = smd->fac;
|
|
|
|
|
const float fac_orig = 1.0f - fac_new;
|
2020-02-06 11:52:24 +01:00
|
|
|
const bool invert_vgroup = (smd->flag & MOD_SMOOTH_INVERT_VGROUP) != 0;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-03-01 12:47:55 -05:00
|
|
|
const blender::Span<MEdge> edges = mesh->edges();
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Mesh: Remove redundant custom data pointers
For copy-on-write, we want to share attribute arrays between meshes
where possible. Mutable pointers like `Mesh.mvert` make that difficult
by making ownership vague. They also make code more complex by adding
redundancy.
The simplest solution is just removing them and retrieving layers from
`CustomData` as needed. Similar changes have already been applied to
curves and point clouds (e9f82d3dc7ee, 410a6efb747f). Removing use of
the pointers generally makes code more obvious and more reusable.
Mesh data is now accessed with a C++ API (`Mesh::edges()` or
`Mesh::edges_for_write()`), and a C API (`BKE_mesh_edges(mesh)`).
The CoW changes this commit makes possible are described in T95845
and T95842, and started in D14139 and D14140. The change also simplifies
the ongoing mesh struct-of-array refactors from T95965.
**RNA/Python Access Performance**
Theoretically, accessing mesh elements with the RNA API may become
slower, since the layer needs to be found on every random access.
However, overhead is already high enough that this doesn't make a
noticible differenc, and performance is actually improved in some
cases. Random access can be up to 10% faster, but other situations
might be a bit slower. Generally using `foreach_get/set` are the best
way to improve performance. See the differential revision for more
discussion about Python performance.
Cycles has been updated to use raw pointers and the internal Blender
mesh types, mostly because there is no sense in having this overhead
when it's already compiled with Blender. In my tests this roughly
halves the Cycles mesh creation time (0.19s to 0.10s for a 1 million
face grid).
Differential Revision: https://developer.blender.org/D15488
2022-09-05 11:56:34 -05:00
|
|
|
const MDeformVert *dvert;
|
2019-09-25 21:44:39 +02:00
|
|
|
int defgrp_index;
|
2018-06-29 19:02:19 +02:00
|
|
|
MOD_get_vgroup(ob, mesh, smd->defgrp_name, &dvert, &defgrp_index);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-25 21:44:39 +02:00
|
|
|
for (int j = 0; j < smd->repeat; j++) {
|
|
|
|
|
if (j != 0) {
|
2023-03-03 16:22:49 +11:00
|
|
|
memset(accumulated_vecs, 0, sizeof(*accumulated_vecs) * size_t(verts_num));
|
|
|
|
|
memset(accumulated_vecs_count, 0, sizeof(*accumulated_vecs_count) * size_t(verts_num));
|
2019-09-25 21:44:39 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-03-02 16:23:17 +13:00
|
|
|
for (const int i : edges.index_range()) {
|
2019-09-25 21:44:39 +02:00
|
|
|
float fvec[3];
|
2023-03-01 12:47:55 -05:00
|
|
|
const uint idx1 = edges[i].v1;
|
|
|
|
|
const uint idx2 = edges[i].v2;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-25 21:44:39 +02:00
|
|
|
mid_v3_v3v3(fvec, vertexCos[idx1], vertexCos[idx2]);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-03-28 12:29:47 +11:00
|
|
|
accumulated_vecs_count[idx1]++;
|
2019-09-25 21:44:39 +02:00
|
|
|
add_v3_v3(accumulated_vecs[idx1], fvec);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2022-03-28 12:29:47 +11:00
|
|
|
accumulated_vecs_count[idx2]++;
|
2019-09-25 21:44:39 +02:00
|
|
|
add_v3_v3(accumulated_vecs[idx2], fvec);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-25 21:44:39 +02:00
|
|
|
const short flag = smd->flag;
|
2010-04-11 22:12:30 +00:00
|
|
|
if (dvert) {
|
Mesh: Remove redundant custom data pointers
For copy-on-write, we want to share attribute arrays between meshes
where possible. Mutable pointers like `Mesh.mvert` make that difficult
by making ownership vague. They also make code more complex by adding
redundancy.
The simplest solution is just removing them and retrieving layers from
`CustomData` as needed. Similar changes have already been applied to
curves and point clouds (e9f82d3dc7ee, 410a6efb747f). Removing use of
the pointers generally makes code more obvious and more reusable.
Mesh data is now accessed with a C++ API (`Mesh::edges()` or
`Mesh::edges_for_write()`), and a C API (`BKE_mesh_edges(mesh)`).
The CoW changes this commit makes possible are described in T95845
and T95842, and started in D14139 and D14140. The change also simplifies
the ongoing mesh struct-of-array refactors from T95965.
**RNA/Python Access Performance**
Theoretically, accessing mesh elements with the RNA API may become
slower, since the layer needs to be found on every random access.
However, overhead is already high enough that this doesn't make a
noticible differenc, and performance is actually improved in some
cases. Random access can be up to 10% faster, but other situations
might be a bit slower. Generally using `foreach_get/set` are the best
way to improve performance. See the differential revision for more
discussion about Python performance.
Cycles has been updated to use raw pointers and the internal Blender
mesh types, mostly because there is no sense in having this overhead
when it's already compiled with Blender. In my tests this roughly
halves the Cycles mesh creation time (0.19s to 0.10s for a 1 million
face grid).
Differential Revision: https://developer.blender.org/D15488
2022-09-05 11:56:34 -05:00
|
|
|
const MDeformVert *dv = dvert;
|
2022-03-28 12:29:47 +11:00
|
|
|
for (int i = 0; i < verts_num; i++, dv++) {
|
2019-09-25 21:44:39 +02:00
|
|
|
float *vco_orig = vertexCos[i];
|
2022-03-28 12:29:47 +11:00
|
|
|
if (accumulated_vecs_count[i] > 0) {
|
2023-03-01 17:32:12 +01:00
|
|
|
mul_v3_fl(accumulated_vecs[i], 1.0f / float(accumulated_vecs_count[i]));
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2019-09-25 21:44:39 +02:00
|
|
|
float *vco_new = accumulated_vecs[i];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-01-31 09:54:28 +01:00
|
|
|
const float f_vgroup = invert_vgroup ? (1.0f - BKE_defvert_find_weight(dv, defgrp_index)) :
|
|
|
|
|
BKE_defvert_find_weight(dv, defgrp_index);
|
|
|
|
|
if (f_vgroup <= 0.0f) {
|
2019-09-25 21:44:39 +02:00
|
|
|
continue;
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2023-01-31 09:54:28 +01:00
|
|
|
const float f_new = f_vgroup * fac_new;
|
2019-09-25 21:44:39 +02:00
|
|
|
const float f_orig = 1.0f - f_new;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:15:10 +10:00
|
|
|
if (flag & MOD_SMOOTH_X) {
|
2019-09-25 21:44:39 +02:00
|
|
|
vco_orig[0] = f_orig * vco_orig[0] + f_new * vco_new[0];
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
|
|
|
|
if (flag & MOD_SMOOTH_Y) {
|
2019-09-25 21:44:39 +02:00
|
|
|
vco_orig[1] = f_orig * vco_orig[1] + f_new * vco_new[1];
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
|
|
|
|
if (flag & MOD_SMOOTH_Z) {
|
2019-09-25 21:44:39 +02:00
|
|
|
vco_orig[2] = f_orig * vco_orig[2] + f_new * vco_new[2];
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
else { /* no vertex group */
|
2022-03-28 12:29:47 +11:00
|
|
|
for (int i = 0; i < verts_num; i++) {
|
2019-09-25 21:44:39 +02:00
|
|
|
float *vco_orig = vertexCos[i];
|
2022-03-28 12:29:47 +11:00
|
|
|
if (accumulated_vecs_count[i] > 0) {
|
2023-03-01 17:32:12 +01:00
|
|
|
mul_v3_fl(accumulated_vecs[i], 1.0f / float(accumulated_vecs_count[i]));
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2019-09-25 21:44:39 +02:00
|
|
|
float *vco_new = accumulated_vecs[i];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:15:10 +10:00
|
|
|
if (flag & MOD_SMOOTH_X) {
|
2019-09-25 21:44:39 +02:00
|
|
|
vco_orig[0] = fac_orig * vco_orig[0] + fac_new * vco_new[0];
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
|
|
|
|
if (flag & MOD_SMOOTH_Y) {
|
2019-09-25 21:44:39 +02:00
|
|
|
vco_orig[1] = fac_orig * vco_orig[1] + fac_new * vco_new[1];
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
|
|
|
|
if (flag & MOD_SMOOTH_Z) {
|
2019-09-25 21:44:39 +02:00
|
|
|
vco_orig[2] = fac_orig * vco_orig[2] + fac_new * vco_new[2];
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-25 21:44:39 +02:00
|
|
|
MEM_freeN(accumulated_vecs);
|
2022-03-28 12:29:47 +11:00
|
|
|
MEM_freeN(accumulated_vecs_count);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
2018-05-12 08:04:56 +02:00
|
|
|
static void deformVerts(ModifierData *md,
|
2018-05-12 08:21:07 +02:00
|
|
|
const ModifierEvalContext *ctx,
|
|
|
|
|
Mesh *mesh,
|
|
|
|
|
float (*vertexCos)[3],
|
2022-03-28 12:29:47 +11:00
|
|
|
int verts_num)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2018-11-27 14:26:43 +01:00
|
|
|
SmoothModifierData *smd = (SmoothModifierData *)md;
|
2023-03-01 17:32:12 +01:00
|
|
|
Mesh *mesh_src = nullptr;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2018-11-27 20:10:41 +01:00
|
|
|
/* mesh_src is needed for vgroups, and taking edges into account. */
|
2023-03-01 17:32:12 +01:00
|
|
|
mesh_src = MOD_deform_mesh_eval_get(ctx->object, nullptr, mesh, nullptr, verts_num, false);
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2022-03-28 12:29:47 +11:00
|
|
|
smoothModifier_do(smd, ctx->object, mesh_src, vertexCos, verts_num);
|
2018-05-08 16:42:01 +02:00
|
|
|
|
2023-03-01 17:32:12 +01:00
|
|
|
if (!ELEM(mesh_src, nullptr, mesh)) {
|
|
|
|
|
BKE_id_free(nullptr, mesh_src);
|
2018-11-27 14:26:43 +01:00
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void deformVertsEM(ModifierData *md,
|
2018-05-01 17:33:04 +02:00
|
|
|
const ModifierEvalContext *ctx,
|
2023-03-01 17:32:12 +01:00
|
|
|
BMEditMesh *editData,
|
2018-05-08 16:42:01 +02:00
|
|
|
Mesh *mesh,
|
|
|
|
|
float (*vertexCos)[3],
|
2022-03-28 12:29:47 +11:00
|
|
|
int verts_num)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2018-11-27 14:26:43 +01:00
|
|
|
SmoothModifierData *smd = (SmoothModifierData *)md;
|
2023-03-01 17:32:12 +01:00
|
|
|
Mesh *mesh_src = nullptr;
|
2018-05-08 16:42:01 +02:00
|
|
|
|
2018-11-27 20:10:41 +01:00
|
|
|
/* mesh_src is needed for vgroups, and taking edges into account. */
|
2023-03-01 17:32:12 +01:00
|
|
|
mesh_src = MOD_deform_mesh_eval_get(ctx->object, editData, mesh, nullptr, verts_num, false);
|
2018-05-08 16:42:01 +02:00
|
|
|
|
2023-02-09 11:30:25 +11:00
|
|
|
/* TODO(@ideasman42): use edit-mode data only (remove this line). */
|
2020-05-25 20:16:42 +10:00
|
|
|
BKE_mesh_wrapper_ensure_mdata(mesh_src);
|
|
|
|
|
|
2022-03-28 12:29:47 +11:00
|
|
|
smoothModifier_do(smd, ctx->object, mesh_src, vertexCos, verts_num);
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2023-03-01 17:32:12 +01:00
|
|
|
if (!ELEM(mesh_src, nullptr, mesh)) {
|
|
|
|
|
BKE_id_free(nullptr, mesh_src);
|
2018-05-08 16:42:01 +02:00
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
2023-03-01 17:32:12 +01:00
|
|
|
static void panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *row, *col;
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
int toggles_flag = UI_ITEM_R_TOGGLE | UI_ITEM_R_FORCE_BLANK_DECORATE;
|
|
|
|
|
|
|
|
|
|
PointerRNA ob_ptr;
|
2020-09-02 14:13:26 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, &ob_ptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
|
|
|
|
row = uiLayoutRowWithHeading(layout, true, IFACE_("Axis"));
|
2023-03-01 17:32:12 +01:00
|
|
|
uiItemR(row, ptr, "use_x", toggles_flag, nullptr, ICON_NONE);
|
|
|
|
|
uiItemR(row, ptr, "use_y", toggles_flag, nullptr, ICON_NONE);
|
|
|
|
|
uiItemR(row, ptr, "use_z", toggles_flag, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
col = uiLayoutColumn(layout, false);
|
2023-03-01 17:32:12 +01:00
|
|
|
uiItemR(col, ptr, "factor", 0, nullptr, ICON_NONE);
|
|
|
|
|
uiItemR(col, ptr, "iterations", 0, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-03-01 17:32:12 +01:00
|
|
|
modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
modifier_panel_end(layout, ptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void panelRegister(ARegionType *region_type)
|
|
|
|
|
{
|
|
|
|
|
modifier_panel_register(region_type, eModifierType_Smooth, panel_draw);
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
ModifierTypeInfo modifierType_Smooth = {
|
2023-01-16 12:41:11 +11:00
|
|
|
/*name*/ N_("Smooth"),
|
|
|
|
|
/*structName*/ "SmoothModifierData",
|
|
|
|
|
/*structSize*/ sizeof(SmoothModifierData),
|
|
|
|
|
/*srna*/ &RNA_SmoothModifier,
|
|
|
|
|
/*type*/ eModifierTypeType_OnlyDeform,
|
|
|
|
|
/*flags*/ eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_AcceptsCVs |
|
2012-05-06 13:38:33 +00:00
|
|
|
eModifierTypeFlag_SupportsEditmode,
|
2023-01-16 12:41:11 +11:00
|
|
|
/*icon*/ ICON_MOD_SMOOTH,
|
|
|
|
|
|
|
|
|
|
/*copyData*/ BKE_modifier_copydata_generic,
|
|
|
|
|
|
|
|
|
|
/*deformVerts*/ deformVerts,
|
2023-03-01 17:32:12 +01:00
|
|
|
/*deformMatrices*/ nullptr,
|
2023-01-16 12:41:11 +11:00
|
|
|
/*deformVertsEM*/ deformVertsEM,
|
2023-03-01 17:32:12 +01:00
|
|
|
/*deformMatricesEM*/ nullptr,
|
|
|
|
|
/*modifyMesh*/ nullptr,
|
|
|
|
|
/*modifyGeometrySet*/ nullptr,
|
2023-01-16 12:41:11 +11:00
|
|
|
|
|
|
|
|
/*initData*/ initData,
|
|
|
|
|
/*requiredDataMask*/ requiredDataMask,
|
2023-03-01 17:32:12 +01:00
|
|
|
/*freeData*/ nullptr,
|
2023-01-16 12:41:11 +11:00
|
|
|
/*isDisabled*/ isDisabled,
|
2023-03-01 17:32:12 +01:00
|
|
|
/*updateDepsgraph*/ nullptr,
|
|
|
|
|
/*dependsOnTime*/ nullptr,
|
|
|
|
|
/*dependsOnNormals*/ nullptr,
|
|
|
|
|
/*foreachIDLink*/ nullptr,
|
|
|
|
|
/*foreachTexLink*/ nullptr,
|
|
|
|
|
/*freeRuntimeData*/ nullptr,
|
2023-01-16 12:41:11 +11:00
|
|
|
/*panelRegister*/ panelRegister,
|
2023-03-01 17:32:12 +01:00
|
|
|
/*blendWrite*/ nullptr,
|
|
|
|
|
/*blendRead*/ nullptr,
|
2010-04-11 22:12:30 +00:00
|
|
|
};
|