4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2004-2008 Blender Foundation.
21 * All rights reserved.
24 * Contributor(s): Blender Foundation
26 * ***** END GPL LICENSE BLOCK *****
33 #include "DNA_armature_types.h"
35 #include "DNA_image_types.h"
36 #include "DNA_meshdata_types.h"
37 #include "DNA_mesh_types.h"
38 #include "DNA_object_types.h"
39 #include "DNA_space_types.h"
40 #include "DNA_scene_types.h"
41 #include "DNA_screen_types.h"
42 #include "DNA_texture_types.h"
43 #include "DNA_userdef_types.h" /* U.smooth_viewtx */
44 #include "DNA_view3d_types.h"
45 #include "DNA_windowmanager_types.h"
47 #include "RNA_access.h"
49 #include "MEM_guardedalloc.h"
51 #include "BKE_action.h"
52 #include "BKE_brush.h"
53 #include "BKE_context.h"
54 #include "BKE_curve.h"
55 #include "BKE_depsgraph.h"
56 #include "BKE_displist.h"
57 #include "BKE_effect.h"
58 #include "BKE_global.h"
59 #include "BKE_image.h"
60 #include "BKE_library.h"
63 #include "BKE_modifier.h"
64 #include "BKE_particle.h"
65 #include "BKE_screen.h"
66 #include "BKE_utildefines.h" /* for VECCOPY */
68 #include "ED_armature.h"
69 #include "ED_particle.h"
70 #include "ED_object.h"
73 #include "ED_screen.h"
74 #include "ED_transform.h"
80 #include "RNA_access.h"
81 #include "RNA_define.h"
84 #include "BIF_glutil.h"
86 #include "BLI_arithb.h"
87 #include "BLI_blenlib.h"
88 #include "BLI_editVert.h"
90 #include "UI_interface.h"
91 #include "UI_interface_icons.h"
92 #include "UI_resources.h"
93 #include "UI_view2d.h"
95 #include "view3d_intern.h"
99 * This is a bit of a dodgy hack to enable a 'mode' menu with icons+labels
100 * rather than those buttons.
101 * I know the implementation's not good - it's an experiment to see if this
102 * approach would work well
104 * This can be cleaned when I make some new 'mode' icons.
107 #define V3D_OBJECTMODE_SEL ICON_OBJECT_DATA
108 #define V3D_EDITMODE_SEL ICON_EDITMODE_HLT
109 #define V3D_SCULPTMODE_SEL ICON_SCULPTMODE_HLT
110 #define V3D_FACESELECT_SEL ICON_FACESEL_HLT /* this is not a mode anymore - just a switch */
111 #define V3D_VERTEXPAINTMODE_SEL ICON_VPAINT_HLT
112 #define V3D_TEXTUREPAINTMODE_SEL ICON_TPAINT_HLT
113 #define V3D_WEIGHTPAINTMODE_SEL ICON_WPAINT_HLT
114 #define V3D_POSEMODE_SEL ICON_POSE_HLT
115 #define V3D_PARTICLEEDITMODE_SEL ICON_ANIM
117 #define TEST_EDITMESH if(obedit==0) return; \
118 if( (v3d->lay & obedit->lay)==0 ) return;
121 static void countall(void) {}
122 extern void borderselect();
123 static int retopo_mesh_paint_check() {return 0;}
125 /* view3d handler codes */
126 #define VIEW3D_HANDLER_BACKGROUND 1
127 #define VIEW3D_HANDLER_PROPERTIES 2
128 #define VIEW3D_HANDLER_OBJECT 3
129 #define VIEW3D_HANDLER_PREVIEW 4
130 #define VIEW3D_HANDLER_MULTIRES 5
131 #define VIEW3D_HANDLER_TRANSFORM 6
132 #define VIEW3D_HANDLER_GREASEPENCIL 7
133 #define VIEW3D_HANDLER_BONESKETCH 8
135 /* end XXX ************* */
137 static void ED_toggle_paint_modes(bContext *C, int mode)
139 if(mode & G_TEXTUREPAINT)
140 WM_operator_name_call(C, "PAINT_OT_texture_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
141 if(mode & G_VERTEXPAINT)
142 WM_operator_name_call(C, "PAINT_OT_vertex_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
143 else if(mode & G_WEIGHTPAINT)
144 WM_operator_name_call(C, "PAINT_OT_weight_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL);
146 if(mode & G_PARTICLEEDIT)
147 WM_operator_name_call(C, "PARTICLE_OT_particle_edit_toggle", WM_OP_EXEC_REGION_WIN, NULL);
150 /* well... in this file a lot of view mode manipulation happens, so let's have it defined here */
151 int ED_view3d_exit_paint_modes(bContext *C)
155 ED_toggle_paint_modes(C, G.f);
157 G.f &= ~(G_VERTEXPAINT+G_TEXTUREPAINT+G_WEIGHTPAINT+G_PARTICLEEDIT);
162 void ED_view3d_restore_paint_modes(struct bContext *C, int mode)
164 ED_toggle_paint_modes(C, mode);
167 static void do_view3d_header_buttons(bContext *C, void *arg, int event);
169 #define B_SCENELOCK 101
172 #define B_VIEWBUT 104
174 #define B_VIEWRENDER 106
175 #define B_STARTGAME 107
176 #define B_MODESELECT 108
178 #define B_SEL_VERT 110
179 #define B_SEL_EDGE 111
180 #define B_SEL_FACE 112
181 #define B_SEL_PATH 113
182 #define B_SEL_POINT 114
183 #define B_SEL_END 115
184 #define B_MAN_TRANS 116
185 #define B_MAN_ROT 117
186 #define B_MAN_SCALE 118
188 #define B_MAN_MODE 120
189 #define B_VIEW_BUTSEDIT 121
192 #define B_ACTCOPY 124
193 #define B_ACTPASTE 125
194 #define B_ACTPASTEFLIP 126
199 static RegionView3D *wm_region_view3d(const bContext *C)
201 ScrArea *sa= CTX_wm_area(C);
203 /* XXX handle foursplit? */
204 for(ar= sa->regionbase.first; ar; ar= ar->next)
205 if(ar->regiontype==RGN_TYPE_WINDOW)
206 return ar->regiondata;
210 // XXX quickly ported across
211 static void handle_view3d_lock(bContext *C)
213 Scene *scene= CTX_data_scene(C);
214 ScrArea *sa= CTX_wm_area(C);
215 View3D *v3d= CTX_wm_view3d(C);
217 if (v3d != NULL && sa != NULL) {
218 if(v3d->localview==0 && v3d->scenelock && sa->spacetype==SPACE_VIEW3D) {
221 scene->lay= v3d->lay;
222 scene->camera= v3d->camera;
224 //copy_view3d_lock(REDRAW);
229 /* XXX; all this context stuff... should become operator */
230 void do_layer_buttons(bContext *C, short event)
232 wmWindow *win= CTX_wm_window(C);
233 Scene *scene= CTX_data_scene(C);
234 ScrArea *sa= CTX_wm_area(C);
235 View3D *v3d= sa->spacedata.first;
236 static int oldlay= 1;
237 short shift, alt, ctrl;
239 shift= win->eventstate->shift;
240 alt= win->eventstate->alt;
241 ctrl= win->eventstate->ctrl;
244 if(v3d->localview) return;
246 if(event==-1 && ctrl) {
247 v3d->scenelock= !v3d->scenelock;
248 do_view3d_header_buttons(C, NULL, B_SCENELOCK);
249 } else if (event<0) {
250 if(v3d->lay== (1<<20)-1) {
251 if(event==-2 || shift) v3d->lay= oldlay;
258 if(v3d->scenelock) handle_view3d_lock(C);
260 /* new layers might need unflushed events events */
261 DAG_scene_update_flags(scene, v3d->lay); /* tags all that moves and flushes */
265 if(event<11) event+= 10;
268 if(v3d->lay & (1<<event)) v3d->lay -= (1<<event);
269 else v3d->lay += (1<<event);
271 do_view3d_header_buttons(C, NULL, event+B_LAY);
273 ED_area_tag_redraw(sa);
275 if(v3d->drawtype == OB_SHADED) reshadeall_displist(scene);
278 static int layers_exec(bContext *C, wmOperator *op)
280 Scene *scene= CTX_data_scene(C);
281 ScrArea *sa= CTX_wm_area(C);
282 View3D *v3d= sa->spacedata.first;
283 int nr= RNA_int_get(op->ptr, "nr");
286 return OPERATOR_CANCELLED;
289 if(RNA_boolean_get(op->ptr, "extend"))
294 /* set active layer, ensure to always have one */
295 if(v3d->lay & (1<<nr))
297 else if((v3d->lay & v3d->layact)==0) {
301 if(v3d->lay & (1<<bit)) {
309 if(v3d->scenelock) handle_view3d_lock(C);
311 /* new layers might need unflushed events events */
312 DAG_scene_update_flags(scene, v3d->lay); /* tags all that moves and flushes */
314 ED_area_tag_redraw(sa);
316 return OPERATOR_FINISHED;
319 /* applies shift and alt, lazy coding or ok? :) */
320 /* the local per-keymap-entry keymap will solve it */
321 static int layers_invoke(bContext *C, wmOperator *op, wmEvent *event)
323 if(event->ctrl || event->oskey)
324 return OPERATOR_PASS_THROUGH;
327 RNA_boolean_set(op->ptr, "extend", 1);
330 int nr= RNA_int_get(op->ptr, "nr") + 10;
331 RNA_int_set(op->ptr, "nr", nr);
335 return OPERATOR_FINISHED;
338 void VIEW3D_OT_layers(wmOperatorType *ot)
342 ot->idname= "VIEW3D_OT_layers";
345 ot->invoke= layers_invoke;
346 ot->exec= layers_exec;
347 ot->poll= ED_operator_view3d_active;
350 ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
352 RNA_def_int(ot->srna, "nr", 1, 0, 20, "Number", "", 0, 20);
353 RNA_def_boolean(ot->srna, "extend", 0, "Extend", "");
358 static void do_view3d_view_camerasmenu(bContext *C, void *arg, int event)
360 Scene *scene= CTX_data_scene(C);
365 /* Set Active Object as Active Camera */
366 /* XXX ugly hack alert */
367 // G.qual |= LR_CTRLKEY;
368 // persptoetsen(PAD0);
369 // G.qual &= ~LR_CTRLKEY;
372 for( base = FIRSTBASE; base; base = base->next ) {
373 if (base->object->type == OB_CAMERA) {
377 /* XXX use api call! */
388 static uiBlock *view3d_view_camerasmenu(bContext *C, ARegion *ar, void *arg_unused)
390 Scene *scene= CTX_data_scene(C);
393 short yco= 0, menuwidth=120;
397 block= uiBeginBlock(C, ar, "view3d_view_camerasmenu", UI_EMBOSSP);
398 uiBlockSetButmFunc(block, do_view3d_view_camerasmenu, NULL);
400 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Active Object as Active Camera|Ctrl NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
402 uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
404 for( base = FIRSTBASE; base; base = base->next ) {
405 if (base->object->type == OB_CAMERA) {
408 strcpy(camname, base->object->id.name+2);
409 if (base->object == scene->camera) strcat(camname, " (Active)");
411 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, camname, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, i, "");
415 uiBlockSetDirection(block, UI_RIGHT);
416 uiTextBoundsBlock(block, 50);
422 static void do_view3d_view_cameracontrolsmenu(bContext *C, void *arg, int event)
425 case 0: /* Orbit Left */
428 case 1: /* Orbit Right */
431 case 2: /* Orbit Up */
434 case 3: /* Orbit Down */
437 case 4: /* Pan left */
438 /* XXX ugly hack alert */
439 // G.qual |= LR_CTRLKEY;
441 // G.qual &= ~LR_CTRLKEY;
443 case 5: /* Pan right */
444 /* XXX ugly hack alert */
445 // G.qual |= LR_CTRLKEY;
447 // G.qual &= ~LR_CTRLKEY;
450 /* ugly hack alert */
451 // G.qual |= LR_CTRLKEY;
453 // G.qual &= ~LR_CTRLKEY;
455 case 7: /* Pan down */
456 /* ugly hack alert */
457 // G.qual |= LR_CTRLKEY;
459 // G.qual &= ~LR_CTRLKEY;
461 case 8: /* Zoom In */
462 persptoetsen(PADPLUSKEY);
464 case 9: /* Zoom Out */
465 persptoetsen(PADMINUS);
467 case 10: /* Reset Zoom */
468 persptoetsen(PADENTER);
470 case 11: /* Camera Fly mode */
477 static uiBlock *view3d_view_cameracontrolsmenu(bContext *C, ARegion *ar, void *arg_unused)
479 /* static short tog=0; */
481 short yco= 0, menuwidth=120;
483 block= uiBeginBlock(C, ar, "view3d_view_cameracontrolsmenu", UI_EMBOSSP);
484 uiBlockSetButmFunc(block, do_view3d_view_cameracontrolsmenu, NULL);
486 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera Fly Mode|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
488 uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
490 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Left|NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
491 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Right|NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
492 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Up|NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
493 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Down|NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
495 uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
497 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Left|Ctrl NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
498 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Right|Ctrl NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
499 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Up|Ctrl NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
500 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Down|Ctrl NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
502 uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, "");
504 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
505 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
506 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Zoom|NumPad Enter", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
508 uiBlockSetDirection(block, UI_RIGHT);
509 uiTextBoundsBlock(block, 50);
513 static void do_view3d_view_alignviewmenu(bContext *C, void *arg, int event)
515 Scene *scene= CTX_data_scene(C);
516 ScrArea *sa= CTX_wm_area(C);
517 View3D *v3d= sa->spacedata.first;
518 Object *obedit = CTX_data_edit_object(C);
523 case 0: /* Align View to Selected (edit/faceselect mode) */
526 if ((obedit) && (obedit->type == OB_MESH)) {
527 editmesh_align_view_to_selected(v3d, event + 1);
529 else if (FACESEL_PAINT_TEST) {
530 Object *obact= OBACT;
531 if (obact && obact->type==OB_MESH) {
532 Mesh *me= obact->data;
535 // XXX faceselect_align_view_to_selected(v3d, me, event + 1);
536 ED_area_tag_redraw(sa);
541 case 3: /* Center View to Cursor */
542 curs= give_cursor(scene, v3d);
543 v3d->ofs[0]= -curs[0];
544 v3d->ofs[1]= -curs[1];
545 v3d->ofs[2]= -curs[2];
546 ED_area_tag_redraw(sa);
548 case 4: /* Align Active Camera to View */
549 /* XXX This ugly hack is a symptom of the nasty persptoetsen function,
550 * but at least it works for now.
552 // G.qual |= LR_CTRLKEY|LR_ALTKEY;
554 // G.qual &= ~(LR_CTRLKEY|LR_ALTKEY);
556 case 5: /* Align View to Selected (object mode) */
557 // XXX mainqenter(PADASTERKEY, 1);
559 case 6: /* Center View and Cursor to Origin */
560 WM_operator_name_call(C, "VIEW3D_OT_view_center", WM_OP_EXEC_REGION_WIN, NULL);
561 curs= give_cursor(scene, v3d);
562 curs[0]=curs[1]=curs[2]= 0.0;
567 static uiBlock *view3d_view_alignviewmenu(bContext *C, ARegion *ar, void *arg_unused)
569 /* static short tog=0; */
571 Object *obedit = CTX_data_edit_object(C);
572 short yco= 0, menuwidth=120;
574 block= uiBeginBlock(C, ar, "view3d_view_alignviewmenu", UI_EMBOSSP);
575 uiBlockSetButmFunc(block, do_view3d_view_alignviewmenu, NULL);
577 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View to Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
578 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor and View All|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
579 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Ctrl Alt NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
581 if (((obedit) && (obedit->type == OB_MESH)) || (FACESEL_PAINT_TEST)) {
582 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Top)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
583 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Front)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
584 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Side)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
586 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected|NumPad *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
589 uiBlockSetDirection(block, UI_RIGHT);
590 uiTextBoundsBlock(block, 50);
596 static uiBlock *view3d_view_spacehandlers(bContext *C, ARegion *ar, void *arg_unused)
603 static void do_view3d_viewmenu(bContext *C, void *arg, int event)
617 case 5: /* Perspective */
619 case 6: /* Orthographic */
621 case 7: /* Local View */
623 case 8: /* Global View */
625 case 9: /* View All (Home) */
626 WM_operator_name_call(C, "VIEW3D_OT_view_all", WM_OP_EXEC_REGION_WIN, NULL);
628 case 11: /* View Selected */
629 WM_operator_name_call(C, "VIEW3D_OT_view_center", WM_OP_EXEC_REGION_WIN, NULL);
631 case 13: /* Play Back Animation */
633 case 15: /* Background Image... */
634 // add_blockhandler(sa, VIEW3D_HANDLER_BACKGROUND, UI_PNL_UNSTOW);
636 case 16: /* View Panel */
637 // add_blockhandler(sa, VIEW3D_HANDLER_PROPERTIES, UI_PNL_UNSTOW);
639 case 17: /* Set Clipping Border */
640 WM_operator_name_call(C, "VIEW3D_OT_clip_border", WM_OP_INVOKE_REGION_WIN, NULL);
642 case 18: /* render preview */
643 // toggle_blockhandler(sa, VIEW3D_HANDLER_PREVIEW, 0);
645 case 19: /* zoom within border */
646 // view3d_border_zoom();
648 case 20: /* Transform Space Panel */
649 // add_blockhandler(sa, VIEW3D_HANDLER_TRANSFORM, UI_PNL_UNSTOW);
651 case 21: /* Grease Pencil */
652 // add_blockhandler(sa, VIEW3D_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
654 case 22: /* View all layers */
655 do_layer_buttons(C, -2);
662 static uiBlock *view3d_viewmenu(bContext *C, ARegion *ar, void *arg_unused)
664 ScrArea *sa= CTX_wm_area(C);
665 View3D *v3d= sa->spacedata.first;
666 RegionView3D *rv3d= wm_region_view3d(C);
668 short yco= 0, menuwidth=120;
670 block= uiBeginBlock(C, ar, "view3d_viewmenu", UI_EMBOSSP);
671 uiBlockSetButmFunc(block, do_view3d_viewmenu, NULL);
673 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Orientations...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 20, "");
674 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Render Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, "");
675 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 16, "");
676 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Background Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, "");
677 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 21, "");
679 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
681 if ((rv3d->viewbut == 0) && !(rv3d->persp == V3D_CAMOB)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
682 else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
683 if (rv3d->persp == V3D_CAMOB) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
684 else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
685 if (rv3d->viewbut == 1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
686 else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
687 if (rv3d->viewbut == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
688 else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
689 if (rv3d->viewbut == 3) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
690 else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
692 uiDefIconTextBlockBut(block, view3d_view_camerasmenu, NULL, ICON_RIGHTARROW_THIN, "Cameras", 0, yco-=20, 120, 19, "");
694 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
696 if(rv3d->persp==V3D_PERSP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
697 else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
698 if(rv3d->persp==V3D_ORTHO) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
699 else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
701 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
703 if(v3d->lay== (1<<20)-1) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Previous Layers|Shift ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, "");
704 else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show All Layers| ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, "");
706 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
708 if(v3d->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
709 else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
710 if(!v3d->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
711 else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
713 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
715 uiDefIconTextBlockBut(block, view3d_view_cameracontrolsmenu, NULL, ICON_RIGHTARROW_THIN, "View Navigation", 0, yco-=20, 120, 19, "");
716 uiDefIconTextBlockBut(block, view3d_view_alignviewmenu, NULL, ICON_RIGHTARROW_THIN, "Align View", 0, yco-=20, 120, 19, "");
718 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
720 if(rv3d->rflag & RV3D_CLIPPING)
721 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, "");
723 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, "");
724 if (rv3d->persp==V3D_ORTHO) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Within Border...|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 19, "");
725 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
726 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
727 if(!sa->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, "");
728 else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, "");
730 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
732 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, "");
734 #ifndef DISABLE_PYTHON
735 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
736 uiDefIconTextBlockBut(block, view3d_view_spacehandlers, NULL, ICON_RIGHTARROW_THIN, "Space Handler Scripts", 0, yco-=20, 120, 19, "");
739 if(ar->alignment==RGN_ALIGN_TOP) {
740 uiBlockSetDirection(block, UI_DOWN);
743 uiBlockSetDirection(block, UI_TOP);
744 uiBlockFlipOrder(block);
747 uiTextBoundsBlock(block, 50);
754 void do_view3d_select_object_typemenu(bContext *C, void *arg, int event)
757 extern void selectall_type(short obtype);
761 selectall_type(OB_MESH);
764 selectall_type(OB_CURVE);
766 case 3: /* Surface */
767 selectall_type(OB_SURF);
770 selectall_type(OB_MBALL);
772 case 5: /* Armature */
773 selectall_type(OB_ARMATURE);
775 case 6: /* Lattice */
776 selectall_type(OB_LATTICE);
779 selectall_type(OB_FONT);
782 selectall_type(OB_EMPTY);
785 selectall_type(OB_CAMERA);
788 selectall_type(OB_LAMP);
791 do_layer_buttons(C, -2);
796 static uiBlock *view3d_select_object_typemenu(bContext *C, ARegion *ar, void *arg_unused)
799 short yco = 20, menuwidth = 120;
801 block= uiBeginBlock(C, ar, "view3d_select_object_typemenu", UI_EMBOSSP);
802 uiBlockSetButmFunc(block, do_view3d_select_object_typemenu, NULL);
804 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mesh", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
805 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
806 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surface", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
807 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Meta", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
809 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
811 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
812 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
813 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
814 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Empty", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
816 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
818 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
819 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
821 uiBlockSetDirection(block, UI_RIGHT);
822 uiTextBoundsBlock(block, 60);
827 void do_view3d_select_object_layermenu(bContext *C, void *arg, int event)
829 // XXX extern void selectall_layer(unsigned int layernum);
853 // XXX selectall_layer(event);
858 static uiBlock *view3d_select_object_layermenu(bContext *C, ARegion *ar, void *arg_unused)
861 short xco= 0, yco = 20, menuwidth = 22;
863 block= uiBeginBlock(C, ar, "view3d_select_object_layermenu", UI_EMBOSSP);
864 uiBlockSetButmFunc(block, do_view3d_select_object_layermenu, NULL);
866 uiDefBut(block, BUTM, 1, "1", xco, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
867 uiDefBut(block, BUTM, 1, "2", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
868 uiDefBut(block, BUTM, 1, "3", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
869 uiDefBut(block, BUTM, 1, "4", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
870 uiDefBut(block, BUTM, 1, "5", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
872 uiDefBut(block, BUTM, 1, "6", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
873 uiDefBut(block, BUTM, 1, "7", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
874 uiDefBut(block, BUTM, 1, "8", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
875 uiDefBut(block, BUTM, 1, "9", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
876 uiDefBut(block, BUTM, 1, "10", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
878 uiDefBut(block, BUTM, 1, "11", xco, yco-=24, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
879 uiDefBut(block, BUTM, 1, "12", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
880 uiDefBut(block, BUTM, 1, "13", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
881 uiDefBut(block, BUTM, 1, "14", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
882 uiDefBut(block, BUTM, 1, "15", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
884 uiDefBut(block, BUTM, 1, "16", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
885 uiDefBut(block, BUTM, 1, "17", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
886 uiDefBut(block, BUTM, 1, "18", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
887 uiDefBut(block, BUTM, 1, "19", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
888 uiDefBut(block, BUTM, 1, "20", xco+=(menuwidth+1), yco, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
890 uiBlockSetDirection(block, UI_RIGHT);
891 /*uiTextBoundsBlock(block, 100);*/
895 void do_view3d_select_object_linkedmenu(bContext *C, void *arg, int event)
898 case 1: /* Object Ipo */
900 case 3: /* Current Material */
901 case 4: /* Current Texture */
908 static uiBlock *view3d_select_object_linkedmenu(bContext *C, ARegion *ar, void *arg_unused)
911 short yco = 20, menuwidth = 120;
913 block= uiBeginBlock(C, ar, "view3d_select_object_linkedmenu", UI_EMBOSSP);
914 uiBlockSetButmFunc(block, do_view3d_select_object_linkedmenu, NULL);
916 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Ipo|Shift L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
917 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "ObData|Shift L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
918 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Material|Shift L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
919 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Texture|Shift L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
921 uiBlockSetDirection(block, UI_RIGHT);
922 uiTextBoundsBlock(block, 60);
926 void do_view3d_select_object_groupedmenu(bContext *C, void *arg, int event)
930 case 1: /* Children */
931 case 2: /* Immediate Children */
933 case 4: /* Siblings */
935 case 6: /* Objects on Shared Layers */
936 case 7: /* Objects in Same Group */
937 case 8: /* Object Hooks*/
938 case 9: /* Object PassIndex*/
939 case 10: /* Object Color*/
940 case 11: /* Game Properties*/
941 select_object_grouped((short)event);
946 static uiBlock *view3d_select_object_groupedmenu(bContext *C, ARegion *ar, void *arg_unused)
949 short yco = 20, menuwidth = 120;
951 block= uiBeginBlock(C, ar, "view3d_select_object_groupedmenu", UI_EMBOSSP);
952 uiBlockSetButmFunc(block, do_view3d_select_object_groupedmenu, NULL);
954 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Children|Shift G, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
955 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Immediate Children|Shift G, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
956 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Parent|Shift G, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
957 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Siblings (Shared Parent)|Shift G, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
958 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects of Same Type|Shift G, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
959 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects on Shared Layers|Shift G, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
960 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects in Same Group|Shift G, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
961 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Hooks|Shift G, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
962 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object PassIndex|Shift G, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
963 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Color|Shift G, 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
964 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Game Properties|Shift G, Alt+1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
966 uiBlockSetDirection(block, UI_RIGHT);
967 uiTextBoundsBlock(block, 60);
973 static void view3d_select_objectmenu(bContext *C, uiLayout *layout, void *arg_unused)
975 uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
979 uiItemO(layout, "Select/Deselect All", 0, "OBJECT_OT_select_all_toggle");
980 uiItemO(layout, "Inverse", 0, "OBJECT_OT_select_inverse");
981 uiItemO(layout, "Random", 0, "OBJECT_OT_select_random");
982 uiItemO(layout, "Select All by Layer", 0, "OBJECT_OT_select_by_layer");
983 uiItemMenuEnumO(layout, "Select All by Type", 0, "OBJECT_OT_select_by_type", "type");
984 uiItemMenuEnumO(layout, "Select Grouped", 0, "OBJECT_OT_select_grouped", "type");
987 uiDefIconTextBlockBut(block, view3d_select_object_layermenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Layer", 0, yco-=20, 120, 19, "");
988 uiDefIconTextBlockBut(block, view3d_select_object_typemenu, NULL, ICON_RIGHTARROW_THIN, "Select All by Type", 0, yco-=20, 120, 19, "");
992 uiDefIconTextBlockBut(block, view3d_select_object_linkedmenu, NULL, ICON_RIGHTARROW_THIN, "Linked", 0, yco-=20, 120, 19, "");
993 uiDefIconTextBlockBut(block, view3d_select_object_groupedmenu, NULL, ICON_RIGHTARROW_THIN, "Grouped", 0, yco-=20, 120, 19, "");
997 static void view3d_select_meshmenu(bContext *C, uiLayout *layout, void *arg_unused)
999 uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
1003 uiItemO(layout, "Select/Deselect All", 0, "MESH_OT_select_all_toggle");
1004 uiItemO(layout, "Inverse", 0, "MESH_OT_select_inverse");
1008 uiItemO(layout, "Random...", 0, "MESH_OT_select_random"); // Random...
1009 uiItemO(layout, "Sharp Edges", 0, "MESH_OT_edges_select_sharp");
1010 uiItemO(layout, "Linked Flat Faces", 0, "MESH_OT_faces_select_linked_flat");
1014 uiItemEnumO(layout, "Triangles", 0, "MESH_OT_select_by_number_vertices", "type", 3); // Ctrl Alt Shift 3
1015 uiItemEnumO(layout, "Quads", 0, "MESH_OT_select_by_number_vertices", "type", 4); // Ctrl Alt Shift 4
1016 uiItemEnumO(layout, "Loose Verts/Edges", 0, "MESH_OT_select_by_number_vertices", "type", 5); // Ctrl Alt Shift 5
1017 uiItemO(layout, "Similar...", 0, "MESH_OT_select_similar");
1021 uiItemO(layout, "Less", 0, "MESH_OT_select_more");
1022 uiItemO(layout, "More", 0, "MESH_OT_select_less");
1026 uiItemO(layout, "Linked", 0, "MESH_OT_select_linked");
1027 uiItemO(layout, "Vertex Path", 0, "MESH_OT_select_vertex_path"); // W, Alt 7
1028 uiItemO(layout, "Edge Loop", 0, "MESH_OT_loop_multi_select");
1029 uiItemBooleanO(layout, "Edge Ring", 0, "MESH_OT_loop_multi_select", "ring", 1);
1033 uiItemO(layout, NULL, 0, "MESH_OT_loop_to_region"); // Ctrl E 8
1034 uiItemO(layout, NULL, 0, "MESH_OT_region_to_loop"); // Ctrl E 9
1037 static void view3d_select_curvemenu(bContext *C, uiLayout *layout, void *arg_unused)
1039 Object *obedit= CTX_data_edit_object(C);
1041 uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
1042 uiItemO(layout, NULL, 0, "VIEW3D_OT_select_circle");
1046 uiItemO(layout, NULL, 0, "CURVE_OT_select_all_toggle");
1047 uiItemO(layout, NULL, 0, "CURVE_OT_select_inverse");
1048 uiItemO(layout, NULL, 0, "CURVE_OT_select_random"); // Random...
1049 uiItemO(layout, NULL, 0, "CURVE_OT_select_every_nth"); // Every Nth..
1053 if(obedit->type == OB_SURF) {
1054 uiItemO(layout, NULL, 0, "CURVE_OT_select_row");
1057 uiItemO(layout, NULL, 0, "CURVE_OT_de_select_first");
1058 uiItemO(layout, NULL, 0, "CURVE_OT_de_select_last");
1059 uiItemO(layout, NULL, 0, "CURVE_OT_select_next");
1060 uiItemO(layout, NULL, 0, "CURVE_OT_select_previous");
1065 uiItemO(layout, NULL, 0, "CURVE_OT_select_more");
1066 uiItemO(layout, NULL, 0, "CURVE_OT_select_less");
1068 /* commented out because it seems to only like the LKEY method - based on mouse pointer position :( */
1069 /* uiItemO(layout, NULL, 0, "CURVE_OT_select_linked"); */
1072 G.qual |= LR_CTRLKEY;
1073 select_connected_nurb();
1074 G.qual &= ~LR_CTRLKEY;
1079 static void view3d_select_metaballmenu(bContext *C, uiLayout *layout, void *arg_unused)
1081 uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
1083 uiItemO(layout, NULL, 0, "MBALL_OT_select_deselect_all_metaelems");
1084 uiItemO(layout, NULL, 0, "MBALL_OT_select_inverse_metaelems");
1086 uiItemO(layout, NULL, 0, "MBALL_OT_select_random_metaelems");
1089 static void view3d_select_latticemenu(bContext *C, uiLayout *layout, void *arg_unused)
1091 uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
1093 uiItemO(layout, NULL, 0, "LATTICE_OT_select_all_toggle");
1096 static void view3d_select_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused)
1100 uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
1104 uiItemO(layout, "Select/Deselect All", 0, "ARMATURE_OT_select_all_toggle");
1105 uiItemO(layout, "Inverse", 0, "ARMATURE_OT_select_inverse");
1109 uiItemEnumO(layout, "Parent", 0, "ARMATURE_OT_select_hierarchy", "direction", BONE_SELECT_PARENT);
1110 uiItemEnumO(layout, "Child", 0, "ARMATURE_OT_select_hierarchy", "direction", BONE_SELECT_CHILD);
1114 WM_operator_properties_create(&ptr, "ARMATURE_OT_select_hierarchy");
1115 RNA_boolean_set(&ptr, "extend", 1);
1116 RNA_enum_set(&ptr, "direction", BONE_SELECT_PARENT);
1117 uiItemFullO(layout, "Extend Parent", 0, "ARMATURE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN);
1119 WM_operator_properties_create(&ptr, "ARMATURE_OT_select_hierarchy");
1120 RNA_boolean_set(&ptr, "extend", 1);
1121 RNA_enum_set(&ptr, "direction", BONE_SELECT_CHILD);
1122 uiItemFullO(layout, "Extend Child", 0, "ARMATURE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN);
1125 static void view3d_select_posemenu(bContext *C, uiLayout *layout, void *arg_unused)
1129 uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border");
1133 uiItemO(layout, "Select/Deselect All", 0, "POSE_OT_select_all_toggle");
1134 uiItemO(layout, "Inverse", 0, "POSE_OT_select_inverse");
1135 uiItemO(layout, "Constraint Target", 0, "POSE_OT_select_constraint_target");
1139 uiItemEnumO(layout, "Parent", 0, "POSE_OT_select_hierarchy", "direction", BONE_SELECT_PARENT);
1140 uiItemEnumO(layout, "Child", 0, "POSE_OT_select_hierarchy", "direction", BONE_SELECT_CHILD);
1144 WM_operator_properties_create(&ptr, "POSE_OT_select_hierarchy");
1145 RNA_boolean_set(&ptr, "extend", 1);
1146 RNA_enum_set(&ptr, "direction", BONE_SELECT_PARENT);
1147 uiItemFullO(layout, "Extend Parent", 0, "POSE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN);
1149 WM_operator_properties_create(&ptr, "POSE_OT_select_hierarchy");
1150 RNA_boolean_set(&ptr, "extend", 1);
1151 RNA_enum_set(&ptr, "direction", BONE_SELECT_CHILD);
1152 uiItemFullO(layout, "Extend Child", 0, "POSE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN);
1155 void do_view3d_select_faceselmenu(bContext *C, void *arg, int event)
1158 /* events >= 6 are registered bpython scripts */
1159 #ifndef DISABLE_PYTHON
1160 if (event >= 6) BPY_menu_do_python(PYMENU_FACESELECT, event - 6);
1164 case 0: /* border select */
1167 case 2: /* Select/Deselect all */
1168 deselectall_tface();
1170 case 3: /* Select Inverse */
1173 case 4: /* Select Linked */
1174 select_linked_tfaces(2);
1180 static uiBlock *view3d_select_faceselmenu(bContext *C, ARegion *ar, void *arg_unused)
1183 short yco= 0, menuwidth=120;
1184 #ifndef DISABLE_PYTHON
1185 // XXX BPyMenu *pym;
1189 block= uiBeginBlock(C, ar, "view3d_select_faceselmenu", UI_EMBOSSP);
1190 uiBlockSetButmFunc(block, do_view3d_select_faceselmenu, NULL);
1192 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
1194 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1196 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1197 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Inverse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1199 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1200 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Linked Faces|Ctrl L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
1202 #ifndef DISABLE_PYTHON
1203 // uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1205 /* note that we account for the 6 previous entries with i+6: */
1206 // for (pym = BPyMenuTable[PYMENU_FACESELECT]; pym; pym = pym->next, i++) {
1207 // uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20,
1208 // menuwidth, 19, NULL, 0.0, 0.0, 1, i+6,
1209 // pym->tooltip?pym->tooltip:pym->filename);
1213 if(ar->alignment==RGN_ALIGN_TOP) {
1214 uiBlockSetDirection(block, UI_DOWN);
1217 uiBlockSetDirection(block, UI_TOP);
1218 uiBlockFlipOrder(block);
1221 uiTextBoundsBlock(block, 50);
1225 static void view3d_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
1227 uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_grid");
1228 uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_cursor");
1229 uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_center");
1233 uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_selected");
1234 uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_grid");
1235 uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_active");
1239 void do_view3d_transform_moveaxismenu(bContext *C, void *arg, int event)
1248 case 0: /* X Global */
1249 initTransform(TFM_TRANSLATION, CTX_NONE);
1250 BIF_setSingleAxisConstraint(mat[0], " X");
1253 case 1: /* Y Global */
1254 initTransform(TFM_TRANSLATION, CTX_NONE);
1255 BIF_setSingleAxisConstraint(mat[1], " Y");
1258 case 2: /* Z Global */
1259 initTransform(TFM_TRANSLATION, CTX_NONE);
1260 BIF_setSingleAxisConstraint(mat[2], " Z");
1263 case 3: /* X Local */
1264 initTransform(TFM_TRANSLATION, CTX_NONE);
1265 BIF_setLocalAxisConstraint('X', " X");
1268 case 4: /* Y Local */
1269 initTransform(TFM_TRANSLATION, CTX_NONE);
1270 BIF_setLocalAxisConstraint('Y', " Y");
1273 case 5: /* Z Local */
1274 initTransform(TFM_TRANSLATION, CTX_NONE);
1275 BIF_setLocalAxisConstraint('Z', " Z");
1282 static uiBlock *view3d_transform_moveaxismenu(bContext *C, ARegion *ar, void *arg_unused)
1285 short yco = 20, menuwidth = 120;
1287 block= uiBeginBlock(C, ar, "view3d_transform_moveaxismenu", UI_EMBOSSP);
1288 uiBlockSetButmFunc(block, do_view3d_transform_moveaxismenu, NULL);
1290 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|G, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
1291 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|G, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
1292 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|G, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1294 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1296 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|G, X, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1297 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|G, Y, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
1298 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|G, Z, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
1301 uiBlockSetDirection(block, UI_RIGHT);
1302 uiTextBoundsBlock(block, 60);
1306 void do_view3d_transform_rotateaxismenu(bContext *C, void *arg, int event)
1315 case 0: /* X Global */
1316 initTransform(TFM_ROTATION, CTX_NONE);
1317 BIF_setSingleAxisConstraint(mat[0], " X");
1320 case 1: /* Y Global */
1321 initTransform(TFM_ROTATION, CTX_NONE);
1322 BIF_setSingleAxisConstraint(mat[1], " Y");
1325 case 2: /* Z Global */
1326 initTransform(TFM_ROTATION, CTX_NONE);
1327 BIF_setSingleAxisConstraint(mat[2], " Z");
1330 case 3: /* X Local */
1331 initTransform(TFM_ROTATION, CTX_NONE);
1332 BIF_setLocalAxisConstraint('X', " X");
1335 case 4: /* Y Local */
1336 initTransform(TFM_ROTATION, CTX_NONE);
1337 BIF_setLocalAxisConstraint('Y', " Y");
1340 case 5: /* Z Local */
1341 initTransform(TFM_ROTATION, CTX_NONE);
1342 BIF_setLocalAxisConstraint('Z', " Z");
1349 static uiBlock *view3d_transform_rotateaxismenu(bContext *C, ARegion *ar, void *arg_unused)
1352 short yco = 20, menuwidth = 120;
1354 block= uiBeginBlock(C, ar, "view3d_transform_rotateaxismenu", UI_EMBOSSP);
1355 uiBlockSetButmFunc(block, do_view3d_transform_rotateaxismenu, NULL);
1357 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|R, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
1358 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|R, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
1359 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|R, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1361 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1363 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|R, X, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1364 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|R, Y, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
1365 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|R, Z, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
1368 uiBlockSetDirection(block, UI_RIGHT);
1369 uiTextBoundsBlock(block, 60);
1373 void do_view3d_transform_scaleaxismenu(bContext *C, void *arg, int event)
1382 case 0: /* X Global */
1383 initTransform(TFM_RESIZE, CTX_NONE);
1384 BIF_setSingleAxisConstraint(mat[0], " X");
1387 case 1: /* Y Global */
1388 initTransform(TFM_RESIZE, CTX_NONE);
1389 BIF_setSingleAxisConstraint(mat[1], " Y");
1392 case 2: /* Z Global */
1393 initTransform(TFM_RESIZE, CTX_NONE);
1394 BIF_setSingleAxisConstraint(mat[2], " Z");
1397 case 3: /* X Local */
1398 initTransform(TFM_RESIZE, CTX_NONE);
1399 BIF_setLocalAxisConstraint('X', " X");
1402 case 4: /* Y Local */
1403 initTransform(TFM_RESIZE, CTX_NONE);
1404 BIF_setLocalAxisConstraint('X', " X");
1407 case 5: /* Z Local */
1408 initTransform(TFM_RESIZE, CTX_NONE);
1409 BIF_setLocalAxisConstraint('X', " X");
1416 static uiBlock *view3d_transform_scaleaxismenu(bContext *C, ARegion *ar, void *arg_unused)
1419 short yco = 20, menuwidth = 120;
1421 block= uiBeginBlock(C, ar, "view3d_transform_scaleaxismenu", UI_EMBOSSP);
1422 uiBlockSetButmFunc(block, do_view3d_transform_scaleaxismenu, NULL);
1424 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|S, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
1425 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|S, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
1426 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|S, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1428 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1430 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|S, X, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1431 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|S, Y, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
1432 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|S, Z, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
1435 uiBlockSetDirection(block, UI_RIGHT);
1436 uiTextBoundsBlock(block, 60);
1442 static void do_view3d_transformmenu(bContext *C, void *arg, int event)
1445 Scene *scene= CTX_data_scene(C);
1446 ToolSettings *ts= CTX_data_tool_settings(C);
1450 initTransform(TFM_TRANSLATION, CTX_NONE);
1454 initTransform(TFM_ROTATION, CTX_NONE);
1458 initTransform(TFM_RESIZE, CTX_NONE);
1465 initTransform(TFM_TOSPHERE, CTX_NONE);
1469 initTransform(TFM_SHEAR, CTX_NONE);
1473 initTransform(TFM_WARP, CTX_NONE);
1477 initTransform(TFM_PUSHPULL, CTX_NONE);
1482 if (obedit->type == OB_MESH)
1483 initTransform(TFM_SHRINKFATTEN, CTX_NONE);
1485 } else error("Only meshes can be shrinked/fattened");
1497 initTransform(TFM_TILT, CTX_NONE);
1501 initTransform(TFM_CURVE_SHRINKFATTEN, CTX_NONE);
1505 ts->snap_flag &= ~SCE_SNAP;
1508 ts->snap_flag |= SCE_SNAP;
1511 ts->snap_target = SCE_SNAP_TARGET_CLOSEST;
1514 ts->snap_target = SCE_SNAP_TARGET_CENTER;
1517 ts->snap_target = SCE_SNAP_TARGET_MEDIAN;
1520 ts->snap_target = SCE_SNAP_TARGET_ACTIVE;
1529 static uiBlock *view3d_transformmenu(bContext *C, ARegion *ar, void *arg_unused)
1531 ToolSettings *ts= CTX_data_tool_settings(C);
1532 Object *obedit = CTX_data_edit_object(C);
1534 short yco = 20, menuwidth = 120;
1536 block= uiBeginBlock(C, ar, "view3d_transformmenu", UI_EMBOSSP);
1537 uiBlockSetButmFunc(block, do_view3d_transformmenu, NULL);
1539 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
1540 uiDefIconTextBlockBut(block, view3d_transform_moveaxismenu, NULL, ICON_RIGHTARROW_THIN, "Grab/Move on Axis", 0, yco-=20, 120, 19, "");
1542 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1543 uiDefIconTextBlockBut(block, view3d_transform_rotateaxismenu, NULL, ICON_RIGHTARROW_THIN, "Rotate on Axis", 0, yco-=20, 120, 19, "");
1545 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1546 uiDefIconTextBlockBut(block, view3d_transform_scaleaxismenu, NULL, ICON_RIGHTARROW_THIN, "Scale on Axis", 0, yco-=20, 120, 19, "");
1548 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1551 if (obedit->type == OB_MESH)
1552 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Along Normals|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
1553 else if (obedit->type == OB_CURVE) {
1554 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Tilt|T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
1555 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shrink/Fatten Radius|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
1558 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Sphere|Ctrl Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
1559 if (obedit) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
1560 else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Shear|Ctrl Shift Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
1561 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Warp|Shift W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
1562 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Push/Pull|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
1565 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1567 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale to Image Aspect Ratio|Alt V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
1570 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1572 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "ObData to Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
1574 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center New", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
1575 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
1576 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align to Transform Orientation|Ctrl Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, "");
1579 if (BIF_snappingSupported(obedit))
1581 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1583 if (ts->snap_flag & SCE_SNAP)
1585 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Grid", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
1586 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
1590 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Grid", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
1591 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
1594 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1596 switch(ts->snap_target)
1598 case SCE_SNAP_TARGET_CLOSEST:
1599 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
1600 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
1601 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
1602 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
1604 case SCE_SNAP_TARGET_CENTER:
1605 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
1606 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
1607 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
1608 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
1610 case SCE_SNAP_TARGET_MEDIAN:
1611 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
1612 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
1613 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
1614 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
1616 case SCE_SNAP_TARGET_ACTIVE:
1617 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Closest", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
1618 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Center", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
1619 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Snap Median", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
1620 uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Snap Active", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 20, "");
1625 uiBlockSetDirection(block, UI_RIGHT);
1626 uiTextBoundsBlock(block, 60);
1631 void do_view3d_object_mirrormenu(bContext *C, void *arg, int event)
1636 initTransform(TFM_MIRROR, CTX_NO_PET);
1640 initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
1641 BIF_setLocalAxisConstraint('X', " on X axis");
1645 initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
1646 BIF_setLocalAxisConstraint('Y', " on Y axis");
1650 initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
1651 BIF_setLocalAxisConstraint('Z', " on Z axis");
1658 static uiBlock *view3d_object_mirrormenu(bContext *C, ARegion *ar, void *arg_unused)
1661 short yco = 20, menuwidth = 120;
1663 block= uiBeginBlock(C, ar, "view3d_object_mirrormenu", UI_EMBOSSP);
1664 uiBlockSetButmFunc(block, do_view3d_object_mirrormenu, NULL);
1666 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Interactive Mirror|Ctrl M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
1667 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1668 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|Ctrl M, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
1669 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|Ctrl M, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1670 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|Ctrl M, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1672 uiBlockSetDirection(block, UI_RIGHT);
1673 uiTextBoundsBlock(block, 60);
1679 static void view3d_edit_object_transformmenu(bContext *C, uiLayout *layout, void *arg_unused)
1682 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Scale/Rotation to ObData|Ctrl A, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
1683 apply_objects_locrot();
1684 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Visual Transform|Ctrl A, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
1685 apply_objects_visual_tx();
1686 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Deformation|Ctrl Shift A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
1687 if(OBACT) object_apply_deform(OBACT);
1689 uiItemO(layout, NULL, 0, "OBJECT_OT_duplicates_make_real");
1693 uiItemO(layout, NULL, 0, "OBJECT_OT_location_clear");
1694 uiItemO(layout, NULL, 0, "OBJECT_OT_rotation_clear");
1695 uiItemO(layout, NULL, 0, "OBJECT_OT_scale_clear");
1696 uiItemO(layout, NULL, 0, "OBJECT_OT_origin_clear");
1700 static void do_view3d_edit_object_makelocalmenu(bContext *C, void *arg, int event)
1713 static uiBlock *view3d_edit_object_makelocalmenu(bContext *C, ARegion *ar, void *arg_unused)
1716 short yco = 20, menuwidth = 120;
1718 block= uiBeginBlock(C, ar, "view3d_edit_object_makelocalmenu", UI_EMBOSSP);
1719 uiBlockSetButmFunc(block, do_view3d_edit_object_makelocalmenu, NULL);
1721 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selected Objects|L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
1722 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selected Objects and Data|L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1723 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "All|L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1725 uiBlockSetDirection(block, UI_RIGHT);
1726 uiTextBoundsBlock(block, 60);
1730 static void do_view3d_edit_object_makelinksmenu(bContext *C, void *arg, int event)
1738 make_links((short)event);
1744 static uiBlock *view3d_edit_object_makelinksmenu(bContext *C, ARegion *ar, void *arg_unused)
1746 Scene *scene= CTX_data_scene(C);
1750 short yco = 20, menuwidth = 120;
1752 block= uiBeginBlock(C, ar, "view3d_edit_object_makelinksmenu", UI_EMBOSSP);
1753 uiBlockSetButmFunc(block, do_view3d_edit_object_makelinksmenu, NULL);
1755 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "To Scene...|Ctrl L, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
1757 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1759 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Ipo|Ctrl L, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
1763 if(ob->type==OB_MESH) {
1764 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mesh Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1765 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1766 } else if(ob->type==OB_CURVE) {
1767 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1768 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1769 } else if(ob->type==OB_FONT) {
1770 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Text Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1771 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1772 } else if(ob->type==OB_SURF) {
1773 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Surface Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1774 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1775 } else if(ob->type==OB_MBALL) {
1776 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1777 } else if(ob->type==OB_CAMERA) {
1778 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1779 } else if(ob->type==OB_LAMP) {
1780 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lamp Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1781 } else if(ob->type==OB_LATTICE) {
1782 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Lattice Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1783 } else if(ob->type==OB_ARMATURE) {
1784 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Armature Data|Ctrl L, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1788 uiBlockSetDirection(block, UI_RIGHT);
1789 uiTextBoundsBlock(block, 60);
1793 static void do_view3d_edit_object_singleusermenu(bContext *C, void *arg, int event)
1797 case 1: /* Object */
1798 single_object_users(1);
1800 case 2: /* Object & ObData */
1801 single_object_users(1);
1802 single_obdata_users(1);
1804 case 3: /* Object & ObData & Materials+Tex */
1805 single_object_users(1);
1806 single_obdata_users(1);
1807 single_mat_users(1); /* also tex */
1809 case 4: /* Materials+Tex */
1810 single_mat_users(1);
1813 single_ipo_users(1);
1817 clear_id_newpoins();
1823 static uiBlock *view3d_edit_object_singleusermenu(bContext *C, ARegion *ar, void *arg_unused)
1827 short yco = 20, menuwidth = 120;
1829 block= uiBeginBlock(C, ar, "view3d_edit_object_singleusermenu", UI_EMBOSSP);
1830 uiBlockSetButmFunc(block, do_view3d_edit_object_singleusermenu, NULL);
1832 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object|U, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
1833 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object & ObData|U, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1834 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object & ObData & Materials+Tex|U, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1835 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Materials+Tex|U, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
1836 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Ipos|U, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
1838 uiBlockSetDirection(block, UI_RIGHT);
1839 uiTextBoundsBlock(block, 60);
1843 static void do_view3d_edit_object_copyattrmenu(bContext *C, void *arg, int event)
1869 // XXX copy_attr((short)event);
1874 static uiBlock *view3d_edit_object_copyattrmenu(bContext *C, ARegion *ar, void *arg_unused)
1876 Scene *scene= CTX_data_scene(C);
1880 short yco = 20, menuwidth = 120;
1882 block= uiBeginBlock(C, ar, "view3d_edit_object_copyattrmenu", UI_EMBOSSP);
1883 uiBlockSetButmFunc(block, do_view3d_edit_object_copyattrmenu, NULL);
1887 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Location|Ctrl C, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
1888 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotation|Ctrl C, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
1889 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Size|Ctrl C, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
1890 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Drawtype|Ctrl C, 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
1891 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Time Offset|Ctrl C, 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
1892 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Dupli|Ctrl C, 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
1894 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1896 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mass|Ctrl C, 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
1897 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Damping|Ctrl C, 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
1898 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "All Physical Attributes|Ctrl C, 11", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");
1899 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Properties|Ctrl C, 9", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
1900 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Logic Bricks|Ctrl C, 10", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
1901 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Protected Transform |Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 29, "");
1903 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
1905 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Constraints|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 22, "");
1906 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "NLA Strips|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 26, "");
1910 if ((ob->type == OB_MESH) || (ob->type == OB_CURVE) || (ob->type == OB_SURF) ||
1911 (ob->type == OB_FONT) || (ob->type == OB_MBALL)) {
1912 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Texture Space|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
1915 if(ob->type == OB_FONT) {
1916 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Font Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 18, "");
1917 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
1918 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve Resolution|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, "");
1920 if(ob->type == OB_CURVE) {
1921 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Bevel Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 19, "");
1922 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Curve Resolution|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 25, "");
1925 if(ob->type==OB_MESH) {
1926 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Subsurf Settings|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 21, "");
1927 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Modifiers ...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 24, "");
1929 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Pass Index|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 30, "");
1932 uiBlockSetDirection(block, UI_RIGHT);
1933 uiTextBoundsBlock(block, 60);
1938 static void view3d_edit_object_parentmenu(bContext *C, uiLayout *layout, void *arg_unused)
1940 uiItemO(layout, "Make Parent...", 0, "OBJECT_OT_parent_set");
1941 uiItemO(layout, "Clear Parent...", 0, "OBJECT_OT_parent_clear");
1944 static void view3d_edit_object_groupmenu(bContext *C, uiLayout *layout, void *arg_unused)
1946 uiItemO(layout, NULL, 0, "GROUP_OT_group_create");
1947 uiItemO(layout, NULL, 0, "GROUP_OT_objects_remove");
1951 uiItemO(layout, NULL, 0, "GROUP_OT_objects_add_active");
1952 uiItemO(layout, NULL, 0, "GROUP_OT_objects_remove_active");
1955 static void view3d_edit_object_trackmenu(bContext *C, uiLayout *layout, void *arg_unused)
1957 uiItemO(layout, "Make Track...", 0, "OBJECT_OT_track_set");
1958 uiItemO(layout, "Clear Track...", 0, "OBJECT_OT_track_clear");
1961 static void view3d_edit_object_constraintsmenu(bContext *C, uiLayout *layout, void *arg_unused)
1963 uiItemO(layout, NULL, 0, "OBJECT_OT_constraint_add_with_targets");
1964 uiItemO(layout, NULL, 0, "OBJECT_OT_constraints_clear");
1967 static void view3d_edit_object_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
1969 uiItemO(layout, "Show Hidden", 0, "OBJECT_OT_restrictview_clear");
1970 uiItemO(layout, "Hide Selected", 0, "OBJECT_OT_restrictview_set");
1971 uiItemBooleanO(layout, "Hide Unselected", 0, "OBJECT_OT_restrictview_set", "unselected", 1);
1975 #ifndef DISABLE_PYTHON
1976 static void do_view3d_edit_object_scriptsmenu(bContext *C, void *arg, int event)
1979 BPY_menu_do_python(PYMENU_OBJECT, event);
1984 static uiBlock *view3d_edit_object_scriptsmenu(bContext *C, ARegion *ar, void *arg_unused)
1987 // short yco = 20, menuwidth = 120;
1988 // XXX BPyMenu *pym;
1991 block= uiBeginBlock(C, ar, "v3d_eobject_pymenu", UI_EMBOSSP);
1992 uiBlockSetButmFunc(block, do_view3d_edit_object_scriptsmenu, NULL);
1994 // for (pym = BPyMenuTable[PYMENU_OBJECT]; pym; pym = pym->next, i++) {
1995 // uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename);
1998 uiBlockSetDirection(block, UI_RIGHT);
1999 uiTextBoundsBlock(block, 60);
2003 #endif /* DISABLE_PYTHON */
2008 static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event)
2010 Scene *scene= CTX_data_scene(C);
2011 ScrArea *sa= CTX_wm_area(C);
2012 View3D *v3d= sa->spacedata.first;
2016 case 0: /* transform properties*/
2017 // XXX mainqenter(NKEY, 1);
2019 case 5: /* make single user */
2022 case 7: /* boolean operation */
2025 case 8: /* join objects */
2028 case 9: /* convert object type */
2031 case 10: /* move to layer */
2034 case 11: /* insert keyframe */
2037 case 16: /* make proxy object*/
2040 case 18: /* delete keyframe */
2047 static void view3d_edit_objectmenu(bContext *C, uiLayout *layout, void *arg_unused)
2050 Object *ob= CTX_data_active_object(C);
2052 uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
2053 uiDefIconTextBlockBut(block, view3d_object_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
2056 uiItemMenuF(layout, "Clear/Apply", 0, view3d_edit_object_transformmenu);
2057 uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
2061 // TODO: these operators may get renamed
2062 uiItemO(layout, NULL, 0, "ANIM_OT_insert_keyframe_menu");
2063 uiItemO(layout, NULL, 0, "ANIM_OT_delete_keyframe_v3d");
2067 uiItemO(layout, NULL, 0, "OBJECT_OT_duplicate");
2068 uiItemBooleanO(layout, "Duplicate Linked", 0, "OBJECT_OT_duplicate", "linked", 1);
2069 uiItemO(layout, NULL, 0, "OBJECT_OT_delete");
2071 uiItemO(layout, NULL, 0, "OBJECT_OT_proxy_make");
2073 uiDefIconTextBlockBut(block, view3d_edit_object_makelinksmenu, NULL, ICON_RIGHTARROW_THIN, "Make Links", 0, yco-=20, 120, 19, "");
2074 uiDefIconTextBlockBut(block, view3d_edit_object_singleusermenu, NULL, ICON_RIGHTARROW_THIN, "Make Single User", 0, yco-=20, 120, 19, "");
2075 uiDefIconTextBlockBut(block, view3d_edit_object_makelocalmenu, NULL, ICON_RIGHTARROW_THIN, "Make Local", 0, yco-=20, 120, 19, "");
2076 uiDefIconTextBlockBut(block, view3d_edit_object_copyattrmenu, NULL, ICON_RIGHTARROW_THIN, "Copy Attributes", 0, yco-=20, 120, 19, "");
2081 uiItemMenuF(layout, "Parent", 0, view3d_edit_object_parentmenu);
2082 uiItemMenuF(layout, "Track", 0, view3d_edit_object_trackmenu);
2083 uiItemMenuF(layout, "Group", 0, view3d_edit_object_groupmenu);
2084 uiItemMenuF(layout, "Constraints", 0, view3d_edit_object_constraintsmenu);
2087 if(ob && ob->type == OB_MESH) {
2088 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Boolean Operation...|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
2091 // join... (added already)
2093 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Object Type...|Alt C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
2097 uiItemO(layout, NULL, 0, "OBJECT_OT_join");
2102 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move to Layer...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");
2105 uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_object_showhidemenu);
2108 #ifndef DISABLE_PYTHON
2109 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
2110 uiDefIconTextBlockBut(block, view3d_edit_object_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, "");
2115 static void view3d_edit_mesh_verticesmenu(bContext *C, uiLayout *layout, void *arg_unused)
2117 uiItemO(layout, "Merge...", 0, "MESH_OT_merge");
2118 uiItemO(layout, "Rip", 0, "MESH_OT_rip");
2119 uiItemO(layout, "Split", 0, "MESH_OT_split");
2120 uiItemO(layout, "Separate", 0, "MESH_OT_separate");
2124 uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth");
2125 uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles");
2130 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); // add_hook_menu();
2131 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); // make_parent();
2135 void do_view3d_edit_mesh_edgesmenu(bContext *C, void *arg, int event)
2138 Scene *scene= CTX_data_scene(C);
2143 case 9: /* Crease SubSurf */
2144 if(!multires_level1_test()) {
2145 initTransform(TFM_CREASE, CTX_EDGE);
2149 case 12: /* Edgeslide */
2152 case 13: /* Edge Loop Delete */
2153 if(EdgeLoopDelete()) {
2155 ED_undo_push(C, "Erase Edge Loop");
2156 DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
2159 case 14: /*Collapse Edges*/
2161 ED_undo_push(C, "Collapse");
2163 case 17: /* Adjust Bevel Weight */
2164 if(!multires_level1_test()) {
2165 initTransform(TFM_BWEIGHT, CTX_EDGE);
2173 static void view3d_edit_mesh_edgesmenu(bContext *C, uiLayout *layout, void *arg_unused)
2175 uiItemO(layout, NULL, 0, "MESH_OT_edge_face_add");
2178 uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em)
2179 uiItemO(layout, "Loop Subdivide...", 0, "MESH_OT_loop_subdivide"); // Ctr R, CutEdgeloop(1);
2180 uiItemO(layout, "Knife Subdivide...", 0, "MESH_OT_loop_subdivide"); // Shift K, KnifeSubdivide(KNIFE_PROMPT);
2185 uiItemO(layout, "Subdivide", 0, "MESH_OT_subdivide");
2186 uiItemFloatO(layout, "Subdivide Smooth", 0, "MESH_OT_subdivide", "smoothness", 1.0f);
2190 uiItemO(layout, "Mark Seam", 0, "MESH_OT_mark_seam");
2191 uiItemBooleanO(layout, "Clear Seam", 0, "MESH_OT_mark_seam", "clear", 1);
2195 uiItemO(layout, "Mark Sharp", 0, "MESH_OT_mark_sharp");
2196 uiItemBooleanO(layout, "Clear Sharp", 0, "MESH_OT_mark_sharp", "clear", 1);
2200 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
2201 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Adjust Bevel Weight|Ctrl Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, "");
2203 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
2204 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Crease SubSurf|Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
2209 uiItemEnumO(layout, "Rotate Edge CW", 0, "MESH_OT_edge_rotate", "direction", 1);
2210 uiItemEnumO(layout, "Rotate Edge CCW", 0, "MESH_OT_edge_rotate", "direction", 2);
2213 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Slide Edge |Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
2214 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Edge Loop|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, "");
2216 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, "");
2220 static void view3d_edit_mesh_facesmenu(bContext *C, uiLayout *layout, void *arg_unused)
2222 uiItemO(layout, NULL, 0, "MESH_OT_edge_face_add");
2223 uiItemO(layout, NULL, 0, "MESH_OT_fill");
2224 uiItemO(layout, NULL, 0, "MESH_OT_beauty_fill");
2228 uiItemO(layout, NULL, 0, "MESH_OT_quads_convert_to_tris");
2229 uiItemO(layout, NULL, 0, "MESH_OT_tris_convert_to_quads");
2230 uiItemO(layout, NULL, 0, "MESH_OT_edge_flip");
2234 uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth");
2235 uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat");
2238 static void view3d_edit_mesh_normalsmenu(bContext *C, uiLayout *layout, void *arg_unused)
2240 uiItemO(layout, "Recalculate Outside", 0, "MESH_OT_normals_make_consistent");
2241 uiItemBooleanO(layout, "Recalculate Inside", 0, "MESH_OT_normals_make_consistent", "inside", 1);
2245 uiItemO(layout, NULL, 0, "MESH_OT_flip_normals");
2249 void do_view3d_edit_mirrormenu(bContext *C, void *arg, int event)
2257 initTransform(TFM_MIRROR, CTX_NO_PET);
2261 initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
2262 BIF_setSingleAxisConstraint(mat[0], " on global X axis");
2266 initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
2267 BIF_setSingleAxisConstraint(mat[1], " on global Y axis");
2271 initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
2272 BIF_setSingleAxisConstraint(mat[2], "on global Z axis");
2276 initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
2277 BIF_setLocalAxisConstraint('X', " on local X axis");
2281 initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
2282 BIF_setLocalAxisConstraint('Y', " on local Y axis");
2286 initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM);
2287 BIF_setLocalAxisConstraint('Z', " on local Z axis");
2293 static uiBlock *view3d_edit_mirrormenu(bContext *C, ARegion *ar, void *arg_unused)
2296 short yco = 20, menuwidth = 120;
2298 block= uiBeginBlock(C, ar, "view3d_edit_mirrormenu", UI_EMBOSSP);
2299 uiBlockSetButmFunc(block, do_view3d_edit_mirrormenu, NULL);
2301 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Interactive Mirror|Ctrl M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
2303 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
2305 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|Ctrl M, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
2306 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|Ctrl M, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
2307 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|Ctrl M, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
2309 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
2311 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|Ctrl M, X X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
2312 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|Ctrl M, Y Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
2313 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|Ctrl M, Z Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
2315 uiBlockSetDirection(block, UI_RIGHT);
2316 uiTextBoundsBlock(block, 60);
2321 static void view3d_edit_mesh_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
2323 uiItemO(layout, NULL, 0, "MESH_OT_reveal");
2324 uiItemO(layout, NULL, 0, "MESH_OT_hide");
2325 uiItemBooleanO(layout, "Hide Unselected", 0, "MESH_OT_hide", "unselected", 1);
2328 #ifndef DISABLE_PYTHON
2330 static void do_view3d_edit_mesh_scriptsmenu(bContext *C, void *arg, int event)
2332 BPY_menu_do_python(PYMENU_MESH, event);
2335 static uiBlock *view3d_edit_mesh_scriptsmenu(bContext *C, ARegion *ar, void *arg_unused)
2338 // short yco = 20, menuwidth = 120;
2339 // XXX BPyMenu *pym;
2342 block= uiBeginBlock(C, ar, "v3d_emesh_pymenu", UI_EMBOSSP);
2343 uiBlockSetButmFunc(block, do_view3d_edit_mesh_scriptsmenu, NULL);
2345 // for (pym = BPyMenuTable[PYMENU_MESH]; pym; pym = pym->next, i++) {
2346 // uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename);
2349 uiBlockSetDirection(block, UI_RIGHT);
2350 uiTextBoundsBlock(block, 60);
2355 #endif /* DISABLE_PYTHON */
2358 static void do_view3d_edit_meshmenu(bContext *C, void *arg, int event)
2360 ScrArea *sa= CTX_wm_area(C);
2364 case 2: /* transform properties */
2365 add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, 0);
2367 case 4: /* insert keyframe */
2370 case 16: /* delete keyframe */
2377 static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused)
2379 Scene *scene= CTX_data_scene(C);
2380 ToolSettings *ts= CTX_data_tool_settings(C);
2383 RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr);
2385 uiItemO(layout, "Undo Editing", 0, "ED_OT_undo");
2386 uiItemO(layout, "Redo Editing", 0, "ED_OT_redo");
2389 uiDefIconTextBlockBut(block, editmode_undohistorymenu, NULL, ICON_RIGHTARROW_THIN, "Undo History", 0, yco-=20, 120, 19, "");
2395 uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
2396 uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, "");
2397 uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
2400 uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
2405 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
2406 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
2411 uiItemO(layout, NULL, 0, "UV_OT_mapping_menu");
2415 uiItemO(layout, NULL, 0, "MESH_OT_extrude");
2416 uiItemO(layout, NULL, 0, "MESH_OT_duplicate");
2417 uiItemO(layout, "Delete...", 0, "MESH_OT_delete");
2421 uiItemMenuF(layout, "Vertices", 0, view3d_edit_mesh_verticesmenu);
2422 uiItemMenuF(layout, "Edges", 0, view3d_edit_mesh_edgesmenu);
2423 uiItemMenuF(layout, "Faces", 0, view3d_edit_mesh_facesmenu);
2424 uiItemMenuF(layout, "Normals", 0, view3d_edit_mesh_normalsmenu);
2428 uiItemR(layout, NULL, 0, &tsptr, "automerge_editing", 0, 0, 0);
2429 uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O
2430 uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O
2434 uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_mesh_showhidemenu);
2437 #ifndef DISABLE_PYTHON
2439 uiDefIconTextBlockBut(block, view3d_edit_mesh_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, "");
2444 static void view3d_edit_curve_controlpointsmenu(bContext *C, uiLayout *layout, void *arg_unused)
2446 Object *obedit= CTX_data_edit_object(C);
2448 if(obedit->type == OB_CURVE) {
2449 uiItemEnumO(layout, NULL, 0, "TFM_OT_transform", "mode", TFM_TILT);
2450 uiItemO(layout, NULL, 0, "CURVE_OT_tilt_clear");
2451 uiItemO(layout, NULL, 0, "CURVE_OT_separate");
2455 uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 1);
2456 uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 3);
2457 uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 2);
2462 // XXX uiItemO(layout, NULL, 0, "OBJECT_OT_make_vertex_parent"); Make VertexParent|Ctrl P
2464 // XXX uiItemO(layout, NULL, 0, "OBJECT_OT_add_hook"); Add Hook| Ctrl H
2468 static void view3d_edit_curve_segmentsmenu(bContext *C, uiLayout *layout, void *arg_unused)
2470 uiItemO(layout, NULL, 0, "CURVE_OT_subdivide");
2471 uiItemO(layout, NULL, 0, "CURVE_OT_switch_direction");
2474 static void view3d_edit_curve_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
2476 uiItemO(layout, NULL, 0, "CURVE_OT_reveal");
2477 uiItemO(layout, NULL, 0, "CURVE_OT_hide");
2478 uiItemBooleanO(layout, "Hide Unselected", 0, "CURVE_OT_hide", "unselected", 1);
2481 static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unused)
2483 Scene *scene= CTX_data_scene(C);
2484 ToolSettings *ts= CTX_data_tool_settings(C);
2487 RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr);
2490 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
2491 uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
2492 uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
2495 uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
2499 // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
2500 // common_insertkey();
2501 // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
2502 // common_deletekey();
2505 uiItemO(layout, NULL, 0, "CURVE_OT_extrude");
2506 uiItemO(layout, NULL, 0, "CURVE_OT_duplicate");
2507 uiItemO(layout, NULL, 0, "CURVE_OT_separate");
2508 uiItemO(layout, NULL, 0, "CURVE_OT_make_segment");
2509 uiItemO(layout, NULL, 0, "CURVE_OT_cyclic_toggle");
2510 uiItemO(layout, NULL, 0, "CURVE_OT_delete"); // Delete...
2514 uiItemMenuF(layout, "Control Points", 0, view3d_edit_curve_controlpointsmenu);
2515 uiItemMenuF(layout, "Segments", 0, view3d_edit_curve_segmentsmenu);
2519 uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O
2520 uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O
2524 uiItemMenuF(layout, "Show/Hide Control Points", 0, view3d_edit_curve_showhidemenu);
2527 static void view3d_edit_metaball_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
2529 uiItemO(layout, NULL, 0, "MBALL_OT_hide_metaelems");
2530 uiItemO(layout, NULL, 0, "MBALL_OT_reveal_metaelems");
2531 uiItemBooleanO(layout, "Hide Unselected", 0, "MBALL_OT_hide_metaelems", "unselected", 1);
2534 static void view3d_edit_metaballmenu(bContext *C, uiLayout *layout, void *arg_unused)
2536 Scene *scene= CTX_data_scene(C);
2537 ToolSettings *ts= CTX_data_tool_settings(C);
2540 RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr);
2542 uiItemO(layout, "Undo Editing", 0, "ED_OT_undo");
2543 uiItemO(layout, "Redo Editing", 0, "ED_OT_redo");
2547 uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
2551 uiItemO(layout, NULL, 0, "MBALL_OT_delete_metaelems");
2552 uiItemO(layout, NULL, 0, "MBALL_OT_duplicate_metaelems");
2556 uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O
2557 uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O
2561 uiItemMenuF(layout, "Show/Hide Control Points", 0, view3d_edit_metaball_showhidemenu);
2564 static void view3d_edit_text_charsmenu(bContext *C, uiLayout *layout, void *arg_unused)
2566 /* the character codes are specified in UTF-8 */
2568 uiItemStringO(layout, "Copyright|Alt C", 0, "FONT_OT_text_insert", "text", "\xC2\xA9");
2569 uiItemStringO(layout, "Registered Trademark|Alt R", 0, "FONT_OT_text_insert", "text", "\xC2\xAE");
2573 uiItemStringO(layout, "Degree Sign|Alt G", 0, "FONT_OT_text_insert", "text", "\xC2\xB0");
2574 uiItemStringO(layout, "Multiplication Sign|Alt x", 0, "FONT_OT_text_insert", "text", "\xC3\x97");
2575 uiItemStringO(layout, "Circle|Alt .", 0, "FONT_OT_text_insert", "text", "\xC2\x8A");
2576 uiItemStringO(layout, "Superscript 1|Alt 1", 0, "FONT_OT_text_insert", "text", "\xC2\xB9");
2577 uiItemStringO(layout, "Superscript 2|Alt 2", 0, "FONT_OT_text_insert", "text", "\xC2\xB2");
2578 uiItemStringO(layout, "Superscript 3|Alt 3", 0, "FONT_OT_text_insert", "text", "\xC2\xB3");
2579 uiItemStringO(layout, "Double >>|Alt >", 0, "FONT_OT_text_insert", "text", "\xC2\xBB");
2580 uiItemStringO(layout, "Double <<|Alt <", 0, "FONT_OT_text_insert", "text", "\xC2\xAB");
2581 uiItemStringO(layout, "Promillage|Alt %", 0, "FONT_OT_text_insert", "text", "\xE2\x80\xB0");
2585 uiItemStringO(layout, "Dutch Florin|Alt F", 0, "FONT_OT_text_insert", "text", "\xC2\xA4");
2586 uiItemStringO(layout, "British Pound|Alt L", 0, "FONT_OT_text_insert", "text", "\xC2\xA3");
2587 uiItemStringO(layout, "Japanese Yen|Alt Y", 0, "FONT_OT_text_insert", "text", "\xC2\xA5");
2591 uiItemStringO(layout, "German S|Alt S", 0, "FONT_OT_text_insert", "text", "\xC3\x9F");
2592 uiItemStringO(layout, "Spanish Question Mark|Alt ?", 0, "FONT_OT_text_insert", "text", "\xC2\xBF");
2593 uiItemStringO(layout, "Spanish Exclamation Mark|Alt !", 0, "FONT_OT_text_insert", "text", "\xC2\xA1");
2596 static void view3d_edit_textmenu(bContext *C, uiLayout *layout, void *arg_unused)
2598 uiItemO(layout, NULL, 0, "FONT_OT_file_paste");
2600 uiItemMenuF(layout, "Special Characters", 0, view3d_edit_text_charsmenu);
2603 static void view3d_edit_latticemenu(bContext *C, uiLayout *layout, void *arg_unused)
2605 Scene *scene= CTX_data_scene(C);
2606 ToolSettings *ts= CTX_data_tool_settings(C);
2609 RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr);
2612 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
2614 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
2616 uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
2617 uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
2620 uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
2624 // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
2625 // common_insertkey();
2626 // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, "");
2627 // common_deletekey();
2629 uiItemO(layout, NULL, 0, "LATTICE_OT_make_regular");
2633 uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O
2634 uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O
2638 static void view3d_edit_armature_parentmenu(bContext *C, uiLayout *layout, void *arg_unused)
2640 uiItemO(layout, NULL, 0, "ARMATURE_OT_parent_set");
2641 uiItemO(layout, NULL, 0, "ARMATURE_OT_parent_clear");
2644 static void view3d_edit_armature_rollmenu(bContext *C, uiLayout *layout, void *arg_unused)
2646 /* 0 = 'Global', 1 = 'Cursor' */
2647 // TODO: keep these in sync...
2648 uiItemEnumO(layout, "Clear Roll (Z-Axis Up)", 0, "ARMATURE_OT_calculate_roll", "type", 0);
2649 uiItemEnumO(layout, "Roll to Cursor", 0, "ARMATURE_OT_calculate_roll", "type", 1);
2653 uiItemEnumO(layout, "Set Roll", 0, "TFM_OT_transform", "mode", TFM_BONE_ROLL);
2656 static void view3d_edit_armature_settingsmenu(bContext *C, uiLayout *layout, void *arg_unused)
2658 uiItemEnumO(layout, "Toggle a Setting", 0, "ARMATURE_OT_flags_set", "mode", 2);
2659 uiItemEnumO(layout, "Enable a Setting", 0, "ARMATURE_OT_flags_set", "mode", 1);
2660 uiItemEnumO(layout, "Disable a Setting", 0, "ARMATURE_OT_flags_set", "mode", 0);
2664 static void do_view3d_edit_armaturemenu(bContext *C, void *arg, int event)
2666 static short numcuts= 2;
2669 case 0: /* Undo Editing */
2670 remake_editArmature();
2674 initTransform(TFM_SHEAR, CTX_NONE);
2678 initTransform(TFM_WARP, CTX_NONE);
2680 case 23: /* bone sketching panel */
2681 add_blockhandler(curarea, VIEW3D_HANDLER_BONESKETCH, UI_PNL_UNSTOW);
2687 static void view3d_edit_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused)
2689 Object *obedit = CTX_data_edit_object(C);
2690 bArmature *arm= obedit->data;
2693 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
2694 uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Bone Sketching|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, "");
2695 uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
2696 uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, "");
2698 uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu);
2699 uiItemMenuF(layout, "Bone Roll", 0, view3d_edit_armature_rollmenu);
2701 if (arm->drawtype == ARM_ENVELOPE)
2702 uiItemEnumO(layout, "Scale Envelope Distance", 0, "TFM_OT_transform", "mode", TFM_BONESIZE);
2704 uiItemEnumO(layout, "Scale B-Bone Width", 0, "TFM_OT_transform", "mode", TFM_BONESIZE);
2708 uiItemO(layout, "Extrude", 0, "ARMATURE_OT_extrude");
2709 if (arm->flag & ARM_MIRROR_EDIT)
2710 uiItemBooleanO(layout, "Extrude Forked", 0, "ARMATURE_OT_extrude", "forked", 1);
2712 uiItemO(layout, NULL, 0, "ARMATURE_OT_duplicate");
2713 uiItemO(layout, NULL, 0, "ARMATURE_OT_merge");
2714 uiItemO(layout, NULL, 0, "ARMATURE_OT_fill");
2715 uiItemO(layout, NULL, 0, "ARMATURE_OT_delete");
2716 uiItemO(layout, NULL, 0, "ARMATURE_OT_separate");
2720 uiItemO(layout, NULL, 0, "ARMATURE_OT_subdivide_simple");
2721 uiItemO(layout, NULL, 0, "ARMATURE_OT_subdivide_multi");
2723 uiItemEnumO(layout, "AutoName Left/Right", 0, "ARMATURE_OT_autoside_names", "axis", 0);
2724 uiItemEnumO(layout, "AutoName Front/Back", 0, "ARMATURE_OT_autoside_names", "axis", 1);
2725 uiItemEnumO(layout, "AutoName Top/Bottom", 0, "ARMATURE_OT_autoside_names", "axis", 2);
2727 uiItemO(layout, "Flip Left/Right Names", 0, "ARMATURE_OT_flip_names");
2731 uiItemO(layout, NULL, 0, "ARMATURE_OT_armature_layers");
2732 uiItemO(layout, NULL, 0, "ARMATURE_OT_bone_layers");
2736 uiItemMenuF(layout, "Parent", 0, view3d_edit_armature_parentmenu);
2740 uiItemMenuF(layout, "Bone Settings ", 0, view3d_edit_armature_settingsmenu);
2744 static void view3d_pose_armature_transformmenu(bContext *C, uiLayout *layout, void *arg_unused)
2746 //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear User Transform|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
2747 //used: clear_user_transform(scene, ob);
2748 //uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
2750 uiItemO(layout, NULL, 0, "POSE_OT_loc_clear");
2751 uiItemO(layout, NULL, 0, "POSE_OT_rot_clear");
2752 uiItemO(layout, NULL, 0, "POSE_OT_scale_clear");
2755 //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
2756 //used:clear_object('o');
2759 static void view3d_pose_armature_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused)
2761 uiItemO(layout, "Show Hidden", 0, "POSE_OT_reveal");
2763 uiItemO(layout, "Hide Selected", 0, "POSE_OT_hide");
2764 uiItemBooleanO(layout, "Hide Unselected", 0, "POSE_OT_hide", "unselected", 1);
2767 static void view3d_pose_armature_ikmenu(bContext *C, uiLayout *layout, void *arg_unused)
2769 uiItemO(layout, NULL, 0, "POSE_OT_ik_add");
2770 uiItemO(layout, NULL, 0, "POSE_OT_ik_clear");
2773 static void view3d_pose_armature_constraintsmenu(bContext *C, uiLayout *layout, void *arg_unused)
2775 uiItemO(layout, NULL, 0, "POSE_OT_constraint_add_with_targets");
2776 uiItemO(layout, NULL, 0, "POSE_OT_constraints_clear");
2779 static void view3d_pose_armature_groupmenu(bContext *C, uiLayout *layout, void *arg_unused)
2781 uiItemO(layout, "Add Selected to Active Group", 0, "POSE_OT_group_assign");
2782 //uiItemO(layout, "Add Selected to Group", 0, "POSE_OT_group_assign");
2784 uiItemO(layout, "Add New Group", 0, "POSE_OT_group_add");
2786 uiItemO(layout, "Remove from All Groups", 0, "POSE_OT_group_unassign");
2787 uiItemO(layout, "Remove Active Group", 0, "POSE_OT_group_remove");
2790 static void view3d_pose_armature_motionpathsmenu(bContext *C, uiLayout *layout, void *arg_unused)
2792 uiItemO(layout, NULL, 0, "POSE_OT_paths_calculate");
2793 uiItemO(layout, NULL, 0, "POSE_OT_paths_clear");
2796 static void view3d_pose_armature_poselibmenu(bContext *C, uiLayout *layout, void *arg_unused)
2798 uiItemO(layout, NULL, 0, "POSELIB_OT_browse_interactive");
2802 uiItemO(layout, NULL, 0, "POSELIB_OT_pose_add");
2803 uiItemO(layout, NULL, 0, "POSELIB_OT_pose_rename");
2804 uiItemO(layout, NULL, 0, "POSELIB_OT_pose_remove");
2807 static void view3d_pose_armature_settingsmenu(bContext *C, uiLayout *layout, void *arg_unused)
2809 uiItemEnumO(layout, "Toggle a Setting", 0, "POSE_OT_flags_set", "mode", 2);
2810 uiItemEnumO(layout, "Enable a Setting", 0, "POSE_OT_flags_set", "mode", 1);
2811 uiItemEnumO(layout, "Disable a Setting", 0, "POSE_OT_flags_set", "mode", 0);
2815 static void do_view3d_pose_armaturemenu(bContext *C, void *arg, int event)
2831 static void view3d_pose_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused)
2833 Object *ob = CTX_data_active_object(C);
2834 bArmature *arm= ob->data;
2836 #if 0 // XXX to be ported, using uiItemMenuF(layout, "<Name>", 0, view3d_pose_armature_<category>menu);
2837 uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
2839 if ( (arm) && ((arm->drawtype == ARM_B_BONE) || (arm->drawtype == ARM_ENVELOPE)) )
2840 uiItemEnumO(layout, "Scale Envelope Distance", 0, "TFM_OT_transform", "mode", TFM_BONESIZE);
2841 uiItemMenuF(layout, "Clear Transform", 0, view3d_pose_armature_transformmenu);
2845 // TODO: these operators may get renamed
2846 uiItemO(layout, NULL, 0, "ANIM_OT_insert_keyframe_menu");
2847 uiItemO(layout, NULL, 0, "ANIM_OT_delete_keyframe_v3d");
2852 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Relax Pose|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, "");
2854 uiItemO(layout, NULL, 0, "POSE_OT_apply");
2858 uiItemO(layout, "Copy Current Pose", 0, "POSE_OT_copy");
2859 uiItemO(layout, "Paste Pose", 0, "POSE_OT_paste");
2860 uiItemBooleanO(layout, "Paste X-Flipped Pose", 0, "POSE_OT_paste", "flipped", 1);
2864 uiItemMenuF(layout, "Pose Library", 0, view3d_pose_armature_poselibmenu);
2865 uiItemMenuF(layout, "Motion Paths", 0, view3d_pose_armature_motionpathsmenu);
2866 uiItemMenuF(layout, "Bone Groups", 0, view3d_pose_armature_groupmenu);
2870 uiItemMenuF(layout, "Inverse Kinematics", 0, view3d_pose_armature_ikmenu);
2871 uiItemMenuF(layout, "Constraints", 0, view3d_pose_armature_constraintsmenu);
2875 uiItemEnumO(layout, "AutoName Left/Right", 0, "POSE_OT_autoside_names", "axis", 0);
2876 uiItemEnumO(layout, "AutoName Front/Back", 0, "POSE_OT_autoside_names", "axis", 1);
2877 uiItemEnumO(layout, "AutoName Top/Bottom", 0, "POSE_OT_autoside_names", "axis", 2);
2879 uiItemO(layout, "Flip Left/Right Names", 0, "POSE_OT_flip_names");
2883 uiItemO(layout, NULL, 0, "POSE_OT_armature_layers");
2884 uiItemO(layout, NULL, 0, "POSE_OT_bone_layers");
2888 uiItemMenuF(layout, "Show/Hide Bones", 0, view3d_pose_armature_showhidemenu);
2889 uiItemMenuF(layout, "Bone Settings", 0, view3d_pose_armature_settingsmenu);
2892 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Attributes...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
2897 /* vertex paint menu */
2898 static void do_view3d_vpaintmenu(bContext *C, void *arg, int event)
2901 /* events >= 3 are registered bpython scripts */
2902 #ifndef DISABLE_PYTHON
2903 if (event >= 3) BPY_menu_do_python(PYMENU_VERTEXPAINT, event - 3);
2906 case 0: /* undo vertex painting */
2909 case 1: /* set vertex colors/weight */
2910 if(FACESEL_PAINT_TEST)
2911 clear_vpaint_selectedfaces();
2912 else /* we know were in vertex paint mode */
2922 static uiBlock *view3d_vpaintmenu(bContext *C, ARegion *ar, void *arg_unused)
2925 short yco= 0, menuwidth=120;
2926 #ifndef DISABLE_PYTHON
2927 // XXX BPyMenu *pym;
2931 block= uiBeginBlock(C, ar, "view3d_paintmenu", UI_EMBOSSP);
2932 uiBlockSetButmFunc(block, do_view3d_vpaintmenu, NULL);
2934 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Vertex Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
2935 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
2936 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Shaded Vertex Colors", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
2938 #ifndef DISABLE_PYTHON
2939 /* note that we account for the 3 previous entries with i+3:
2940 even if the last item isnt displayed, it dosent matter */
2941 // for (pym = BPyMenuTable[PYMENU_VERTEXPAINT]; pym; pym = pym->next, i++) {
2942 // uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20,
2943 // menuwidth, 19, NULL, 0.0, 0.0, 1, i+3,
2944 // pym->tooltip?pym->tooltip:pym->filename);
2948 if(ar->alignment==RGN_ALIGN_TOP) {
2949 uiBlockSetDirection(block, UI_DOWN);
2952 uiBlockSetDirection(block, UI_TOP);
2953 uiBlockFlipOrder(block);
2956 uiTextBoundsBlock(block, 50);
2961 /* texture paint menu (placeholder, no items yet??) */
2962 static void do_view3d_tpaintmenu(bContext *C, void *arg, int event)
2966 case 0: /* undo image painting */
2967 undo_imagepaint_step(1);
2974 static uiBlock *view3d_tpaintmenu(bContext *C, ARegion *ar, void *arg_unused)
2977 short yco= 0, menuwidth=120;
2979 block= uiBeginBlock(C, ar, "view3d_paintmenu", UI_EMBOSSP);
2980 uiBlockSetButmFunc(block, do_view3d_tpaintmenu, NULL);
2982 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Texture Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
2983 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
2985 if(ar->alignment==RGN_ALIGN_TOP) {
2986 uiBlockSetDirection(block, UI_DOWN);
2989 uiBlockSetDirection(block, UI_TOP);
2990 uiBlockFlipOrder(block);
2993 uiTextBoundsBlock(block, 50);
2998 static void do_view3d_wpaintmenu(bContext *C, void *arg, int event)
3003 /* events >= 3 are registered bpython scripts */
3004 #ifndef DISABLE_PYTHON
3005 if (event >= 4) BPY_menu_do_python(PYMENU_WEIGHTPAINT, event - 4);
3008 case 0: /* undo weight painting */
3011 case 1: /* set vertex colors/weight */
3012 clear_wpaint_selectedfaces();
3014 case 2: /* vgroups from envelopes */
3015 pose_adds_vgroups(ob, 0);
3017 case 3: /* vgroups from bone heat */
3018 pose_adds_vgroups(ob, 1);
3024 static uiBlock *view3d_wpaintmenu(bContext *C, ARegion *ar, void *arg_unused)
3027 short yco= 0, menuwidth=120, menunr=1;
3028 #ifndef DISABLE_PYTHON
3029 // XXX BPyMenu *pym;
3033 block= uiBeginBlock(C, ar, "view3d_paintmenu", UI_EMBOSSP);
3034 uiBlockSetButmFunc(block, do_view3d_wpaintmenu, NULL);
3036 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Weight Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
3038 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
3040 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Bone Heat Weights to Vertex Groups|W, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
3041 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Bone Envelopes to Vertex Groups|W, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
3043 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
3045 if (FACESEL_PAINT_TEST) {
3046 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Weight|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
3047 uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
3051 #ifndef DISABLE_PYTHON
3052 /* note that we account for the 4 previous entries with i+4:
3053 even if the last item isnt displayed, it dosent matter */
3054 // for (pym = BPyMenuTable[PYMENU_WEIGHTPAINT]; pym; pym = pym->next, i++) {
3055 // uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20,
3056 // menuwidth, 19, NULL, 0.0, 0.0, 1, i+4,
3057 // pym->tooltip?pym->tooltip:pym->filename);
3061 if(ar->alignment==RGN_ALIGN_TOP) {
3062 uiBlockSetDirection(block, UI_DOWN);
3065 uiBlockSetDirection(block, UI_TOP);
3066 uiBlockFlipOrder(block);
3069 uiTextBoundsBlock(block, 50);
3073 void do_view3d_sculpt_inputmenu(bContext *C, void *arg, int event)
3076 Scene *scene= CTX_data_scene(C);
3077 SculptData *sd= &scene->sculptdata;
3082 sd->flags ^= SCULPT_INPUT_SMOOTH;
3083 ED_undo_push(C, "Smooth stroke");
3086 val= sd->tablet_size;
3087 if(button(&val,0,10,"Tablet Size:")==0) return;
3088 sd->tablet_size= val;
3089 ED_undo_push(C, "Tablet size");
3092 val= sd->tablet_strength;
3093 if(button(&val,0,10,"Tablet Strength:")==0) return;
3094 sd->tablet_strength= val;