Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Trickey <howard.trickey@gmail.com>2014-01-14 20:00:44 +0400
committerHoward Trickey <howard.trickey@gmail.com>2014-01-14 20:07:45 +0400
commit86616c675aeaccec060f9ac7a98fbff67816516b (patch)
tree8624307b426ead258531394d75658f50963a5da4 /source/blender/modifiers/intern
parentdfac6c4189b0497f19c988d536464703fda09c39 (diff)
Bevel Modifier: add width type and profile control.
This adds to the modifier the new controls that have been added to the bevel tool.
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r--source/blender/modifiers/intern/MOD_bevel.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c
index 87b3c230b75..0a0f97fdcbe 100644
--- a/source/blender/modifiers/intern/MOD_bevel.c
+++ b/source/blender/modifiers/intern/MOD_bevel.c
@@ -58,9 +58,10 @@ static void initData(ModifierData *md)
bmd->value = 0.1f;
bmd->res = 1;
bmd->flags = 0;
- bmd->val_flags = 0;
+ bmd->val_flags = MOD_BEVEL_AMT_OFFSET;
bmd->lim_flags = 0;
bmd->e_flags = 0;
+ bmd->profile = 0.5f;
bmd->bevel_angle = DEG2RADF(30.0f);
bmd->defgrp_name[0] = '\0';
}
@@ -76,6 +77,7 @@ static void copyData(ModifierData *md, ModifierData *target)
tbmd->val_flags = bmd->val_flags;
tbmd->lim_flags = bmd->lim_flags;
tbmd->e_flags = bmd->e_flags;
+ tbmd->profile = bmd->profile;
tbmd->bevel_angle = bmd->bevel_angle;
BLI_strncpy(tbmd->defgrp_name, bmd->defgrp_name, sizeof(tbmd->defgrp_name));
}
@@ -110,6 +112,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob,
const float threshold = cosf(bmd->bevel_angle + 0.000000175f);
const bool vertex_only = (bmd->flags & MOD_BEVEL_VERT) != 0;
const bool do_clamp = !(bmd->flags & MOD_BEVEL_OVERLAP_OK);
+ const int offset_type = bmd->val_flags;
bm = DM_to_bmesh(dm, true);
@@ -158,8 +161,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct Object *ob,
}
}
- /* TODO: add offset_kind to modifier properties to, and pass in as 3rd arg here */
- BM_mesh_bevel(bm, bmd->value, 0, bmd->res, 0.5f,
+ BM_mesh_bevel(bm, bmd->value, offset_type, bmd->res, bmd->profile,
vertex_only, bmd->lim_flags & MOD_BEVEL_WEIGHT, do_clamp,
dvert, vgroup);