diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-25 00:01:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-25 00:01:45 +0400 |
commit | 4b3976cc5a26937724823d07fdcdeb317a4c3948 (patch) | |
tree | a5ef7b8e4959f9b18b66d75f2644ab531d6afcd5 /source/blender/editors/space_view3d/view3d_buttons.c | |
parent | 45a3acc39838e3ab998b33d4d10e134a7927cd8a (diff) | |
parent | d0b7fb5fdf90f09748f94a21e205be7f31ebbb25 (diff) |
svn merge ^/trunk/blender -r42116:42139
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_buttons.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 136 |
1 files changed, 0 insertions, 136 deletions
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index c4412d3d8f2..1f49a4d526b 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1382,142 +1382,6 @@ static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) // VIEW3 } #endif -#if 0 // XXX not used -static void delete_sketch_armature(bContext *C, void *arg1, void *arg2) -{ - BIF_deleteSketch(C); -} - -static void convert_sketch_armature(bContext *C, void *arg1, void *arg2) -{ - BIF_convertSketch(C); -} - -static void assign_template_sketch_armature(bContext *C, void *arg1, void *arg2) -{ - int index = *(int*)arg1; - BIF_setTemplate(C, index); -} - - -static int view3d_panel_bonesketch_spaces_poll(const bContext *C, PanelType *pt) -{ - Object *obedit = CTX_data_edit_object(C); - - /* replace with check call to sketching lib */ - return (obedit && obedit->type == OB_ARMATURE); -} -static void view3d_panel_bonesketch_spaces(const bContext *C, Panel *pa) -{ - Scene *scene = CTX_data_scene(C); - static int template_index; - static char joint_label[128]; - uiBlock *block; - uiBut *but; - char *bone_name; - int yco = 130; - int nb_joints; - static char subdiv_tooltip[4][64] = { - "Subdivide arcs based on a fixed number of bones", - "Subdivide arcs in bones of equal length", - "Subdivide arcs based on correlation", - "Retarget template to stroke" - }; - - - block= uiLayoutAbsoluteBlock(pa->layout); - uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL); - - uiBlockBeginAlign(block); - - /* use real flag instead of 1 */ - uiDefButBitC(block, TOG, BONE_SKETCHING, B_REDR, "Use Bone Sketching", 10, yco, 160, 20, &scene->toolsettings->bone_sketching, 0, 0, 0, 0, "Use sketching to create and edit bones, (Ctrl snaps to mesh volume)"); - uiDefButBitC(block, TOG, BONE_SKETCHING_ADJUST, B_REDR, "A", 170, yco, 20, 20, &scene->toolsettings->bone_sketching, 0, 0, 0, 0, "Adjust strokes by drawing near them"); - uiDefButBitC(block, TOG, BONE_SKETCHING_QUICK, B_REDR, "Q", 190, yco, 20, 20, &scene->toolsettings->bone_sketching, 0, 0, 0, 0, "Automatically convert and delete on stroke end"); - yco -= 20; - - but = uiDefBut(block, BUT, B_REDR, "Convert", 10,yco,100,20, 0, 0, 0, 0, 0, "Convert sketch to armature"); - uiButSetFunc(but, convert_sketch_armature, NULL, NULL); - - but = uiDefBut(block, BUT, B_REDR, "Delete", 110,yco,100,20, 0, 0, 0, 0, 0, "Delete sketch"); - uiButSetFunc(but, delete_sketch_armature, NULL, NULL); - yco -= 20; - - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - - uiDefButC(block, MENU, B_REDR, "Subdivision Method%t|Length%x1|Adaptative%x2|Fixed%x0|Template%x3", 10,yco,60,19, &scene->toolsettings->bone_sketching_convert, 0, 0, 0, 0, subdiv_tooltip[(unsigned char)scene->toolsettings->bone_sketching_convert]); - - switch(scene->toolsettings->bone_sketching_convert) - { - case SK_CONVERT_CUT_LENGTH: - uiDefButF(block, NUM, B_REDR, "Lim:", 70, yco, 140, 19, &scene->toolsettings->skgen_length_limit,0.1,50.0, 10, 0, "Maximum length of the subdivided bones"); - yco -= 20; - break; - case SK_CONVERT_CUT_ADAPTATIVE: - uiDefButF(block, NUM, B_REDR, "Thres:", 70, yco, 140, 19, &scene->toolsettings->skgen_correlation_limit,0.0, 1.0, 0.01, 0, "Correlation threshold for subdivision"); - yco -= 20; - break; - default: - case SK_CONVERT_CUT_FIXED: - uiDefButC(block, NUM, B_REDR, "Num:", 70, yco, 140, 19, &scene->toolsettings->skgen_subdivision_number,1, 100, 1, 5, "Number of subdivided bones"); - yco -= 20; - break; - case SK_CONVERT_RETARGET: - uiDefButC(block, ROW, B_NOP, "No", 70, yco, 40,19, &scene->toolsettings->skgen_retarget_roll, 0, 0, 0, 0, "No special roll treatment"); - uiDefButC(block, ROW, B_NOP, "View", 110, yco, 50,19, &scene->toolsettings->skgen_retarget_roll, 0, SK_RETARGET_ROLL_VIEW, 0, 0, "Roll bones perpendicular to view"); - uiDefButC(block, ROW, B_NOP, "Joint", 160, yco, 50,19, &scene->toolsettings->skgen_retarget_roll, 0, SK_RETARGET_ROLL_JOINT, 0, 0, "Roll bones relative to joint bend"); - yco -= 30; - - uiBlockEndAlign(block); - - uiBlockBeginAlign(block); - /* button here to select what to do (copy or not), template, ...*/ - - BIF_makeListTemplates(C); - template_index = BIF_currentTemplate(C); - - but = uiDefButI(block, MENU, B_REDR, BIF_listTemplates(C), 10,yco,200,19, &template_index, 0, 0, 0, 0, "Template"); - uiButSetFunc(but, assign_template_sketch_armature, &template_index, NULL); - - yco -= 20; - - uiDefButF(block, NUM, B_NOP, "A:", 10, yco, 66,19, &scene->toolsettings->skgen_retarget_angle_weight, 0, 10, 1, 0, "Angle Weight"); - uiDefButF(block, NUM, B_NOP, "L:", 76, yco, 67,19, &scene->toolsettings->skgen_retarget_length_weight, 0, 10, 1, 0, "Length Weight"); - uiDefButF(block, NUM, B_NOP, "D:", 143,yco, 67,19, &scene->toolsettings->skgen_retarget_distance_weight, 0, 10, 1, 0, "Distance Weight"); - yco -= 20; - - uiDefBut(block, TEX,B_REDR,"S:", 10, yco, 90, 20, scene->toolsettings->skgen_side_string, 0.0, 8.0, 0, 0, "Text to replace &S with"); - uiDefBut(block, TEX,B_REDR,"N:", 100, yco, 90, 20, scene->toolsettings->skgen_num_string, 0.0, 8.0, 0, 0, "Text to replace &N with"); - uiDefIconButBitC(block, TOG, SK_RETARGET_AUTONAME, B_NOP, ICON_AUTO,190,yco,20,20, &scene->toolsettings->skgen_retarget_options, 0, 0, 0, 0, "Use Auto Naming"); - yco -= 20; - - /* auto renaming magic */ - uiBlockEndAlign(block); - - nb_joints = BIF_nbJointsTemplate(C); - - if (nb_joints == -1) - { - //XXX - //nb_joints = G.totvertsel; - } - - bone_name = BIF_nameBoneTemplate(C); - - BLI_snprintf(joint_label, 32, "%i joints: %s", nb_joints, bone_name); - - uiDefBut(block, LABEL, 1, joint_label, 10, yco, 200, 20, NULL, 0.0, 0.0, 0, 0, ""); - yco -= 20; - break; - } - - uiBlockEndAlign(block); -} - -#endif // XXX not used - void view3d_buttons_register(ARegionType *art) { PanelType *pt; |