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:56:24 +01:00
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
|
|
|
|
|
#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"
|
2018-05-11 10:55:26 +02:00
|
|
|
#include "DNA_mesh_types.h"
|
|
|
|
|
#include "DNA_meshdata_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_object_types.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "DNA_screen_types.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2011-12-24 03:03:42 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "BKE_context.h"
|
2012-10-22 15:39:06 +00:00
|
|
|
#include "BKE_deform.h"
|
2018-05-11 10:55:26 +02:00
|
|
|
#include "BKE_mesh.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"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2018-12-20 11:17:45 +01:00
|
|
|
#include "DEG_depsgraph_query.h"
|
|
|
|
|
|
2012-10-22 02:39:26 +00:00
|
|
|
#include "bmesh.h"
|
2013-08-23 04:22:07 +00:00
|
|
|
#include "bmesh_tools.h"
|
2012-10-19 10:40:32 +00:00
|
|
|
|
2012-10-22 03:25:53 +00:00
|
|
|
// #define USE_TIMEIT
|
|
|
|
|
|
2012-10-22 02:09:41 +00:00
|
|
|
#ifdef USE_TIMEIT
|
|
|
|
|
# include "PIL_time.h"
|
2013-09-03 21:22:43 +00:00
|
|
|
# include "PIL_time_utildefines.h"
|
2012-10-22 02:09:41 +00:00
|
|
|
#endif
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "MOD_ui_common.h"
|
2011-02-13 14:16:36 +00:00
|
|
|
#include "MOD_util.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
|
|
|
|
static void initData(ModifierData *md)
|
|
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
DecimateModifierData *dmd = (DecimateModifierData *)md;
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2020-10-01 09:38:00 -05:00
|
|
|
BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(dmd, modifier));
|
|
|
|
|
|
|
|
|
|
MEMCPY_STRUCT_AFTER(dmd, DNA_struct_default_get(DecimateModifierData), modifier);
|
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)
|
2012-10-22 15:39:06 +00:00
|
|
|
{
|
|
|
|
|
DecimateModifierData *dmd = (DecimateModifierData *)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 (dmd->defgrp_name[0] != '\0' && (dmd->defgrp_factor > 0.0f)) {
|
|
|
|
|
r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT;
|
2015-06-04 19:49:59 +10:00
|
|
|
}
|
2012-10-22 15:39:06 +00:00
|
|
|
}
|
|
|
|
|
|
2018-12-20 11:17:45 +01:00
|
|
|
static DecimateModifierData *getOriginalModifierData(const DecimateModifierData *dmd,
|
|
|
|
|
const ModifierEvalContext *ctx)
|
|
|
|
|
{
|
|
|
|
|
Object *ob_orig = DEG_get_original_object(ctx->object);
|
2020-05-25 11:39:52 +02:00
|
|
|
return (DecimateModifierData *)BKE_modifiers_findby_name(ob_orig, dmd->modifier.name);
|
2018-12-20 11:17:45 +01:00
|
|
|
}
|
|
|
|
|
|
2019-01-22 19:49:44 +01:00
|
|
|
static void updateFaceCount(const ModifierEvalContext *ctx,
|
|
|
|
|
DecimateModifierData *dmd,
|
|
|
|
|
int face_count)
|
2018-12-21 16:53:33 +01:00
|
|
|
{
|
2019-01-22 19:49:44 +01:00
|
|
|
dmd->face_count = face_count;
|
|
|
|
|
|
2018-12-21 16:53:33 +01:00
|
|
|
if (DEG_is_active(ctx->depsgraph)) {
|
|
|
|
|
/* update for display only */
|
|
|
|
|
DecimateModifierData *dmd_orig = getOriginalModifierData(dmd, ctx);
|
|
|
|
|
dmd_orig->face_count = face_count;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-04-21 13:09:41 +02:00
|
|
|
static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *meshData)
|
2012-10-19 10:40:32 +00:00
|
|
|
{
|
|
|
|
|
DecimateModifierData *dmd = (DecimateModifierData *)md;
|
2018-05-11 10:55:26 +02:00
|
|
|
Mesh *mesh = meshData, *result = NULL;
|
2012-10-19 10:40:32 +00:00
|
|
|
BMesh *bm;
|
2022-03-22 09:33:50 -05:00
|
|
|
bool calc_vert_normal;
|
2013-06-02 23:20:49 +00:00
|
|
|
bool calc_face_normal;
|
2012-10-22 15:39:06 +00:00
|
|
|
float *vweights = NULL;
|
|
|
|
|
|
2012-10-22 02:09:41 +00:00
|
|
|
#ifdef USE_TIMEIT
|
2012-10-23 06:37:58 +00:00
|
|
|
TIMEIT_START(decim);
|
2012-10-22 02:09:41 +00:00
|
|
|
#endif
|
2012-10-20 17:31:07 +00:00
|
|
|
|
2021-03-18 09:35:12 +11:00
|
|
|
/* Set up front so we don't show invalid info in the UI. */
|
2018-12-21 16:53:33 +01:00
|
|
|
updateFaceCount(ctx, dmd, mesh->totpoly);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-10-23 06:37:58 +00:00
|
|
|
switch (dmd->mode) {
|
|
|
|
|
case MOD_DECIM_MODE_COLLAPSE:
|
|
|
|
|
if (dmd->percent == 1.0f) {
|
2018-05-11 10:55:26 +02:00
|
|
|
return mesh;
|
2012-10-23 06:37:58 +00:00
|
|
|
}
|
2013-06-02 23:20:49 +00:00
|
|
|
calc_face_normal = true;
|
2022-03-22 09:33:50 -05:00
|
|
|
calc_vert_normal = true;
|
2012-10-23 06:37:58 +00:00
|
|
|
break;
|
|
|
|
|
case MOD_DECIM_MODE_UNSUBDIV:
|
|
|
|
|
if (dmd->iter == 0) {
|
2018-05-11 10:55:26 +02:00
|
|
|
return mesh;
|
2012-10-23 06:37:58 +00:00
|
|
|
}
|
2013-06-02 23:20:49 +00:00
|
|
|
calc_face_normal = false;
|
2022-03-22 09:33:50 -05:00
|
|
|
calc_vert_normal = false;
|
2012-10-23 06:37:58 +00:00
|
|
|
break;
|
|
|
|
|
case MOD_DECIM_MODE_DISSOLVE:
|
|
|
|
|
if (dmd->angle == 0.0f) {
|
2018-05-11 10:55:26 +02:00
|
|
|
return mesh;
|
2012-10-23 06:37:58 +00:00
|
|
|
}
|
2013-06-02 23:20:49 +00:00
|
|
|
calc_face_normal = true;
|
2022-03-22 09:33:50 -05:00
|
|
|
calc_vert_normal = false;
|
2012-10-23 06:37:58 +00:00
|
|
|
break;
|
2013-08-06 03:45:11 +00:00
|
|
|
default:
|
2018-05-11 10:55:26 +02:00
|
|
|
return mesh;
|
2012-10-20 17:31:07 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-10-23 16:21:55 +00:00
|
|
|
if (dmd->face_count <= 3) {
|
2020-10-26 17:07:58 +11:00
|
|
|
BKE_modifier_set_error(ctx->object, md, "Modifier requires more than 3 input faces");
|
2018-05-11 10:55:26 +02:00
|
|
|
return mesh;
|
2012-10-20 17:31:07 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-10-23 04:26:39 +00:00
|
|
|
if (dmd->mode == MOD_DECIM_MODE_COLLAPSE) {
|
2015-06-04 19:49:59 +10:00
|
|
|
if (dmd->defgrp_name[0] && (dmd->defgrp_factor > 0.0f)) {
|
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;
|
2012-10-23 04:26:39 +00:00
|
|
|
int defgrp_index;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-29 19:02:19 +02:00
|
|
|
MOD_get_vgroup(ctx->object, mesh, dmd->defgrp_name, &dvert, &defgrp_index);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-10-23 04:26:39 +00:00
|
|
|
if (dvert) {
|
2019-09-19 13:32:36 +10:00
|
|
|
const uint vert_tot = mesh->totvert;
|
|
|
|
|
uint i;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-01-14 22:14:20 +01:00
|
|
|
vweights = MEM_malloc_arrayN(vert_tot, sizeof(float), __func__);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-10-23 04:26:39 +00:00
|
|
|
if (dmd->flag & MOD_DECIM_FLAG_INVERT_VGROUP) {
|
|
|
|
|
for (i = 0; i < vert_tot; i++) {
|
2020-03-06 12:50:56 +11:00
|
|
|
vweights[i] = 1.0f - BKE_defvert_find_weight(&dvert[i], defgrp_index);
|
2012-10-23 04:26:39 +00:00
|
|
|
}
|
2012-10-22 15:39:06 +00:00
|
|
|
}
|
2012-10-23 04:26:39 +00:00
|
|
|
else {
|
|
|
|
|
for (i = 0; i < vert_tot; i++) {
|
2020-03-06 12:50:56 +11:00
|
|
|
vweights[i] = BKE_defvert_find_weight(&dvert[i], defgrp_index);
|
2012-10-22 15:39:06 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
|
2018-05-11 10:55:26 +02:00
|
|
|
bm = BKE_mesh_to_bmesh_ex(mesh,
|
2018-10-23 13:50:43 +11:00
|
|
|
&(struct BMeshCreateParams){0},
|
|
|
|
|
&(struct BMeshFromMeshParams){
|
|
|
|
|
.calc_face_normal = calc_face_normal,
|
2022-03-22 09:33:50 -05:00
|
|
|
.calc_vert_normal = calc_vert_normal,
|
2019-03-08 17:16:30 +11:00
|
|
|
.cd_mask_extra = {.vmask = CD_MASK_ORIGINDEX,
|
|
|
|
|
.emask = CD_MASK_ORIGINDEX,
|
|
|
|
|
.pmask = CD_MASK_ORIGINDEX},
|
2018-10-23 13:50:43 +11:00
|
|
|
});
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-10-23 04:26:39 +00:00
|
|
|
switch (dmd->mode) {
|
|
|
|
|
case MOD_DECIM_MODE_COLLAPSE: {
|
2015-04-20 23:37:04 +10:00
|
|
|
const bool do_triangulate = (dmd->flag & MOD_DECIM_FLAG_TRIANGULATE) != 0;
|
2015-11-18 07:50:07 +11:00
|
|
|
const int symmetry_axis = (dmd->flag & MOD_DECIM_FLAG_SYMMETRY) ? dmd->symmetry_axis : -1;
|
|
|
|
|
const float symmetry_eps = 0.00002f;
|
|
|
|
|
BM_mesh_decimate_collapse(bm,
|
|
|
|
|
dmd->percent,
|
|
|
|
|
vweights,
|
|
|
|
|
dmd->defgrp_factor,
|
|
|
|
|
do_triangulate,
|
|
|
|
|
symmetry_axis,
|
|
|
|
|
symmetry_eps);
|
2012-10-23 04:26:39 +00:00
|
|
|
break;
|
2012-10-23 06:13:56 +00:00
|
|
|
}
|
2012-10-23 04:26:39 +00:00
|
|
|
case MOD_DECIM_MODE_UNSUBDIV: {
|
|
|
|
|
BM_mesh_decimate_unsubdivide(bm, dmd->iter);
|
|
|
|
|
break;
|
2012-10-23 06:13:56 +00:00
|
|
|
}
|
2012-10-23 05:20:02 +00:00
|
|
|
case MOD_DECIM_MODE_DISSOLVE: {
|
2015-04-20 23:37:04 +10:00
|
|
|
const bool do_dissolve_boundaries = (dmd->flag & MOD_DECIM_FLAG_ALL_BOUNDARY_VERTS) != 0;
|
2013-06-03 05:07:16 +00:00
|
|
|
BM_mesh_decimate_dissolve(bm, dmd->angle, do_dissolve_boundaries, (BMO_Delimit)dmd->delimit);
|
2012-10-23 05:20:02 +00:00
|
|
|
break;
|
2012-10-23 04:26:39 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
|
2012-10-22 15:39:06 +00:00
|
|
|
if (vweights) {
|
|
|
|
|
MEM_freeN(vweights);
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-12-21 16:53:33 +01:00
|
|
|
updateFaceCount(ctx, dmd, bm->totface);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-07-10 14:41:19 +10:00
|
|
|
/* make sure we never alloc'd these */
|
|
|
|
|
BLI_assert(bm->vtoolflagpool == NULL && bm->etoolflagpool == NULL && bm->ftoolflagpool == NULL);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Mesh: Move hide flags to generic attributes
This commit moves the hide status of mesh vertices, edges, and faces
from the `ME_FLAG` to optional generic boolean attributes. Storing this
data as generic attributes can significantly simplify and improve code,
as described in T95965.
The attributes are called `.hide_vert`, `.hide_edge`, and `.hide_poly`,
using the attribute name semantics discussed in T97452. The `.` prefix
means they are "UI attributes", so they still contain original data
edited by users, but they aren't meant to be accessed procedurally by
the user in arbitrary situations. They are also be hidden in the
spreadsheet and the attribute list by default,
Until 4.0, the attributes are still written to and read from the mesh
in the old way, so neither forward nor backward compatibility are
affected. This means memory requirements will be increased by one byte
per element when the hide status is used. When the flags are removed
completely, requirements will decrease when hiding is unused.
Further notes:
* Some code can be further simplified to skip some processing when the
hide attributes don't exist.
* The data is still stored in flags for `BMesh`, necessitating some
complexity in the conversion to and from `Mesh`.
* Access to the "hide" property of mesh elements in RNA is slower.
The separate boolean arrays should be used where possible.
Ref T95965
Differential Revision: https://developer.blender.org/D14685
2022-08-11 12:54:24 -04:00
|
|
|
result = BKE_mesh_from_bmesh_for_eval_nomain(bm, NULL, mesh);
|
|
|
|
|
|
2012-10-24 07:24:11 +00:00
|
|
|
BM_mesh_free(bm);
|
2012-10-19 10:40:32 +00:00
|
|
|
|
2012-10-22 02:09:41 +00:00
|
|
|
#ifdef USE_TIMEIT
|
2012-10-24 07:24:11 +00:00
|
|
|
TIMEIT_END(decim);
|
2012-10-22 02:09:41 +00:00
|
|
|
#endif
|
2012-10-20 17:31:07 +00:00
|
|
|
|
2012-10-19 10:40:32 +00:00
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
static void panel_draw(const bContext *UNUSED(C), Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *sub, *row;
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
int decimate_type = RNA_enum_get(ptr, "decimate_type");
|
2021-11-02 17:50:18 +01:00
|
|
|
char count_info[64];
|
|
|
|
|
snprintf(count_info, 32, TIP_("Face Count: %d"), RNA_int_get(ptr, "face_count"));
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-10-16 16:02:37 -05:00
|
|
|
uiItemR(layout, ptr, "decimate_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
if (decimate_type == MOD_DECIM_MODE_COLLAPSE) {
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "ratio", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-06-22 15:06:13 +02:00
|
|
|
row = uiLayoutRowWithHeading(layout, true, IFACE_("Symmetry"));
|
2020-06-05 10:41:03 -04:00
|
|
|
uiLayoutSetPropDecorate(row, false);
|
|
|
|
|
sub = uiLayoutRow(row, true);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(sub, ptr, "use_symmetry", 0, "", ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
sub = uiLayoutRow(sub, true);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_symmetry"));
|
|
|
|
|
uiItemR(sub, ptr, "symmetry_axis", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
|
|
|
|
|
uiItemDecoratorR(row, ptr, "symmetry_axis", 0);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "use_collapse_triangulate", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL);
|
2020-09-07 15:34:32 -05:00
|
|
|
sub = uiLayoutRow(layout, true);
|
|
|
|
|
bool has_vertex_group = RNA_string_length(ptr, "vertex_group") != 0;
|
|
|
|
|
uiLayoutSetActive(sub, has_vertex_group);
|
|
|
|
|
uiItemR(sub, ptr, "vertex_group_factor", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
else if (decimate_type == MOD_DECIM_MODE_UNSUBDIV) {
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "iterations", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
else { /* decimate_type == MOD_DECIM_MODE_DISSOLVE. */
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "angle_limit", 0, NULL, ICON_NONE);
|
2020-10-16 16:02:37 -05:00
|
|
|
uiLayout *col = uiLayoutColumn(layout, false);
|
|
|
|
|
uiItemR(col, ptr, "delimit", 0, NULL, ICON_NONE);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "use_dissolve_boundaries", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
uiItemL(layout, count_info, ICON_NONE);
|
|
|
|
|
|
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_Decimate, panel_draw);
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
ModifierTypeInfo modifierType_Decimate = {
|
2023-01-16 12:41:11 +11:00
|
|
|
/*name*/ N_("Decimate"),
|
|
|
|
|
/*structName*/ "DecimateModifierData",
|
|
|
|
|
/*structSize*/ sizeof(DecimateModifierData),
|
|
|
|
|
/*srna*/ &RNA_DecimateModifier,
|
|
|
|
|
/*type*/ eModifierTypeType_Nonconstructive,
|
|
|
|
|
/*flags*/ eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_AcceptsCVs,
|
|
|
|
|
/*icon*/ ICON_MOD_DECIM,
|
|
|
|
|
|
|
|
|
|
/*copyData*/ BKE_modifier_copydata_generic,
|
|
|
|
|
|
|
|
|
|
/*deformVerts*/ NULL,
|
|
|
|
|
/*deformMatrices*/ NULL,
|
|
|
|
|
/*deformVertsEM*/ NULL,
|
|
|
|
|
/*deformMatricesEM*/ NULL,
|
|
|
|
|
/*modifyMesh*/ modifyMesh,
|
|
|
|
|
/*modifyGeometrySet*/ NULL,
|
|
|
|
|
|
|
|
|
|
/*initData*/ initData,
|
|
|
|
|
/*requiredDataMask*/ requiredDataMask,
|
|
|
|
|
/*freeData*/ NULL,
|
|
|
|
|
/*isDisabled*/ NULL,
|
|
|
|
|
/*updateDepsgraph*/ NULL,
|
|
|
|
|
/*dependsOnTime*/ NULL,
|
|
|
|
|
/*dependsOnNormals*/ NULL,
|
|
|
|
|
/*foreachIDLink*/ NULL,
|
|
|
|
|
/*foreachTexLink*/ NULL,
|
|
|
|
|
/*freeRuntimeData*/ NULL,
|
|
|
|
|
/*panelRegister*/ panelRegister,
|
|
|
|
|
/*blendWrite*/ NULL,
|
|
|
|
|
/*blendRead*/ NULL,
|
2010-04-11 22:12:30 +00:00
|
|
|
};
|