diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-03-20 21:00:51 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-03-20 21:00:51 +0300 |
commit | 1af7bd439acf4dd08f7c0f66d91ef2238ff1db05 (patch) | |
tree | bd339b97d44ae35ca8a752c7989f2360a568b35b /source/blender/editors/space_view3d | |
parent | 884cfe25d34809a97e69d04c95800ae4e741259e (diff) |
merge more etch-a-ton code. nothing works, but it compiles. Will try to get it working this week end.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 81 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 15 |
3 files changed, 48 insertions, 50 deletions
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 26b6dcc22ff..e5e5f62083c 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1557,25 +1557,25 @@ static void view3d_panel_gpencil(const bContext *C, ARegion *ar, short cntrl) // uiEndBlock(C, block); } -/* XXX etch-a-ton */ -#if 0 -static void delete_sketch_armature(void *arg1, void *arg2) +static void delete_sketch_armature(bContext *C, void *arg1, void *arg2) { - BIF_deleteSketch(); + BIF_deleteSketch(C); } -static void convert_sketch_armature(void *arg1, void *arg2) +static void convert_sketch_armature(bContext *C, void *arg1, void *arg2) { - BIF_convertSketch(); + BIF_convertSketch(C); } -static void assign_template_sketch_armature(void *arg1, void *arg2) +static void assign_template_sketch_armature(bContext *C, void *arg1, void *arg2) { int index = *(int*)arg1; - BIF_setTemplate(index); + BIF_setTemplate(C, index); } -static void view3d_panel_bonesketch_spaces(short cntrl) +static void view3d_panel_bonesketch_spaces(const bContext *C, ARegion *ar, short cntrl) { + Object *obedit = CTX_data_edit_object(C); + Scene *scene = CTX_data_scene(C); static int template_index; static char joint_label[128]; uiBlock *block; @@ -1585,7 +1585,7 @@ static void view3d_panel_bonesketch_spaces(short cntrl) int nb_joints; /* replace with check call to sketching lib */ - if (G.obedit && G.obedit->type == OB_ARMATURE) + if (obedit && obedit->type == OB_ARMATURE) { static char subdiv_tooltip[4][64] = { "Subdivide arcs based on a fixed number of bones", @@ -1595,20 +1595,18 @@ static void view3d_panel_bonesketch_spaces(short cntrl) }; - block= uiNewBlock(&curarea->uiblocks, "view3d_panel_bonesketch_spaces", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(VIEW3D_HANDLER_BONESKETCH); // for close and esc - - if(uiNewPanel(curarea, block, "Bone Sketching", "View3d", 10, 230, 250, height)==0) return; + block= uiBeginBlock(C, ar, "view3d_panel_bonesketch_spaces", UI_EMBOSS, UI_HELV); + if(uiNewPanel(C, ar, block, "Bone Sketching", "View3d", 340, 10, 318, height)==0) return; + uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL); uiNewPanelHeight(block, height); uiBlockBeginAlign(block); /* use real flag instead of 1 */ - uiDefButBitC(block, TOG, BONE_SKETCHING, B_REDR, "Use Bone Sketching", 10, yco, 160, 20, &G.scene->toolsettings->bone_sketching, 0, 0, 0, 0, "Use sketching to create and edit bones"); - uiDefButBitC(block, TOG, BONE_SKETCHING_ADJUST, B_REDR, "A", 170, yco, 20, 20, &G.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, &G.scene->toolsettings->bone_sketching, 0, 0, 0, 0, "Automatically convert and delete on stroke end"); + 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"); + 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"); @@ -1622,27 +1620,27 @@ static void view3d_panel_bonesketch_spaces(short cntrl) uiBlockBeginAlign(block); - uiDefButC(block, MENU, B_REDR, "Subdivision Method%t|Length%x1|Adaptative%x2|Fixed%x0|Template%x3", 10,yco,60,19, &G.scene->toolsettings->bone_sketching_convert, 0, 0, 0, 0, subdiv_tooltip[(unsigned char)G.scene->toolsettings->bone_sketching_convert]); + 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(G.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, &G.scene->toolsettings->skgen_length_limit,0.1,50.0, 10, 0, "Maximum length of the subdivided bones"); + 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, &G.scene->toolsettings->skgen_correlation_limit,0.0, 1.0, 0.01, 0, "Correlation threshold for subdivision"); + 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, &G.scene->toolsettings->skgen_subdivision_number,1, 100, 1, 5, "Number of subdivided bones"); + 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_DIFF, "No", 70, yco, 40,19, &G.scene->toolsettings->skgen_retarget_roll, 0, 0, 0, 0, "No special roll treatment"); - uiDefButC(block, ROW, B_DIFF, "View", 110, yco, 50,19, &G.scene->toolsettings->skgen_retarget_roll, 0, SK_RETARGET_ROLL_VIEW, 0, 0, "Roll bones perpendicular to view"); - uiDefButC(block, ROW, B_DIFF, "Joint", 160, yco, 50,19, &G.scene->toolsettings->skgen_retarget_roll, 0, SK_RETARGET_ROLL_JOINT, 0, 0, "Roll bones relative to joint bend"); + 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); @@ -1650,35 +1648,36 @@ static void view3d_panel_bonesketch_spaces(short cntrl) uiBlockBeginAlign(block); /* button here to select what to do (copy or not), template, ...*/ - BIF_makeListTemplates(); - template_index = BIF_currentTemplate(); + BIF_makeListTemplates(C); + template_index = BIF_currentTemplate(C); - but = uiDefButI(block, MENU, B_REDR, BIF_listTemplates(), 10,yco,200,19, &template_index, 0, 0, 0, 0, "Template"); + 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_DIFF, "A:", 10, yco, 66,19, &G.scene->toolsettings->skgen_retarget_angle_weight, 0, 10, 1, 0, "Angle Weight"); - uiDefButF(block, NUM, B_DIFF, "L:", 76, yco, 67,19, &G.scene->toolsettings->skgen_retarget_length_weight, 0, 10, 1, 0, "Length Weight"); - uiDefButF(block, NUM, B_DIFF, "D:", 143,yco, 67,19, &G.scene->toolsettings->skgen_retarget_distance_weight, 0, 10, 1, 0, "Distance Weight"); + 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_DIFF,"S:", 10, yco, 90, 20, G.scene->toolsettings->skgen_side_string, 0.0, 8.0, 0, 0, "Text to replace &S with"); - uiDefBut(block, TEX,B_DIFF,"N:", 100, yco, 90, 20, G.scene->toolsettings->skgen_num_string, 0.0, 8.0, 0, 0, "Text to replace &N with"); - uiDefIconButBitC(block, TOG, SK_RETARGET_AUTONAME, B_DIFF, ICON_AUTO,190,yco,20,20, &G.scene->toolsettings->skgen_retarget_options, 0, 0, 0, 0, "Use Auto Naming"); + 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(); + nb_joints = BIF_nbJointsTemplate(C); if (nb_joints == -1) { - nb_joints = G.totvertsel; + //XXX + //nb_joints = G.totvertsel; } - bone_name = BIF_nameBoneTemplate(); + bone_name = BIF_nameBoneTemplate(C); BLI_snprintf(joint_label, 32, "%i joints: %s", nb_joints, bone_name); @@ -1689,12 +1688,11 @@ static void view3d_panel_bonesketch_spaces(short cntrl) uiBlockEndAlign(block); - uiDefButBitS(block, TOG, SCE_SNAP_PEEL_OBJECT, B_DIFF, "Peel Objects", 10, yco, 200, 20, &G.scene->snap_flag, 0, 0, 0, 0, "Peel whole objects as one"); + uiDefButBitS(block, TOG, SCE_SNAP_PEEL_OBJECT, B_NOP, "Peel Objects", 10, yco, 200, 20, &scene->snap_flag, 0, 0, 0, 0, "Peel whole objects as one"); if(yco < 0) uiNewPanelHeight(block, height-yco); } } -#endif void view3d_buttons_area_defbuts(const bContext *C, ARegion *ar) { @@ -1708,7 +1706,8 @@ void view3d_buttons_area_defbuts(const bContext *C, ARegion *ar) view3d_panel_transform_spaces(C, ar, 0); if(0) view3d_panel_gpencil(C, ar, 0); - // XXX etch-a-ton view3d_panel_bonesketch_spaces(C, ar, 0); + + view3d_panel_bonesketch_spaces(C, ar, 0); uiDrawPanels(C, 1); /* 1 = align */ uiMatchPanelsView2d(ar); /* sets v2d->totrct */ diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 7531193dc92..00843a58ba7 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2053,7 +2053,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) // if (v3d->flag2 & V3D_DISPGP) // draw_gpencil_3dview(ar, 1); - // XXX etch-a-ton BDR_drawSketch(); + BDR_drawSketch(C); ED_region_pixelspace(ar); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 072aab55ed4..2fee0581f42 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -70,9 +70,7 @@ #include "ED_mesh.h" #include "ED_screen.h" #include "ED_view3d.h" - -// XXX etch-a-ton #include "BIF_sketch.h" -// XXX etch-a-ton #include "BDR_sketch.h" +#include "ED_armature.h" #include "UI_interface.h" #include "UI_resources.h" @@ -1145,12 +1143,13 @@ short view3d_opengl_select(ViewContext *vc, unsigned int *buffer, unsigned int b draw_object(scene, ar, v3d, BASACT, DRAW_PICKING|DRAW_CONSTCOLOR); } else if((vc->obedit && vc->obedit->type==OB_ARMATURE)) { - /* XXX etch-a-ton if(BIF_fullSketchMode()) { - BDR_drawSketchNames(); - } - else*/ { + /* XXX etch-a-ton */ +// if(BIF_fullSketchMode(C)) { +// BDR_drawSketchNames(C); +// } +// else { draw_object(scene, ar, v3d, BASACT, DRAW_PICKING|DRAW_CONSTCOLOR); - } +// } } else { Base *base; |