2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2005 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
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
|
|
|
*/
|
|
|
|
|
|
2023-01-19 15:54:47 -06:00
|
|
|
#include <cstring>
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2019-02-25 11:39:14 +01:00
|
|
|
#include "BLI_utildefines.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"
|
2013-02-26 14:32:53 +00:00
|
|
|
#include "DNA_mesh_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-28 09:47:24 +00:00
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "BKE_context.h"
|
2016-12-28 17:30:58 +01:00
|
|
|
#include "BKE_particle.h"
|
2023-09-25 17:48:21 -04:00
|
|
|
#include "BKE_screen.hh"
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-08-05 02:57:52 +02:00
|
|
|
#include "UI_interface.hh"
|
|
|
|
|
#include "UI_resources.hh"
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2023-08-10 22:40:27 +02:00
|
|
|
#include "RNA_access.hh"
|
2022-03-14 16:54:46 +01:00
|
|
|
#include "RNA_prototypes.h"
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2023-05-04 18:35:37 +02:00
|
|
|
#include "MOD_modifiertypes.hh"
|
|
|
|
|
#include "MOD_ui_common.hh"
|
2019-11-03 14:24:24 +11:00
|
|
|
|
2023-01-19 15:54:47 -06:00
|
|
|
#include "MOD_solidify_util.hh"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static bool depends_on_normals(ModifierData *md)
|
2013-06-12 07:16:13 +00:00
|
|
|
{
|
2019-11-03 14:24:24 +11:00
|
|
|
const SolidifyModifierData *smd = (SolidifyModifierData *)md;
|
|
|
|
|
/* even when we calculate our own normals,
|
|
|
|
|
* the vertex normals are used as a fallback
|
|
|
|
|
* if manifold is enabled vertex normals are not used */
|
|
|
|
|
return smd->mode == MOD_SOLIDIFY_MODE_EXTRUDE;
|
2018-05-03 14:02:05 +02:00
|
|
|
}
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static void init_data(ModifierData *md)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
SolidifyModifierData *smd = (SolidifyModifierData *)md;
|
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(SolidifyModifierData), modifier);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
2012-05-23 06:25:31 +00:00
|
|
|
|
2020-10-01 09:38:00 -05:00
|
|
|
#ifdef __GNUC__
|
|
|
|
|
# pragma GCC diagnostic error "-Wsign-conversion"
|
|
|
|
|
#endif
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static void required_data_mask(ModifierData *md, CustomData_MeshMasks *r_cddata_masks)
|
2010-06-03 22:08:14 +00:00
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
SolidifyModifierData *smd = (SolidifyModifierData *)md;
|
2010-06-03 22:08:14 +00:00
|
|
|
|
2023-05-05 09:25:45 +10:00
|
|
|
/* Ask for vertex-groups if we need them. */
|
2020-03-27 10:56:14 +01:00
|
|
|
if (smd->defgrp_name[0] != '\0' || smd->shell_defgrp_name[0] != '\0' ||
|
|
|
|
|
smd->rim_defgrp_name[0] != '\0')
|
|
|
|
|
{
|
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
|
|
|
r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT;
|
|
|
|
|
}
|
2010-06-03 22:08:14 +00:00
|
|
|
}
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static Mesh *modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh)
|
2010-04-11 22:12:30 +00:00
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
const SolidifyModifierData *smd = (SolidifyModifierData *)md;
|
2020-03-24 16:25:30 +01:00
|
|
|
switch (smd->mode) {
|
|
|
|
|
case MOD_SOLIDIFY_MODE_EXTRUDE:
|
2020-04-21 13:09:41 +02:00
|
|
|
return MOD_solidify_extrude_modifyMesh(md, ctx, mesh);
|
2020-03-24 16:25:30 +01:00
|
|
|
case MOD_SOLIDIFY_MODE_NONMANIFOLD:
|
2020-04-21 13:09:41 +02:00
|
|
|
return MOD_solidify_nonmanifold_modifyMesh(md, ctx, mesh);
|
2020-03-24 16:25:30 +01:00
|
|
|
default:
|
2022-05-17 15:12:12 +02:00
|
|
|
BLI_assert_unreachable();
|
2014-08-15 17:26:39 +10:00
|
|
|
}
|
2019-11-03 14:24:24 +11:00
|
|
|
return mesh;
|
2013-06-02 04:09:29 +00:00
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2023-01-19 15:54:47 -06:00
|
|
|
static void panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *sub, *row, *col;
|
|
|
|
|
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 solidify_mode = RNA_enum_get(ptr, "solidify_mode");
|
|
|
|
|
bool has_vertex_group = RNA_string_length(ptr, "vertex_group") != 0;
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "solidify_mode", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
if (solidify_mode == MOD_SOLIDIFY_MODE_NONMANIFOLD) {
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout,
|
|
|
|
|
ptr,
|
|
|
|
|
"nonmanifold_thickness_mode",
|
|
|
|
|
UI_ITEM_NONE,
|
|
|
|
|
IFACE_("Thickness Mode"),
|
|
|
|
|
ICON_NONE);
|
|
|
|
|
uiItemR(layout, ptr, "nonmanifold_boundary_mode", UI_ITEM_NONE, IFACE_("Boundary"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "thickness", UI_ITEM_NONE, nullptr, ICON_NONE);
|
|
|
|
|
uiItemR(layout, ptr, "offset", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
if (solidify_mode == MOD_SOLIDIFY_MODE_NONMANIFOLD) {
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "nonmanifold_merge_threshold", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
2020-06-15 08:23:07 -04:00
|
|
|
else {
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "use_even_offset", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-15 08:23:07 -04:00
|
|
|
}
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2022-10-05 17:53:28 +02:00
|
|
|
col = uiLayoutColumnWithHeading(layout, false, CTX_IFACE_(BLT_I18NCONTEXT_ID_MESH, "Rim"));
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(col, ptr, "use_rim", UI_ITEM_NONE, IFACE_("Fill"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
sub = uiLayoutColumn(col, false);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_rim"));
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(sub, ptr, "use_rim_only", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiItemS(layout);
|
|
|
|
|
|
2023-01-19 15:54:47 -06:00
|
|
|
modifier_vgroup_ui(layout, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", nullptr);
|
2020-06-05 10:41:03 -04:00
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
|
uiLayoutSetActive(row, has_vertex_group);
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(row, ptr, "thickness_vertex_group", UI_ITEM_NONE, IFACE_("Factor"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
if (solidify_mode == MOD_SOLIDIFY_MODE_NONMANIFOLD) {
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
|
uiLayoutSetActive(row, has_vertex_group);
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(row, ptr, "use_flat_faces", UI_ITEM_NONE, nullptr, ICON_NONE);
|
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
|
|
|
}
|
|
|
|
|
|
2023-01-19 15:54:47 -06:00
|
|
|
static void normals_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
UI: Small Tweaks to Modifier Layouts for Consistency
These changes are smaller, made based on feedback and a pass on all
the layouts for clarity and consistency. The Multires modifier UI will
be addressed in a separate patch. Here is an overview of the changes:
Renaming Options:
- Build: "Start" -> "Start Frame"
- Curve: "From Radius" -> "Size from Radius"
- Screw: "Calc Order" -> "Calculate Order"
- Displace, Warp, Wave: "Texture Coordinates Object" -> "Object"
Move Mode Toggle to Top & Expand:
- Bevel, Boolean, Normal Edit, Subdivision
Use Columns for Tighter Spacing:
- Displace, Explode, Ocean, Particle Instance, Remesh, Shrinkwrap,
Solidify, Warp, Weighted Normal, Wave
Misc:
- Bevel: Set inactive properties for vertex bevel
- Mesh Sequence Cache: Remove box for cache file
- Skin: Don't align "Mark Loose" and "Clear Loose"
- Array: Expand relative offset subpanel by default
- Array: Move start cap, end cap to a new subpanel
- Bevel: Move width type above width
Differential Revision: https://developer.blender.org/D8115
2020-07-02 10:47:02 -04:00
|
|
|
uiLayout *col;
|
2020-06-05 10:41:03 -04:00
|
|
|
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 solidify_mode = RNA_enum_get(ptr, "solidify_mode");
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
UI: Small Tweaks to Modifier Layouts for Consistency
These changes are smaller, made based on feedback and a pass on all
the layouts for clarity and consistency. The Multires modifier UI will
be addressed in a separate patch. Here is an overview of the changes:
Renaming Options:
- Build: "Start" -> "Start Frame"
- Curve: "From Radius" -> "Size from Radius"
- Screw: "Calc Order" -> "Calculate Order"
- Displace, Warp, Wave: "Texture Coordinates Object" -> "Object"
Move Mode Toggle to Top & Expand:
- Bevel, Boolean, Normal Edit, Subdivision
Use Columns for Tighter Spacing:
- Displace, Explode, Ocean, Particle Instance, Remesh, Shrinkwrap,
Solidify, Warp, Weighted Normal, Wave
Misc:
- Bevel: Set inactive properties for vertex bevel
- Mesh Sequence Cache: Remove box for cache file
- Skin: Don't align "Mark Loose" and "Clear Loose"
- Array: Expand relative offset subpanel by default
- Array: Move start cap, end cap to a new subpanel
- Bevel: Move width type above width
Differential Revision: https://developer.blender.org/D8115
2020-07-02 10:47:02 -04:00
|
|
|
col = uiLayoutColumn(layout, false);
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(col, ptr, "use_flip_normals", UI_ITEM_NONE, IFACE_("Flip"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
if (solidify_mode == MOD_SOLIDIFY_MODE_EXTRUDE) {
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(col, ptr, "use_quality_normals", UI_ITEM_NONE, IFACE_("High Quality"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-19 15:54:47 -06:00
|
|
|
static void materials_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *col;
|
|
|
|
|
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
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(layout, ptr, "material_offset", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
col = uiLayoutColumn(layout, true);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiLayoutSetActive(col, RNA_boolean_get(ptr, "use_rim"));
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(col,
|
|
|
|
|
ptr,
|
|
|
|
|
"material_offset_rim",
|
|
|
|
|
UI_ITEM_NONE,
|
|
|
|
|
CTX_IFACE_(BLT_I18NCONTEXT_ID_MESH, "Rim"),
|
|
|
|
|
ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2023-01-19 15:54:47 -06:00
|
|
|
static void edge_data_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
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 solidify_mode = RNA_enum_get(ptr, "solidify_mode");
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
|
|
|
|
if (solidify_mode == MOD_SOLIDIFY_MODE_EXTRUDE) {
|
UI: Small Tweaks to Modifier Layouts for Consistency
These changes are smaller, made based on feedback and a pass on all
the layouts for clarity and consistency. The Multires modifier UI will
be addressed in a separate patch. Here is an overview of the changes:
Renaming Options:
- Build: "Start" -> "Start Frame"
- Curve: "From Radius" -> "Size from Radius"
- Screw: "Calc Order" -> "Calculate Order"
- Displace, Warp, Wave: "Texture Coordinates Object" -> "Object"
Move Mode Toggle to Top & Expand:
- Bevel, Boolean, Normal Edit, Subdivision
Use Columns for Tighter Spacing:
- Displace, Explode, Ocean, Particle Instance, Remesh, Shrinkwrap,
Solidify, Warp, Weighted Normal, Wave
Misc:
- Bevel: Set inactive properties for vertex bevel
- Mesh Sequence Cache: Remove box for cache file
- Skin: Don't align "Mark Loose" and "Clear Loose"
- Array: Expand relative offset subpanel by default
- Array: Move start cap, end cap to a new subpanel
- Bevel: Move width type above width
Differential Revision: https://developer.blender.org/D8115
2020-07-02 10:47:02 -04:00
|
|
|
uiLayout *col;
|
|
|
|
|
col = uiLayoutColumn(layout, true);
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(col, ptr, "edge_crease_inner", UI_ITEM_NONE, IFACE_("Crease Inner"), ICON_NONE);
|
|
|
|
|
uiItemR(col, ptr, "edge_crease_outer", UI_ITEM_NONE, IFACE_("Outer"), ICON_NONE);
|
|
|
|
|
uiItemR(col,
|
|
|
|
|
ptr,
|
|
|
|
|
"edge_crease_rim",
|
|
|
|
|
UI_ITEM_NONE,
|
|
|
|
|
CTX_IFACE_(BLT_I18NCONTEXT_ID_MESH, "Rim"),
|
|
|
|
|
ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
2023-01-19 15:54:47 -06:00
|
|
|
uiItemR(layout, ptr, "bevel_convex", UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2023-01-19 15:54:47 -06:00
|
|
|
static void clamp_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
UI: Small Tweaks to Modifier Layouts for Consistency
These changes are smaller, made based on feedback and a pass on all
the layouts for clarity and consistency. The Multires modifier UI will
be addressed in a separate patch. Here is an overview of the changes:
Renaming Options:
- Build: "Start" -> "Start Frame"
- Curve: "From Radius" -> "Size from Radius"
- Screw: "Calc Order" -> "Calculate Order"
- Displace, Warp, Wave: "Texture Coordinates Object" -> "Object"
Move Mode Toggle to Top & Expand:
- Bevel, Boolean, Normal Edit, Subdivision
Use Columns for Tighter Spacing:
- Displace, Explode, Ocean, Particle Instance, Remesh, Shrinkwrap,
Solidify, Warp, Weighted Normal, Wave
Misc:
- Bevel: Set inactive properties for vertex bevel
- Mesh Sequence Cache: Remove box for cache file
- Skin: Don't align "Mark Loose" and "Clear Loose"
- Array: Expand relative offset subpanel by default
- Array: Move start cap, end cap to a new subpanel
- Bevel: Move width type above width
Differential Revision: https://developer.blender.org/D8115
2020-07-02 10:47:02 -04:00
|
|
|
uiLayout *row, *col;
|
2020-06-05 10:41:03 -04:00
|
|
|
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
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
UI: Small Tweaks to Modifier Layouts for Consistency
These changes are smaller, made based on feedback and a pass on all
the layouts for clarity and consistency. The Multires modifier UI will
be addressed in a separate patch. Here is an overview of the changes:
Renaming Options:
- Build: "Start" -> "Start Frame"
- Curve: "From Radius" -> "Size from Radius"
- Screw: "Calc Order" -> "Calculate Order"
- Displace, Warp, Wave: "Texture Coordinates Object" -> "Object"
Move Mode Toggle to Top & Expand:
- Bevel, Boolean, Normal Edit, Subdivision
Use Columns for Tighter Spacing:
- Displace, Explode, Ocean, Particle Instance, Remesh, Shrinkwrap,
Solidify, Warp, Weighted Normal, Wave
Misc:
- Bevel: Set inactive properties for vertex bevel
- Mesh Sequence Cache: Remove box for cache file
- Skin: Don't align "Mark Loose" and "Clear Loose"
- Array: Expand relative offset subpanel by default
- Array: Move start cap, end cap to a new subpanel
- Bevel: Move width type above width
Differential Revision: https://developer.blender.org/D8115
2020-07-02 10:47:02 -04:00
|
|
|
col = uiLayoutColumn(layout, false);
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(col, ptr, "thickness_clamp", UI_ITEM_NONE, nullptr, ICON_NONE);
|
UI: Small Tweaks to Modifier Layouts for Consistency
These changes are smaller, made based on feedback and a pass on all
the layouts for clarity and consistency. The Multires modifier UI will
be addressed in a separate patch. Here is an overview of the changes:
Renaming Options:
- Build: "Start" -> "Start Frame"
- Curve: "From Radius" -> "Size from Radius"
- Screw: "Calc Order" -> "Calculate Order"
- Displace, Warp, Wave: "Texture Coordinates Object" -> "Object"
Move Mode Toggle to Top & Expand:
- Bevel, Boolean, Normal Edit, Subdivision
Use Columns for Tighter Spacing:
- Displace, Explode, Ocean, Particle Instance, Remesh, Shrinkwrap,
Solidify, Warp, Weighted Normal, Wave
Misc:
- Bevel: Set inactive properties for vertex bevel
- Mesh Sequence Cache: Remove box for cache file
- Skin: Don't align "Mark Loose" and "Clear Loose"
- Array: Expand relative offset subpanel by default
- Array: Move start cap, end cap to a new subpanel
- Bevel: Move width type above width
Differential Revision: https://developer.blender.org/D8115
2020-07-02 10:47:02 -04:00
|
|
|
row = uiLayoutRow(col, false);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiLayoutSetActive(row, RNA_float_get(ptr, "thickness_clamp") > 0.0f);
|
2023-07-29 15:06:33 +10:00
|
|
|
uiItemR(row, ptr, "use_thickness_angle_clamp", UI_ITEM_NONE, nullptr, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2023-01-19 15:54:47 -06:00
|
|
|
static void vertex_group_panel_draw(const bContext * /*C*/, Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *col;
|
|
|
|
|
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
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
|
|
|
|
col = uiLayoutColumn(layout, false);
|
2020-10-22 10:25:08 -05:00
|
|
|
uiItemPointerR(
|
|
|
|
|
col, ptr, "shell_vertex_group", &ob_ptr, "vertex_groups", IFACE_("Shell"), ICON_NONE);
|
2022-10-05 20:24:37 +02:00
|
|
|
uiItemPointerR(col,
|
|
|
|
|
ptr,
|
|
|
|
|
"rim_vertex_group",
|
|
|
|
|
&ob_ptr,
|
|
|
|
|
"vertex_groups",
|
|
|
|
|
CTX_IFACE_(BLT_I18NCONTEXT_ID_MESH, "Rim"),
|
|
|
|
|
ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
static void panel_register(ARegionType *region_type)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
PanelType *panel_type = modifier_panel_register(region_type, eModifierType_Solidify, panel_draw);
|
|
|
|
|
modifier_subpanel_register(
|
2023-01-19 15:54:47 -06:00
|
|
|
region_type, "normals", "Normals", nullptr, normals_panel_draw, panel_type);
|
2020-06-05 10:41:03 -04:00
|
|
|
modifier_subpanel_register(
|
2023-01-19 15:54:47 -06:00
|
|
|
region_type, "materials", "Materials", nullptr, materials_panel_draw, panel_type);
|
2020-06-05 10:41:03 -04:00
|
|
|
modifier_subpanel_register(
|
2023-01-19 15:54:47 -06:00
|
|
|
region_type, "edge_data", "Edge Data", nullptr, edge_data_panel_draw, panel_type);
|
2020-06-05 10:41:03 -04:00
|
|
|
modifier_subpanel_register(
|
2023-01-19 15:54:47 -06:00
|
|
|
region_type, "clamp", "Thickness Clamp", nullptr, clamp_panel_draw, panel_type);
|
2020-06-05 10:41:03 -04:00
|
|
|
modifier_subpanel_register(region_type,
|
|
|
|
|
"vertex_groups",
|
|
|
|
|
"Output Vertex Groups",
|
2023-01-19 15:54:47 -06:00
|
|
|
nullptr,
|
2020-06-05 10:41:03 -04:00
|
|
|
vertex_group_panel_draw,
|
|
|
|
|
panel_type);
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
ModifierTypeInfo modifierType_Solidify = {
|
2023-07-26 17:08:14 +02:00
|
|
|
/*idname*/ "Solidify",
|
2023-01-16 12:41:11 +11:00
|
|
|
/*name*/ N_("Solidify"),
|
2023-07-27 12:04:18 +10:00
|
|
|
/*struct_name*/ "SolidifyModifierData",
|
|
|
|
|
/*struct_size*/ sizeof(SolidifyModifierData),
|
2023-01-16 12:41:11 +11:00
|
|
|
/*srna*/ &RNA_SolidifyModifier,
|
|
|
|
|
/*type*/ eModifierTypeType_Constructive,
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-01-16 12:41:11 +11:00
|
|
|
/*flags*/ eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_AcceptsCVs |
|
2012-05-06 13:38:33 +00:00
|
|
|
eModifierTypeFlag_SupportsMapping | eModifierTypeFlag_SupportsEditmode |
|
|
|
|
|
eModifierTypeFlag_EnableInEditmode,
|
2023-01-16 12:41:11 +11:00
|
|
|
/*icon*/ ICON_MOD_SOLIDIFY,
|
|
|
|
|
|
2023-07-27 12:04:18 +10:00
|
|
|
/*copy_data*/ BKE_modifier_copydata_generic,
|
|
|
|
|
|
|
|
|
|
/*deform_verts*/ nullptr,
|
|
|
|
|
/*deform_matrices*/ nullptr,
|
|
|
|
|
/*deform_verts_EM*/ nullptr,
|
|
|
|
|
/*deform_matrices_EM*/ nullptr,
|
|
|
|
|
/*modify_mesh*/ modify_mesh,
|
|
|
|
|
/*modify_geometry_set*/ nullptr,
|
|
|
|
|
|
|
|
|
|
/*init_data*/ init_data,
|
|
|
|
|
/*required_data_mask*/ required_data_mask,
|
|
|
|
|
/*free_data*/ nullptr,
|
|
|
|
|
/*is_disabled*/ nullptr,
|
|
|
|
|
/*update_depsgraph*/ nullptr,
|
|
|
|
|
/*depends_on_time*/ nullptr,
|
|
|
|
|
/*depends_on_normals*/ depends_on_normals,
|
|
|
|
|
/*foreach_ID_link*/ nullptr,
|
|
|
|
|
/*foreach_tex_link*/ nullptr,
|
|
|
|
|
/*free_runtime_data*/ nullptr,
|
|
|
|
|
/*panel_register*/ panel_register,
|
|
|
|
|
/*blend_write*/ nullptr,
|
|
|
|
|
/*blend_read*/ nullptr,
|
2010-04-11 22:12:30 +00:00
|
|
|
};
|