2008-12-19 17:14:02 +00:00
|
|
|
/**
|
|
|
|
|
* $Id:
|
|
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
|
|
#include "DNA_object_types.h"
|
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
#include "DNA_screen_types.h"
|
|
|
|
|
#include "DNA_space_types.h"
|
|
|
|
|
#include "DNA_userdef_types.h"
|
|
|
|
|
#include "DNA_view3d_types.h"
|
|
|
|
|
#include "DNA_windowmanager_types.h"
|
|
|
|
|
|
|
|
|
|
#include "BLI_arithb.h"
|
|
|
|
|
#include "BLI_blenlib.h"
|
|
|
|
|
|
|
|
|
|
#include "BKE_context.h"
|
|
|
|
|
#include "BKE_global.h"
|
|
|
|
|
#include "BKE_utildefines.h"
|
|
|
|
|
|
|
|
|
|
#include "RNA_access.h"
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
|
|
|
|
#include "ED_screen.h"
|
2009-07-08 16:17:47 +00:00
|
|
|
#include "ED_transform.h"
|
2008-12-19 17:14:02 +00:00
|
|
|
|
|
|
|
|
#include "view3d_intern.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ************************** registration **********************************/
|
|
|
|
|
|
|
|
|
|
void view3d_operatortypes(void)
|
|
|
|
|
{
|
2008-12-26 11:11:21 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_viewrotate);
|
|
|
|
|
WM_operatortype_append(VIEW3D_OT_viewmove);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_zoom);
|
2009-07-09 08:39:58 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_view_all);
|
2008-12-26 11:11:21 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_viewnumpad);
|
2009-02-03 03:54:03 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_view_orbit);
|
|
|
|
|
WM_operatortype_append(VIEW3D_OT_view_pan);
|
|
|
|
|
WM_operatortype_append(VIEW3D_OT_view_persportho);
|
2009-07-09 08:39:58 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_view_center);
|
2008-12-26 11:11:21 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_select);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_select_border);
|
2009-07-09 08:39:58 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_clip_border);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_select_circle);
|
2008-12-26 18:15:46 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_smoothview);
|
2008-12-27 01:29:56 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_render_border);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_zoom_border);
|
2009-07-08 15:01:28 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_manipulator);
|
2008-12-26 19:07:31 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_cursor3d);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_select_lasso);
|
2009-01-06 00:19:47 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_setcameratoview);
|
2009-01-06 19:58:42 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_drawtype);
|
2009-02-14 10:03:24 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_localview);
|
2009-06-13 17:25:54 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_game_start);
|
2009-02-20 18:01:33 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_layers);
|
2009-02-14 13:07:09 +00:00
|
|
|
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_properties);
|
|
|
|
|
WM_operatortype_append(VIEW3D_OT_toolbar);
|
|
|
|
|
|
2009-02-14 13:07:09 +00:00
|
|
|
WM_operatortype_append(VIEW3D_OT_snap_selected_to_grid);
|
|
|
|
|
WM_operatortype_append(VIEW3D_OT_snap_selected_to_cursor);
|
|
|
|
|
WM_operatortype_append(VIEW3D_OT_snap_selected_to_center);
|
|
|
|
|
WM_operatortype_append(VIEW3D_OT_snap_cursor_to_grid);
|
|
|
|
|
WM_operatortype_append(VIEW3D_OT_snap_cursor_to_selected);
|
|
|
|
|
WM_operatortype_append(VIEW3D_OT_snap_cursor_to_active);
|
|
|
|
|
WM_operatortype_append(VIEW3D_OT_snap_menu);
|
2009-02-14 10:03:24 +00:00
|
|
|
|
2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
2008-12-29 01:41:28 +00:00
|
|
|
transform_operatortypes();
|
2008-12-19 17:14:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void view3d_keymap(wmWindowManager *wm)
|
|
|
|
|
{
|
2009-02-10 15:38:00 +00:00
|
|
|
ListBase *keymap= WM_keymap_listbase(wm, "View3D Generic", SPACE_VIEW3D, 0);
|
2009-01-06 19:58:42 +00:00
|
|
|
wmKeymapItem *km;
|
2008-12-19 17:14:02 +00:00
|
|
|
|
2009-02-10 15:38:00 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_properties", NKEY, KM_PRESS, 0, 0);
|
2.5
Summary of ain features:
- Themes and Styles are now editable.
- CTRL+U "Save user defaults" now goes to new .B25.blend, so you
can use 2.4x and 2.5x next to each other. If B25 doesn't exist, it
reads the regular .B.blend
- Press Tkey in 3d window for (unfinished) toolbar WIP. It now only
shows the last operator, if appropriate.
Nkey properties moved to the other side.
A lot of work was done on removing old themes for good and properly
getting it work with the 2.5 region system. Here's some notes;
- Buttons now all have a complete set of colors, based on button classifications
(See outliner -> user prefs -> Interface
- Theme colors have been extended with basic colors for region types.
Currently colors are defined for Window, Header, List/Channels and
for Button/Tool views.
The screen manager handles this btw, so a TH_BACK will always pick the
right backdrop color.
- Menu backdrops are in in Button theme colors. Floating Panels will be in
the per-space type Themes.
- Styles were added in RNA too, but only for the font settings now.
Only Panel font, widget font and widget-label work now. The 'group label'
will be for templates mostly.
Style settings will be expanded with spacing defaults, label conventions,
etc.
- Label text colors are stored in per-space Theme too, to make sure they fit.
Same goes for Panel title color.
Note that 'shadow' for fonts can conflict with text colors; shadow color is
currently stored in Style... shadow code needs a bit of work still.
2009-04-27 13:44:11 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_toolbar", TKEY, KM_PRESS, 0, 0);
|
2009-02-10 15:38:00 +00:00
|
|
|
|
|
|
|
|
/* only for region 3D window */
|
|
|
|
|
keymap= WM_keymap_listbase(wm, "View3D", SPACE_VIEW3D, 0);
|
|
|
|
|
|
2.5
Vertex Paint back!
Added WM level "paint cursor" system, which manages a custom painting
cursor for tools or modes.
- Activate it with WM_paint_cursor_activate(). That function wants two
callbacks, a poll(C) to check whether there's a cursor in given context
and ARegion, and a draw(C, x, y) which gets called when appropriate.
- While paintcursor is active, the WM handles necessary redrawing events
for all regions, also to nicely clear the cursor on region exit.
- WM_paint_cursor_activate returns a handle, which you have to use to
end the paint cursor. This handle also means you can register as many
custom cursors as you want.
At the moment, vertex paint mode registers only a mousemove handler,
all other events are still normally handled. This is stuff for the
future todo.
2009-01-09 13:55:45 +00:00
|
|
|
/* paint poll checks mode */
|
2009-02-19 23:53:40 +00:00
|
|
|
WM_keymap_verify_item(keymap, "PAINT_OT_vertex_paint", LEFTMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
|
|
|
|
|
WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "PAINT_OT_clone_cursor_set", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
|
2009-01-13 19:57:36 +00:00
|
|
|
|
2009-01-30 20:35:37 +00:00
|
|
|
WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
|
2009-03-23 01:01:44 +00:00
|
|
|
|
|
|
|
|
/* sketch poll checks mode */
|
|
|
|
|
WM_keymap_add_item(keymap, "SKETCH_OT_gesture", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", ACTIONMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
km = WM_keymap_add_item(keymap, "SKETCH_OT_draw_stroke", ACTIONMOUSE, KM_PRESS, KM_CTRL, 0);
|
|
|
|
|
RNA_boolean_set(km->ptr, "snap", 1);
|
|
|
|
|
WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, 0, 0);
|
|
|
|
|
km = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0);
|
|
|
|
|
RNA_boolean_set(km->ptr, "snap", 1);
|
2009-08-26 12:01:15 +00:00
|
|
|
|
2009-08-26 01:49:57 +00:00
|
|
|
WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, 0, 0); /* manipulator always on left mouse, not on action mouse*/
|
|
|
|
|
|
2008-12-26 19:07:31 +00:00
|
|
|
WM_keymap_verify_item(keymap, "VIEW3D_OT_cursor3d", ACTIONMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
|
2008-12-26 11:11:21 +00:00
|
|
|
WM_keymap_verify_item(keymap, "VIEW3D_OT_viewrotate", MIDDLEMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_verify_item(keymap, "VIEW3D_OT_viewmove", MIDDLEMOUSE, KM_PRESS, KM_SHIFT, 0);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_keymap_verify_item(keymap, "VIEW3D_OT_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0);
|
2009-07-09 08:39:58 +00:00
|
|
|
WM_keymap_verify_item(keymap, "VIEW3D_OT_view_center", PADPERIOD, KM_PRESS, 0, 0);
|
2008-12-19 19:27:41 +00:00
|
|
|
|
2008-12-26 18:15:46 +00:00
|
|
|
WM_keymap_verify_item(keymap, "VIEW3D_OT_smoothview", TIMER1, KM_ANY, KM_ANY, 0);
|
|
|
|
|
|
2009-03-29 02:15:13 +00:00
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", PADPLUSKEY, KM_PRESS, 0, 0)->ptr, "delta", 1);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", PADMINUS, KM_PRESS, 0, 0)->ptr, "delta", -1);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", WHEELINMOUSE, KM_PRESS, 0, 0)->ptr, "delta", 1);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", WHEELOUTMOUSE, KM_PRESS, 0, 0)->ptr, "delta", -1);
|
2008-12-19 19:27:41 +00:00
|
|
|
|
2009-07-09 08:39:58 +00:00
|
|
|
RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", HOMEKEY, KM_PRESS, 0, 0)->ptr, "center", 0);
|
|
|
|
|
RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", CKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "center", 1);
|
2008-12-20 11:33:16 +00:00
|
|
|
|
2008-12-23 09:59:02 +00:00
|
|
|
/* numpad view hotkeys*/
|
2009-02-04 05:15:39 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD0, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_CAMERA);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_FRONT);
|
2009-02-03 03:54:03 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD2, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPDOWN);
|
2009-02-04 05:15:39 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_RIGHT);
|
2009-02-03 03:54:03 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD4, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPLEFT);
|
|
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_view_persportho", PAD5, KM_PRESS, 0, 0);
|
|
|
|
|
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD6, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPRIGHT);
|
2009-02-04 05:15:39 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_TOP);
|
2009-02-03 03:54:03 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD8, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPUP);
|
2009-02-04 05:15:39 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_BACK);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_LEFT);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_BOTTOM);
|
2009-02-03 03:54:03 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD2, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANDOWN);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD4, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANLEFT);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD6, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANRIGHT);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD8, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANUP);
|
2008-12-26 11:11:21 +00:00
|
|
|
|
2009-02-14 10:03:24 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_localview", PADSLASHKEY, KM_PRESS, 0, 0);
|
|
|
|
|
|
2009-06-13 17:25:54 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 0);
|
|
|
|
|
|
2009-02-20 18:01:33 +00:00
|
|
|
/* layers, shift + alt are properties set in invoke() */
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", ONEKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 1);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", TWOKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 2);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", THREEKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 3);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", FOURKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 4);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", FIVEKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 5);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", SIXKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 6);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", SEVENKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 7);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", EIGHTKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 8);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", NINEKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 9);
|
|
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_layers", ZEROKEY, KM_PRESS, KM_ANY, 0)->ptr, "nr", 10);
|
|
|
|
|
|
2009-01-06 19:58:42 +00:00
|
|
|
/* drawtype */
|
|
|
|
|
km = WM_keymap_add_item(keymap, "VIEW3D_OT_drawtype", ZKEY, KM_PRESS, 0, 0);
|
2009-01-16 23:58:10 +00:00
|
|
|
RNA_int_set(km->ptr, "draw_type", OB_SOLID);
|
2009-01-17 00:26:46 +00:00
|
|
|
RNA_int_set(km->ptr, "draw_type_alternate", OB_WIRE);
|
2009-01-06 19:58:42 +00:00
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "VIEW3D_OT_drawtype", ZKEY, KM_PRESS, KM_ALT, 0);
|
2009-01-16 23:58:10 +00:00
|
|
|
RNA_int_set(km->ptr, "draw_type", OB_TEXTURE);
|
|
|
|
|
RNA_int_set(km->ptr, "draw_type_alternate", OB_SOLID);
|
2009-01-06 19:58:42 +00:00
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "VIEW3D_OT_drawtype", ZKEY, KM_PRESS, KM_SHIFT, 0);
|
2009-01-16 23:58:10 +00:00
|
|
|
RNA_int_set(km->ptr, "draw_type", OB_SHADED);
|
|
|
|
|
RNA_int_set(km->ptr, "draw_type_alternate", OB_WIRE);
|
2009-01-06 19:58:42 +00:00
|
|
|
|
2008-12-28 01:28:31 +00:00
|
|
|
/* selection*/
|
|
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
|
2009-09-16 01:15:30 +00:00
|
|
|
RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", TRUE);
|
|
|
|
|
RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL, 0)->ptr, "center", TRUE);
|
|
|
|
|
RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "enumerate", TRUE);
|
|
|
|
|
|
|
|
|
|
/* selection key-combinations */
|
|
|
|
|
km = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
|
|
|
|
|
RNA_boolean_set(km->ptr, "center", TRUE);
|
|
|
|
|
RNA_boolean_set(km->ptr, "extend", TRUE);
|
|
|
|
|
km = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0);
|
|
|
|
|
RNA_boolean_set(km->ptr, "center", TRUE);
|
|
|
|
|
RNA_boolean_set(km->ptr, "enumerate", TRUE);
|
|
|
|
|
km = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0);
|
|
|
|
|
RNA_boolean_set(km->ptr, "extend", TRUE);
|
|
|
|
|
RNA_boolean_set(km->ptr, "enumerate", TRUE);
|
|
|
|
|
km = WM_keymap_add_item(keymap, "VIEW3D_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL|KM_ALT, 0);
|
|
|
|
|
RNA_boolean_set(km->ptr, "center", TRUE);
|
|
|
|
|
RNA_boolean_set(km->ptr, "extend", TRUE);
|
|
|
|
|
RNA_boolean_set(km->ptr, "enumerate", TRUE);
|
|
|
|
|
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_select_border", BKEY, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_CTRL, 0);
|
RNA
* Enums can now be dynamically created in the _itemf callback,
using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
for operators. This doesn't fit design well at all, needed to do
some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
_itemf callback, for docs and fallback in case there is no context.
* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
(unselected, deselect), to make them consistent with other ops.
2009-07-10 19:56:13 +00:00
|
|
|
RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_select_lasso", EVT_TWEAK_A, KM_ANY, KM_SHIFT|KM_CTRL, 0)->ptr, "deselect", 1);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_select_circle", CKEY, KM_PRESS, 0, 0);
|
2008-12-28 01:28:31 +00:00
|
|
|
|
2009-07-09 08:39:58 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_clip_border", BKEY, KM_PRESS, KM_ALT, 0);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_zoom_border", BKEY, KM_PRESS, KM_SHIFT, 0);
|
2008-12-27 01:29:56 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_render_border", BKEY, KM_PRESS, KM_SHIFT, 0);
|
2009-01-06 00:19:47 +00:00
|
|
|
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_camera_to_view", PAD0, KM_PRESS, KM_ALT|KM_CTRL, 0);
|
2.5
Vertex Paint back!
Added WM level "paint cursor" system, which manages a custom painting
cursor for tools or modes.
- Activate it with WM_paint_cursor_activate(). That function wants two
callbacks, a poll(C) to check whether there's a cursor in given context
and ARegion, and a draw(C, x, y) which gets called when appropriate.
- While paintcursor is active, the WM handles necessary redrawing events
for all regions, also to nicely clear the cursor on region exit.
- WM_paint_cursor_activate returns a handle, which you have to use to
end the paint cursor. This handle also means you can register as many
custom cursors as you want.
At the moment, vertex paint mode registers only a mousemove handler,
all other events are still normally handled. This is stuff for the
future todo.
2009-01-09 13:55:45 +00:00
|
|
|
|
2009-02-14 13:07:09 +00:00
|
|
|
WM_keymap_add_item(keymap, "VIEW3D_OT_snap_menu", SKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
|
|
2009-01-25 21:02:52 +00:00
|
|
|
/* radial control */
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, KM_CTRL, 0)->ptr, "mode", WM_RADIALCONTROL_ANGLE);
|
|
|
|
|
|
2009-02-19 23:53:40 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
|
2009-02-22 19:31:25 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_texture_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
|
2009-02-19 23:53:40 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
|
2009-02-22 19:31:25 +00:00
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_texture_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
|
2009-01-25 21:02:52 +00:00
|
|
|
|
2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
2008-12-29 01:41:28 +00:00
|
|
|
transform_keymap_for_space(wm, keymap, SPACE_VIEW3D);
|
|
|
|
|
|
2008-12-19 17:14:02 +00:00
|
|
|
}
|
|
|
|
|
|