From 8ddbd84240e6d0cd8ca152ff95c473c6b2e9a910 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 9 Sep 2007 11:05:21 +0000 Subject: Patch #6794: Subdivide Multi for Armatures This patch, by Juho Vepsalainen (BeBraw), introduces subdivide multi functionality for armatures. It lets you specify the number of divisions that selected bones should be divided into. I've slightly optimised the code a bit, though the change shouldn't make much of a difference. I've also fixed a minor bug in the menu highlighting, due to duplicate menu event-codes. --- source/blender/src/header_view3d.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/blender/src/header_view3d.c') diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index 196655cc97a..79c86012276 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -3672,6 +3672,8 @@ static uiBlock *view3d_edit_armature_rollmenu(void *arg_unused) static void do_view3d_edit_armaturemenu(void *arg, int event) { + static short numcuts= 2; + switch(event) { case 0: /* Undo Editing */ @@ -3700,11 +3702,16 @@ static void do_view3d_edit_armaturemenu(void *arg, int event) extrude_armature(1); break; case 12: /* subdivide */ - subdivide_armature(); + subdivide_armature(1); break; case 13: /* flip left and right names */ armature_flip_names(); break; + break; + case 15: /* subdivide multi */ + if(button(&numcuts, 1, 128, "Number of Cuts:")==0) return; + waitcursor(1); + subdivide_armature(numcuts); } allqueue(REDRAWVIEW3D, 0); } @@ -3774,7 +3781,8 @@ static uiBlock *view3d_edit_armaturemenu(void *arg_unused) uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Left & Right Names|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subdivide Multi|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Flip Left & Right Names|W, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); -- cgit v1.2.3