[Bf-blender-cvs] [ec65713282d] soc-2019-bevel-profiles: ProfileWidget / Bevel Modifier: Resolved issue where dragging points in the widget didn't cause the modifier to recalculate.
Hans Goudey
noreply at git.blender.org
Tue Jul 30 19:43:58 CEST 2019
Commit: ec65713282d7be1a97dd376d7ac5051c3059f05c
Author: Hans Goudey
Date: Tue Jul 30 09:42:57 2019 -0400
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rBec65713282d7be1a97dd376d7ac5051c3059f05c
ProfileWidget / Bevel Modifier: Resolved issue where dragging points in the
widget didn't cause the modifier to recalculate.
===================================================================
M source/blender/editors/interface/interface_handlers.c
M source/blender/editors/interface/interface_templates.c
===================================================================
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index e2b28bf749b..9e31e1665db 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -6744,7 +6744,6 @@ static int ui_do_but_CURVE(
}
/* Same as ui_numedit_but_CURVE with some smaller changes */
-/* HANS-TODO: Dragging control point doesn't update modifier */
static bool ui_numedit_but_PROFILE(uiBlock *block,
uiBut *but,
uiHandleButtonData *data,
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 4090d1cb6c0..5e6e90f8a57 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -4354,7 +4354,7 @@ static uiBlock *profilewidget_buttons_presets(bContext *C, ARegion *ar, void *pr
return profilewidget_presets_func(C, ar, (ProfileWidget *)prwdgt_v);
}
-/* only for profilewidget tools block */
+/* Only for profilewidget tools block */
enum {
UIPROFILE_FUNC_RESET,
UIPROFILE_FUNC_RESET_VIEW,
@@ -4547,8 +4547,8 @@ static void profilewidget_buttons_layout(uiLayout *layout, PointerRNA *ptr, RNAU
/* HANS-QUESTION: I'm guessing this is the newer way to do this. I'd be happy to switch
* everythingn here to this method, as it seems simpler, more elegant, and more linked to the RNA
- * system anyway, but this doesn't redraw the widget */
- uiItemR(layout, ptr, "preset", 0, "Preset", ICON_NONE);
+ * system anyway, but this doesn't redraw the widget
+ uiItemR(layout, ptr, "preset", 0, "Preset", ICON_NONE); */
row = uiLayoutRow(layout, false);
@@ -4586,6 +4586,8 @@ static void profilewidget_buttons_layout(uiLayout *layout, PointerRNA *ptr, RNAU
0.0, TIP_("Toggle Profile Clipping"));
UI_but_funcN_set(bt, profilewidget_clipping_toggle, MEM_dupallocN(cb), prwdgt);
+ UI_block_funcN_set(block, rna_update_cb, MEM_dupallocN(cb), NULL);
+
/* The path itself */
path_width = max_ii(uiLayoutGetWidth(layout), UI_UNIT_X);
path_width = min_ii(path_width, (int)(16.0f * UI_UNIT_X));
@@ -4625,24 +4627,25 @@ static void profilewidget_buttons_layout(uiLayout *layout, PointerRNA *ptr, RNAU
0.0, 0.0, 0.0, 0.0, TIP_("Set the point's handle type to sharp."));
UI_but_funcN_set(bt, profilewidget_buttons_setcurved, MEM_dupallocN(cb), prwdgt);
- /* Position */
+
UI_block_funcN_set(block, profilewidget_buttons_update, MEM_dupallocN(cb), prwdgt);
- /* HANS-QUESTION: I haven't been able to find out how to just disable these buttons instead of
+ /* HANS-QUESTION: I haven't been able to find out how to disable these buttons instead of
* not drawing them. */
if (!point_last_or_first) {
+
+ /* Position */
bt = uiDefButF(block, UI_BTYPE_NUM, 0, "X:", 0, 2 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y,
&point->x, bounds.xmin, bounds.xmax, 1, 5, "");
uiDefButF(block, UI_BTYPE_NUM, 0, "Y:", 0, 1 * UI_UNIT_Y, UI_UNIT_X * 10, UI_UNIT_Y,
&point->y, bounds.ymin, bounds.ymax, 1, 5, "");
- }
- /* Delete points */
- bt = uiDefIconBut(block, UI_BTYPE_BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_X, NULL, 0.0, 0.0,
- 0.0, 0.0, TIP_("Delete points"));
- UI_but_funcN_set(bt, profilewidget_buttons_delete, MEM_dupallocN(cb), prwdgt);
+ /* Delete points */
+ bt = uiDefIconBut(block, UI_BTYPE_BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_X, NULL, 0.0, 0.0,
+ 0.0, 0.0, TIP_("Delete points"));
+ UI_but_funcN_set(bt, profilewidget_buttons_delete, MEM_dupallocN(cb), prwdgt);
+ }
- UI_block_funcN_set(block, rna_update_cb, MEM_dupallocN(cb), NULL);
}
uiItemR(layout, ptr, "sample_straight_edges", 0, NULL, ICON_NONE);
More information about the Bf-blender-cvs
mailing list