diff options
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_buttons.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 62 |
1 files changed, 22 insertions, 40 deletions
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 9b05f5b25b2..06320f871da 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -36,6 +36,7 @@ #include "DNA_armature_types.h" #include "DNA_curve_types.h" #include "DNA_camera_types.h" +#include "DNA_gpencil_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" #include "DNA_meta_types.h" @@ -81,6 +82,7 @@ #include "ED_armature.h" #include "ED_curve.h" #include "ED_image.h" +#include "ED_gpencil.h" #include "ED_keyframing.h" #include "ED_mesh.h" #include "ED_object.h" @@ -224,7 +226,7 @@ static void v3d_editvertex_buts(const bContext *C, uiBlock *block, View3D *v3d, nu= cu->editnurb->first; while(nu) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -407,7 +409,7 @@ static void v3d_editvertex_buts(const bContext *C, uiBlock *block, View3D *v3d, nu= cu->editnurb->first; while(nu) { - if((nu->type & 7)==CU_BEZIER) { + if(nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) { @@ -510,7 +512,7 @@ static void v3d_posearmature_buts(uiBlock *block, View3D *v3d, Object *ob, float uiButSetFunc(but, validate_bonebutton_cb, bone, NULL); uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob); - QuatToEul(pchan->quat, tfp->ob_eul); + QuatToEulO(pchan->quat, tfp->ob_eul, pchan->rotmode); // XXX? tfp->ob_eul[0]*= 180.0/M_PI; tfp->ob_eul[1]*= 180.0/M_PI; tfp->ob_eul[2]*= 180.0/M_PI; @@ -658,7 +660,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) return; /* no notifier! */ case B_OBJECTPANEL: - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); break; case B_OBJECTPANELROT: @@ -666,7 +668,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) ob->rot[0]= M_PI*tfp->ob_eul[0]/180.0; ob->rot[1]= M_PI*tfp->ob_eul[1]/180.0; ob->rot[2]= M_PI*tfp->ob_eul[2]/180.0; - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } break; @@ -704,7 +706,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) VECCOPY(ob->size, tfp->ob_scale); } - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } break; @@ -750,14 +752,14 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) /* prevent multiple B_OBJECTPANELDIMS events to keep scaling, cycling with TAB on buttons can cause that */ VECCOPY(tfp->ob_dims, old_dims); - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } break; case B_OBJECTPANELMEDIAN: if(ob) { v3d_editvertex_buts(C, NULL, v3d, ob, 1.0); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } break; @@ -768,7 +770,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) ob->parent= NULL; else { DAG_scene_sort(scene); - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } } break; @@ -839,13 +841,13 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) eul[0]= M_PI*tfp->ob_eul[0]/180.0; eul[1]= M_PI*tfp->ob_eul[1]/180.0; eul[2]= M_PI*tfp->ob_eul[2]/180.0; - EulToQuat(eul, pchan->quat); + EulOToQuat(eul, pchan->rotmode, pchan->quat); // xxx? } /* no break, pass on */ case B_ARMATUREPANEL2: { ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } break; case B_TRANSFORMSPACEADD: @@ -897,8 +899,8 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) Mesh *me= ob->data; int a; for(a=0; a<me->totvert; a++) - remove_vert_defgroup (ob, defGroup, a); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + ED_vgroup_vert_remove (ob, defGroup, a); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } break; @@ -1199,33 +1201,6 @@ static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) // VIEW3 } #endif -#if 0 -static void view3d_panel_gpencil(const bContext *C, Panel *pa) -{ - View3D *v3d= CTX_wm_view3d(C); - uiBlock *block; - - block= uiLayoutFreeBlock(pa->layout); - - /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */ - if (v3d->flag2 & V3D_DISPGP) { -// if (v3d->gpd == NULL) -// XXX gpencil_data_setactive(ar, gpencil_data_addnew()); - } - - if (v3d->flag2 & V3D_DISPGP) { -// XXX bGPdata *gpd= v3d->gpd; - - /* draw button for showing gpencil settings and drawings */ - uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &v3d->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View (draw using Shift-LMB)"); - } - else { - uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &v3d->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View"); - uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); - } -} -#endif - static void delete_sketch_armature(bContext *C, void *arg1, void *arg2) { BIF_deleteSketch(C); @@ -1416,6 +1391,12 @@ void view3d_buttons_register(ARegionType *art) strcpy(pt->label, "Transform"); pt->draw= view3d_panel_object; BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil"); + strcpy(pt->idname, "VIEW3D_PT_gpencil"); + strcpy(pt->label, "Grease Pencil"); + pt->draw= gpencil_panel_standard; + BLI_addtail(&art->paneltypes, pt); /* pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel properties"); strcpy(pt->idname, "VIEW3D_PT_properties"); @@ -1470,6 +1451,7 @@ static int view3d_properties(bContext *C, wmOperator *op) void VIEW3D_OT_properties(wmOperatorType *ot) { ot->name= "Properties"; + ot->description= "Display the properties panel."; ot->idname= "VIEW3D_OT_properties"; ot->exec= view3d_properties; |