2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
* Copyright 2005 Blender Foundation. All rights reserved. */
|
2011-02-25 13:57:17 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup modifiers
|
2011-02-25 13:57:17 +00:00
|
|
|
*/
|
2018-06-17 17:04:27 +02:00
|
|
|
|
2018-06-23 01:46:42 +05:30
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
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-03-19 09:33:03 +01:00
|
|
|
#include "DNA_curveprofile_types.h"
|
2020-10-01 09:38:00 -05:00
|
|
|
#include "DNA_defaults.h"
|
2018-05-02 11:39:23 +02:00
|
|
|
#include "DNA_mesh_types.h"
|
2018-06-22 15:52:14 +02:00
|
|
|
#include "DNA_meshdata_types.h"
|
|
|
|
|
#include "DNA_object_types.h"
|
2018-06-19 19:27:08 +05:30
|
|
|
#include "DNA_scene_types.h"
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "DNA_screen_types.h"
|
2011-02-25 13:57:17 +00:00
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "BKE_context.h"
|
|
|
|
|
#include "BKE_curveprofile.h"
|
2013-02-21 17:29:35 +00:00
|
|
|
#include "BKE_deform.h"
|
2018-05-02 11:39:23 +02:00
|
|
|
#include "BKE_mesh.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
#include "BKE_modifier.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-11-28 04:19:44 +00:00
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
#include "MOD_ui_common.h"
|
2013-02-21 17:29:35 +00:00
|
|
|
#include "MOD_util.h"
|
2012-10-24 07:24:11 +00:00
|
|
|
|
2020-06-23 17:08:26 +02:00
|
|
|
#include "BLO_read_write.h"
|
|
|
|
|
|
2013-02-21 17:29:35 +00:00
|
|
|
#include "bmesh.h"
|
2013-08-23 04:22:07 +00:00
|
|
|
#include "bmesh_tools.h"
|
2010-04-11 22:12:30 +00:00
|
|
|
|
2018-07-03 19:01:20 +05:30
|
|
|
#include "DEG_depsgraph_query.h"
|
|
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
static void initData(ModifierData *md)
|
|
|
|
|
{
|
2012-05-06 13:38:33 +00:00
|
|
|
BevelModifierData *bmd = (BevelModifierData *)md;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-10-01 09:38:00 -05:00
|
|
|
BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(bmd, modifier));
|
|
|
|
|
|
|
|
|
|
MEMCPY_STRUCT_AFTER(bmd, DNA_struct_default_get(BevelModifierData), modifier);
|
|
|
|
|
|
2019-11-20 16:12:32 -05:00
|
|
|
bmd->custom_profile = BKE_curveprofile_add(PROF_PRESET_LINE);
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
2019-01-14 14:10:33 +01:00
|
|
|
static void copyData(const ModifierData *md_src, ModifierData *md_dst, const int flag)
|
2018-08-19 16:54:34 +02:00
|
|
|
{
|
2019-11-20 16:12:32 -05:00
|
|
|
const BevelModifierData *bmd_src = (const BevelModifierData *)md_src;
|
|
|
|
|
BevelModifierData *bmd_dst = (BevelModifierData *)md_dst;
|
|
|
|
|
|
2020-05-08 10:14:02 +02:00
|
|
|
BKE_modifier_copydata_generic(md_src, md_dst, flag);
|
2019-11-20 16:12:32 -05:00
|
|
|
bmd_dst->custom_profile = BKE_curveprofile_copy(bmd_src->custom_profile);
|
2018-08-19 16:54:34 +02: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
|
|
|
{
|
|
|
|
|
BevelModifierData *bmd = (BevelModifierData *)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 (bmd->defgrp_name[0] != '\0') {
|
|
|
|
|
r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT;
|
|
|
|
|
}
|
Mesh: Move bevel weight out of MVert and MEdge
As described in T95966, the goal is to move to a "struct of arrays"
approach rather than gathering an arbitrary set of data in hard-coded
structs. This has performance benefits, but also code complexity
benefits (this patch removes plenty of code, though the boilerplate
for the new operators outweighs that here).
To mirror the internal change, the options for storing mesh bevel
weights are converted into operators that add or remove the layer,
like for some other layers.
The most complex change is to the solidify modifier, where bevel
weights had special handling. Other than that, most changes are
removing clearing of the weights, boilerplate for the add/remove
operators, and removing the manual transfer of bevel weights
in bmesh - mesh conversion.
Eventually bevel weights can become a fully generic attribute,
but for now this patch aims to avoid most functional changes.
Bevel weights are still written and read from the mesh in the old way,
so neither forward nor backward compatibility are affected. As described
in T95965, writing in the old format will be done until 4.0.
Differential Revision: https://developer.blender.org/D14077
2022-09-09 08:29:07 -05:00
|
|
|
if (bmd->lim_flags & MOD_BEVEL_WEIGHT) {
|
|
|
|
|
r_cddata_masks->vmask |= CD_MASK_BWEIGHT;
|
|
|
|
|
r_cddata_masks->emask |= CD_MASK_BWEIGHT;
|
|
|
|
|
}
|
2010-04-11 22:12:30 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-21 17:29:35 +00:00
|
|
|
/*
|
|
|
|
|
* This calls the new bevel code (added since 2.64)
|
2011-11-28 04:19:44 +00:00
|
|
|
*/
|
2020-04-21 13:09:41 +02:00
|
|
|
static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh *mesh)
|
2011-11-28 04:19:44 +00:00
|
|
|
{
|
2018-05-02 11:39:23 +02:00
|
|
|
Mesh *result;
|
2011-11-28 04:19:44 +00:00
|
|
|
BMesh *bm;
|
|
|
|
|
BMIter iter;
|
|
|
|
|
BMEdge *e;
|
2013-02-21 17:29:35 +00:00
|
|
|
BMVert *v;
|
2014-01-24 12:42:20 -05:00
|
|
|
float weight, weight2;
|
2013-02-21 17:29:35 +00:00
|
|
|
int vgroup = -1;
|
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 = NULL;
|
2012-05-06 13:38:33 +00:00
|
|
|
BevelModifierData *bmd = (BevelModifierData *)md;
|
Cleanup: Internal degrees removal.
This patch changes most of the reamining degrees usage in internal code into radians.
I let a few which I know off asside, for reasons explained below - and I'm not sure to have found out all of them.
WARNING: this introduces forward incompatibility, which means files saved from this version won't open 100% correctly
in previous versions (a few angle properties would use radians values as degrees...).
Details:
- Data:
-- Lamp.spotsize: Game engine exposed this setting in degrees, to not break the API here I kept it as such
(using getter/setter functions), still using radians internally.
-- Mesh.smoothresh: Didn't touch to this one, as we will hopefully replace it completely by loop normals currently in dev.
- Modifiers:
-- EdgeSplitModifierData.split_angle, BevelModifierData.bevel_angle: Done.
- Postprocessing:
-- WipeVars.angle (sequencer's effect), NodeBokehImage.angle, NodeBoxMask.rotation, NodeEllipseMask.rotation: Done.
- BGE:
-- bConstraintActuator: Orientation type done (the minloc[0] & maxloc[0] cases). Did not touch to 'limit location' type,
it can also limit rotation, but it exposes through RNA the same limit_min/limit_max, which hence
can be either distance or angle values, depending on the mode. Will leave this to BGE team.
-- bSoundActuator.cone_outer_angle_3d, bSoundActuator.cone_inner_angle_3d: Done (note I kept degrees in BGE itself,
as it seems this is the expected value here...).
-- bRadarSensor.angle: Done.
Reviewers: brecht, campbellbarton, sergey, gaiaclary, dfelinto, moguri, jbakker, lukastoenne, howardt
Reviewed By: brecht, campbellbarton, sergey, gaiaclary, moguri, jbakker, lukastoenne, howardt
Thanks to all!
Differential Revision: http://developer.blender.org/D59
2013-12-03 20:09:25 +01:00
|
|
|
const float threshold = cosf(bmd->bevel_angle + 0.000000175f);
|
2013-07-23 14:28:19 +00:00
|
|
|
const bool do_clamp = !(bmd->flags & MOD_BEVEL_OVERLAP_OK);
|
2014-01-14 11:00:44 -05:00
|
|
|
const int offset_type = bmd->val_flags;
|
2020-06-22 22:25:55 -04:00
|
|
|
const int profile_type = bmd->profile_type;
|
2019-01-07 07:29:54 -05:00
|
|
|
const float value = bmd->value;
|
2018-05-01 17:33:04 +02:00
|
|
|
const int mat = CLAMPIS(bmd->mat, -1, ctx->object->totcol - 1);
|
2015-07-05 13:31:26 -04:00
|
|
|
const bool loop_slide = (bmd->flags & MOD_BEVEL_EVEN_WIDTHS) == 0;
|
2018-06-04 15:13:54 +05:30
|
|
|
const bool mark_seam = (bmd->edge_flags & MOD_BEVEL_MARK_SEAM);
|
|
|
|
|
const bool mark_sharp = (bmd->edge_flags & MOD_BEVEL_MARK_SHARP);
|
2019-01-06 18:12:00 -05:00
|
|
|
bool harden_normals = (bmd->flags & MOD_BEVEL_HARDEN_NORMALS);
|
2019-01-03 13:39:52 -05:00
|
|
|
const int face_strength_mode = bmd->face_str_mode;
|
2019-01-18 12:54:10 -05:00
|
|
|
const int miter_outer = bmd->miter_outer;
|
|
|
|
|
const int miter_inner = bmd->miter_inner;
|
|
|
|
|
const float spread = bmd->spread;
|
2020-02-18 18:06:13 +01:00
|
|
|
const bool invert_vgroup = (bmd->flags & MOD_BEVEL_INVERT_VGROUP) != 0;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-01 07:40:07 +10:00
|
|
|
bm = BKE_mesh_to_bmesh_ex(mesh,
|
|
|
|
|
&(struct BMeshCreateParams){0},
|
|
|
|
|
&(struct BMeshFromMeshParams){
|
|
|
|
|
.calc_face_normal = true,
|
2022-03-22 09:33:50 -05:00
|
|
|
.calc_vert_normal = true,
|
2019-05-01 07:40:07 +10:00
|
|
|
.add_key_index = false,
|
|
|
|
|
.use_shapekey = false,
|
|
|
|
|
.active_shapekey = 0,
|
|
|
|
|
/* XXX We probably can use CD_MASK_BAREMESH_ORIGDINDEX here instead
|
|
|
|
|
* (also for other modifiers cases)? */
|
|
|
|
|
.cd_mask_extra = {.vmask = CD_MASK_ORIGINDEX,
|
|
|
|
|
.emask = CD_MASK_ORIGINDEX,
|
|
|
|
|
.pmask = CD_MASK_ORIGINDEX},
|
|
|
|
|
});
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-04-22 09:15:10 +10:00
|
|
|
if ((bmd->lim_flags & MOD_BEVEL_VGROUP) && bmd->defgrp_name[0]) {
|
2018-06-29 19:02:19 +02:00
|
|
|
MOD_get_vgroup(ctx->object, mesh, bmd->defgrp_name, &dvert, &vgroup);
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-07-21 16:32:00 -04:00
|
|
|
if (bmd->affect_type == MOD_BEVEL_AFFECT_VERTICES) {
|
2013-08-17 08:21:40 +00:00
|
|
|
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
2014-10-14 21:28:20 +02:00
|
|
|
if (bmd->lim_flags & MOD_BEVEL_WEIGHT) {
|
|
|
|
|
weight = BM_elem_float_data_get(&bm->vdata, v, CD_BWEIGHT);
|
2019-04-22 09:15:10 +10:00
|
|
|
if (weight == 0.0f) {
|
2014-10-14 21:28:20 +02:00
|
|
|
continue;
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2014-10-14 21:28:20 +02:00
|
|
|
}
|
|
|
|
|
else if (vgroup != -1) {
|
2020-02-18 18:06:13 +01:00
|
|
|
weight = invert_vgroup ?
|
2020-03-06 12:50:56 +11:00
|
|
|
1.0f -
|
|
|
|
|
BKE_defvert_array_find_weight_safe(dvert, BM_elem_index_get(v), vgroup) :
|
|
|
|
|
BKE_defvert_array_find_weight_safe(dvert, BM_elem_index_get(v), vgroup);
|
2014-01-24 12:42:20 -05:00
|
|
|
/* Check is against 0.5 rather than != 0.0 because cascaded bevel modifiers will
|
|
|
|
|
* interpolate weights for newly created vertices, and may cause unexpected "selection" */
|
2019-04-22 09:15:10 +10:00
|
|
|
if (weight < 0.5f) {
|
2013-02-21 17:29:35 +00:00
|
|
|
continue;
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2013-02-21 17:29:35 +00:00
|
|
|
}
|
|
|
|
|
BM_elem_flag_enable(v, BM_ELEM_TAG);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2013-02-21 17:29:35 +00:00
|
|
|
}
|
2013-07-23 14:28:19 +00:00
|
|
|
else if (bmd->lim_flags & MOD_BEVEL_ANGLE) {
|
2012-04-19 13:47:58 +00:00
|
|
|
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
2011-11-28 04:19:44 +00:00
|
|
|
/* check for 1 edge having 2 face users */
|
2012-11-18 10:17:07 +00:00
|
|
|
BMLoop *l_a, *l_b;
|
|
|
|
|
if (BM_edge_loop_pair(e, &l_a, &l_b)) {
|
|
|
|
|
if (dot_v3v3(l_a->f->no, l_b->f->no) < threshold) {
|
2012-11-18 08:56:47 +00:00
|
|
|
BM_elem_flag_enable(e, BM_ELEM_TAG);
|
|
|
|
|
BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
|
|
|
|
|
BM_elem_flag_enable(e->v2, BM_ELEM_TAG);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-11-28 04:19:44 +00:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* crummy, is there a way just to operator on all? - campbell */
|
2012-04-19 13:47:58 +00:00
|
|
|
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
2012-11-18 09:33:11 +00:00
|
|
|
if (BM_edge_is_manifold(e)) {
|
2013-07-23 14:28:19 +00:00
|
|
|
if (bmd->lim_flags & MOD_BEVEL_WEIGHT) {
|
2013-02-21 17:29:35 +00:00
|
|
|
weight = BM_elem_float_data_get(&bm->edata, e, CD_BWEIGHT);
|
2019-04-22 09:15:10 +10:00
|
|
|
if (weight == 0.0f) {
|
2013-02-21 17:29:35 +00:00
|
|
|
continue;
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2013-02-21 17:29:35 +00:00
|
|
|
}
|
2014-01-24 12:42:20 -05:00
|
|
|
else if (vgroup != -1) {
|
2020-02-18 18:06:13 +01:00
|
|
|
weight = invert_vgroup ?
|
2020-03-06 12:50:56 +11:00
|
|
|
1.0f - BKE_defvert_array_find_weight_safe(
|
2020-02-18 18:06:13 +01:00
|
|
|
dvert, BM_elem_index_get(e->v1), vgroup) :
|
2020-03-06 12:50:56 +11:00
|
|
|
BKE_defvert_array_find_weight_safe(dvert, BM_elem_index_get(e->v1), vgroup);
|
|
|
|
|
weight2 = invert_vgroup ? 1.0f - BKE_defvert_array_find_weight_safe(
|
|
|
|
|
dvert, BM_elem_index_get(e->v2), vgroup) :
|
|
|
|
|
BKE_defvert_array_find_weight_safe(
|
|
|
|
|
dvert, BM_elem_index_get(e->v2), vgroup);
|
2019-04-22 09:15:10 +10:00
|
|
|
if (weight < 0.5f || weight2 < 0.5f) {
|
2014-01-24 12:42:20 -05:00
|
|
|
continue;
|
2019-04-22 09:15:10 +10:00
|
|
|
}
|
2014-01-24 12:42:20 -05:00
|
|
|
}
|
2012-11-18 09:33:11 +00:00
|
|
|
BM_elem_flag_enable(e, BM_ELEM_TAG);
|
|
|
|
|
BM_elem_flag_enable(e->v1, BM_ELEM_TAG);
|
|
|
|
|
BM_elem_flag_enable(e->v2, BM_ELEM_TAG);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2012-11-18 09:33:11 +00:00
|
|
|
}
|
2011-11-28 04:19:44 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-07-16 18:00:57 +02:00
|
|
|
Object *ob = ctx->object;
|
|
|
|
|
|
|
|
|
|
if (harden_normals && (ob->type == OB_MESH) && !(((Mesh *)ob->data)->flag & ME_AUTOSMOOTH)) {
|
2020-10-26 17:07:58 +11:00
|
|
|
BKE_modifier_set_error(ob, md, "Enable 'Auto Smooth' in Object Data Properties");
|
2019-01-06 18:12:00 -05:00
|
|
|
harden_normals = false;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-07 07:29:54 -05:00
|
|
|
BM_mesh_bevel(bm,
|
|
|
|
|
value,
|
|
|
|
|
offset_type,
|
2020-06-22 22:25:55 -04:00
|
|
|
profile_type,
|
2019-01-07 07:29:54 -05:00
|
|
|
bmd->res,
|
|
|
|
|
bmd->profile,
|
2020-07-21 16:32:00 -04:00
|
|
|
bmd->affect_type,
|
2013-07-23 14:28:19 +00:00
|
|
|
bmd->lim_flags & MOD_BEVEL_WEIGHT,
|
|
|
|
|
do_clamp,
|
2019-01-03 13:39:52 -05:00
|
|
|
dvert,
|
|
|
|
|
vgroup,
|
|
|
|
|
mat,
|
|
|
|
|
loop_slide,
|
|
|
|
|
mark_seam,
|
|
|
|
|
mark_sharp,
|
2019-01-18 12:54:10 -05:00
|
|
|
harden_normals,
|
|
|
|
|
face_strength_mode,
|
|
|
|
|
miter_outer,
|
|
|
|
|
miter_inner,
|
|
|
|
|
spread,
|
2019-11-20 16:12:32 -05:00
|
|
|
mesh->smoothresh,
|
|
|
|
|
bmd->custom_profile,
|
2020-07-21 16:32:00 -04:00
|
|
|
bmd->vmesh_method);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-09-16 10:45:49 +02:00
|
|
|
result = BKE_mesh_from_bmesh_for_eval_nomain(bm, NULL, mesh);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-08-14 23:29:46 +10:00
|
|
|
/* Make sure we never alloc'd these. */
|
|
|
|
|
BLI_assert(bm->vtoolflagpool == NULL && bm->etoolflagpool == NULL && bm->ftoolflagpool == NULL);
|
|
|
|
|
|
2012-10-24 07:24:11 +00:00
|
|
|
BM_mesh_free(bm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-02-12 15:02:33 +00:00
|
|
|
return result;
|
2011-11-28 04:19:44 +00:00
|
|
|
}
|
|
|
|
|
|
2014-02-07 10:43:28 -05:00
|
|
|
static bool dependsOnNormals(ModifierData *UNUSED(md))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-20 16:12:32 -05:00
|
|
|
static void freeData(ModifierData *md)
|
|
|
|
|
{
|
|
|
|
|
BevelModifierData *bmd = (BevelModifierData *)md;
|
|
|
|
|
BKE_curveprofile_free(bmd->custom_profile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static bool isDisabled(const Scene *UNUSED(scene), ModifierData *md, bool UNUSED(userRenderParams))
|
|
|
|
|
{
|
|
|
|
|
BevelModifierData *bmd = (BevelModifierData *)md;
|
|
|
|
|
return (bmd->value == 0.0f);
|
|
|
|
|
}
|
|
|
|
|
|
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
|
|
|
{
|
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, *sub;
|
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
|
|
|
bool edge_bevel = RNA_enum_get(ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES;
|
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
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "affect", UI_ITEM_R_EXPAND, NULL, 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
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
|
|
|
|
col = uiLayoutColumn(layout, false);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(col, ptr, "offset_type", 0, NULL, ICON_NONE);
|
|
|
|
|
if (RNA_enum_get(ptr, "offset_type") == BEVEL_AMT_PERCENT) {
|
|
|
|
|
uiItemR(col, ptr, "width_pct", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
else {
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(col, ptr, "width", 0, IFACE_("Amount"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "segments", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
uiItemS(layout);
|
|
|
|
|
|
|
|
|
|
col = uiLayoutColumn(layout, false);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE);
|
|
|
|
|
int limit_method = RNA_enum_get(ptr, "limit_method");
|
2020-07-03 11:18:24 -04:00
|
|
|
if (limit_method == MOD_BEVEL_ANGLE) {
|
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
|
|
|
sub = uiLayoutColumn(col, false);
|
|
|
|
|
uiLayoutSetActive(sub, edge_bevel);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(col, ptr, "angle_limit", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
else if (limit_method == MOD_BEVEL_VGROUP) {
|
2020-09-02 14:13:26 -05:00
|
|
|
modifier_vgroup_ui(col, ptr, &ob_ptr, "vertex_group", "invert_vertex_group", NULL);
|
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
|
|
|
}
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
static void profile_panel_draw(const bContext *UNUSED(C), Panel *panel)
|
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;
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL);
|
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
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
int profile_type = RNA_enum_get(ptr, "profile_type");
|
|
|
|
|
int miter_inner = RNA_enum_get(ptr, "miter_inner");
|
|
|
|
|
int miter_outer = RNA_enum_get(ptr, "miter_outer");
|
|
|
|
|
bool edge_bevel = RNA_enum_get(ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES;
|
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
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "profile_type", UI_ITEM_R_EXPAND, NULL, 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
|
|
|
|
|
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
|
|
|
|
if (ELEM(profile_type, MOD_BEVEL_PROFILE_SUPERELLIPSE, MOD_BEVEL_PROFILE_CUSTOM)) {
|
|
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
|
uiLayoutSetActive(
|
|
|
|
|
row,
|
|
|
|
|
profile_type == MOD_BEVEL_PROFILE_SUPERELLIPSE ||
|
|
|
|
|
(profile_type == MOD_BEVEL_PROFILE_CUSTOM && edge_bevel &&
|
|
|
|
|
!((miter_inner == MOD_BEVEL_MITER_SHARP) && (miter_outer == MOD_BEVEL_MITER_SHARP))));
|
|
|
|
|
uiItemR(row,
|
2020-09-02 14:13:26 -05:00
|
|
|
ptr,
|
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
|
|
|
"profile",
|
|
|
|
|
UI_ITEM_R_SLIDER,
|
|
|
|
|
(profile_type == MOD_BEVEL_PROFILE_SUPERELLIPSE) ? IFACE_("Shape") :
|
|
|
|
|
IFACE_("Miter Shape"),
|
|
|
|
|
ICON_NONE);
|
|
|
|
|
|
|
|
|
|
if (profile_type == MOD_BEVEL_PROFILE_CUSTOM) {
|
|
|
|
|
uiLayout *sub = uiLayoutColumn(layout, false);
|
|
|
|
|
uiLayoutSetPropDecorate(sub, false);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiTemplateCurveProfile(sub, ptr, "custom_profile");
|
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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
static void geometry_panel_draw(const bContext *UNUSED(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;
|
2020-06-05 10:41:03 -04:00
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
bool edge_bevel = RNA_enum_get(ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES;
|
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
|
|
|
|
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
|
|
|
row = uiLayoutRow(layout, false);
|
|
|
|
|
uiLayoutSetActive(row, edge_bevel);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(row, ptr, "miter_outer", 0, IFACE_("Miter Outer"), 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(layout, false);
|
|
|
|
|
uiLayoutSetActive(row, edge_bevel);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(row, ptr, "miter_inner", 0, IFACE_("Inner"), ICON_NONE);
|
|
|
|
|
if (RNA_enum_get(ptr, "miter_inner") == BEVEL_MITER_ARC) {
|
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(layout, false);
|
|
|
|
|
uiLayoutSetActive(row, edge_bevel);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(row, ptr, "spread", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
uiItemS(layout);
|
|
|
|
|
|
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(layout, false);
|
|
|
|
|
uiLayoutSetActive(row, edge_bevel);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(row, ptr, "vmesh_method", 0, IFACE_("Intersections"), ICON_NONE);
|
|
|
|
|
uiItemR(layout, ptr, "use_clamp_overlap", 0, NULL, 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(layout, false);
|
|
|
|
|
uiLayoutSetActive(row, edge_bevel);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(row, ptr, "loop_slide", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
static void shading_panel_draw(const bContext *UNUSED(C), Panel *panel)
|
2020-06-05 10:41:03 -04:00
|
|
|
{
|
|
|
|
|
uiLayout *col;
|
|
|
|
|
uiLayout *layout = panel->layout;
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
PointerRNA *ptr = modifier_panel_get_property_pointers(panel, NULL);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
bool edge_bevel = RNA_enum_get(ptr, "affect") != MOD_BEVEL_AFFECT_VERTICES;
|
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
|
|
|
|
2020-06-05 10:41:03 -04:00
|
|
|
uiLayoutSetPropSep(layout, true);
|
|
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "harden_normals", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
|
|
|
|
col = uiLayoutColumnWithHeading(layout, true, IFACE_("Mark"));
|
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
|
|
|
uiLayoutSetActive(col, edge_bevel);
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(col, ptr, "mark_seam", 0, IFACE_("Seam"), ICON_NONE);
|
|
|
|
|
uiItemR(col, ptr, "mark_sharp", 0, IFACE_("Sharp"), ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
|
2020-09-02 14:13:26 -05:00
|
|
|
uiItemR(layout, ptr, "material", 0, NULL, ICON_NONE);
|
|
|
|
|
uiItemR(layout, ptr, "face_strength_mode", 0, NULL, ICON_NONE);
|
2020-06-05 10:41:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void panelRegister(ARegionType *region_type)
|
|
|
|
|
{
|
|
|
|
|
PanelType *panel_type = modifier_panel_register(region_type, eModifierType_Bevel, panel_draw);
|
2020-06-22 22:25:55 -04:00
|
|
|
modifier_subpanel_register(
|
2020-06-05 10:41:03 -04:00
|
|
|
region_type, "profile", "Profile", NULL, profile_panel_draw, panel_type);
|
|
|
|
|
modifier_subpanel_register(
|
|
|
|
|
region_type, "geometry", "Geometry", NULL, geometry_panel_draw, panel_type);
|
|
|
|
|
modifier_subpanel_register(
|
|
|
|
|
region_type, "shading", "Shading", NULL, shading_panel_draw, panel_type);
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-16 16:00:00 +02:00
|
|
|
static void blendWrite(BlendWriter *writer, const ID *UNUSED(id_owner), const ModifierData *md)
|
2020-06-23 17:08:26 +02:00
|
|
|
{
|
|
|
|
|
const BevelModifierData *bmd = (const BevelModifierData *)md;
|
|
|
|
|
|
2022-05-16 16:00:00 +02:00
|
|
|
BLO_write_struct(writer, BevelModifierData, bmd);
|
|
|
|
|
|
2020-06-23 17:08:26 +02:00
|
|
|
if (bmd->custom_profile) {
|
|
|
|
|
BKE_curveprofile_blend_write(writer, bmd->custom_profile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void blendRead(BlendDataReader *reader, ModifierData *md)
|
|
|
|
|
{
|
|
|
|
|
BevelModifierData *bmd = (BevelModifierData *)md;
|
|
|
|
|
|
|
|
|
|
BLO_read_data_address(reader, &bmd->custom_profile);
|
|
|
|
|
if (bmd->custom_profile) {
|
|
|
|
|
BKE_curveprofile_blend_read(reader, bmd->custom_profile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-11 22:12:30 +00:00
|
|
|
ModifierTypeInfo modifierType_Bevel = {
|
2023-01-16 12:41:11 +11:00
|
|
|
/*name*/ N_("Bevel"),
|
|
|
|
|
/*structName*/ "BevelModifierData",
|
|
|
|
|
/*structSize*/ sizeof(BevelModifierData),
|
|
|
|
|
/*srna*/ &RNA_BevelModifier,
|
|
|
|
|
/*type*/ eModifierTypeType_Constructive,
|
|
|
|
|
/*flags*/ eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsEditmode |
|
2018-07-11 22:36:44 +05:30
|
|
|
eModifierTypeFlag_EnableInEditmode | eModifierTypeFlag_AcceptsCVs,
|
2023-01-16 12:41:11 +11:00
|
|
|
/*icon*/ ICON_MOD_BEVEL,
|
|
|
|
|
/*copyData*/ copyData,
|
|
|
|
|
/*deformVerts*/ NULL,
|
|
|
|
|
/*deformMatrices*/ NULL,
|
|
|
|
|
/*deformVertsEM*/ NULL,
|
|
|
|
|
/*deformMatricesEM*/ NULL,
|
|
|
|
|
/*modifyMesh*/ modifyMesh,
|
|
|
|
|
/*modifyGeometrySet*/ NULL,
|
|
|
|
|
/*initData*/ initData,
|
|
|
|
|
/*requiredDataMask*/ requiredDataMask,
|
|
|
|
|
/*freeData*/ freeData,
|
|
|
|
|
/*isDisabled*/ isDisabled,
|
|
|
|
|
/*updateDepsgraph*/ NULL,
|
|
|
|
|
/*dependsOnTime*/ NULL,
|
|
|
|
|
/*dependsOnNormals*/ dependsOnNormals,
|
|
|
|
|
/*foreachIDLink*/ NULL,
|
|
|
|
|
/*foreachTexLink*/ NULL,
|
|
|
|
|
/*freeRuntimeData*/ NULL,
|
|
|
|
|
/*uiPanel*/ panelRegister,
|
|
|
|
|
/*blendWrite*/ blendWrite,
|
|
|
|
|
/*blendRead*/ blendRead,
|
2010-04-11 22:12:30 +00:00
|
|
|
};
|