2008-12-29 04:14:27 +00:00
|
|
|
/**
|
|
|
|
|
* $Id: transform_ops.c 17542 2008-11-23 15:27:53Z theeth $
|
|
|
|
|
*
|
|
|
|
|
* ***** 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.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
|
|
#include "DNA_space_types.h"
|
2009-01-03 22:15:59 +00:00
|
|
|
#include "DNA_windowmanager_types.h"
|
2008-12-29 04:14:27 +00:00
|
|
|
|
|
|
|
|
#include "RNA_access.h"
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
|
|
#include "BLI_arithb.h"
|
|
|
|
|
|
|
|
|
|
#include "BKE_utildefines.h"
|
|
|
|
|
#include "BKE_context.h"
|
|
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
2009-01-18 21:36:38 +00:00
|
|
|
#include "UI_interface.h"
|
|
|
|
|
|
2008-12-29 04:14:27 +00:00
|
|
|
#include "ED_screen.h"
|
|
|
|
|
|
|
|
|
|
#include "transform.h"
|
|
|
|
|
|
2009-01-18 21:36:38 +00:00
|
|
|
|
|
|
|
|
static int select_orientation_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
|
|
|
|
int orientation = RNA_int_get(op->ptr, "orientation");
|
|
|
|
|
|
|
|
|
|
if (orientation > -1)
|
|
|
|
|
{
|
|
|
|
|
BIF_selectTransformOrientationValue(C, orientation);
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return OPERATOR_CANCELLED;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int select_orientation_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
|
|
|
|
{
|
|
|
|
|
char *string = BIF_menustringTransformOrientation(C, "Orientation");
|
|
|
|
|
|
|
|
|
|
op->customdata = string;
|
|
|
|
|
|
2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
organize things a bit and indicate what should be used when.
* uiMenu* functions can now be used to create menus for headers
too, this is done with a uiDefMenuBut, which takes a pointer
to a uiMenuCreateFunc, that will then call uiMenu* functions.
* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
specific to making popup menus. Will convert the other
conformation popup menu functions to use this too so we can
remove some code.
* Extended uiMenu functions, now there is is also:
BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.
* Converted image window headers to use uiMenu functions, simplifies
menu code further here. Did not remove the uiDefMenu functions as
they are used in sequencer/view3d in some places now (will fix).
* Also tried to simplify and fix bounds computation a bit better
for popup menus. It tried to find out in advance what the size
of the menu was but this is difficult with keymap strings in
there, now uiPopupBoundsBlock can figure this out afterwards and
ensure the popup is within the window bounds. Will convert some
other functions to use this too.
2009-01-30 12:18:08 +00:00
|
|
|
uiPupMenuOperator(C, 0, op, "orientation", string);
|
2009-01-18 21:36:38 +00:00
|
|
|
|
|
|
|
|
return OPERATOR_RUNNING_MODAL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TFM_OT_select_orientation(struct wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
|
|
|
|
ot->name = "Select Orientation";
|
|
|
|
|
ot->idname = "TFM_OT_select_orientation";
|
|
|
|
|
|
|
|
|
|
/* api callbacks */
|
|
|
|
|
ot->invoke = select_orientation_invoke;
|
|
|
|
|
ot->exec = select_orientation_exec;
|
|
|
|
|
ot->poll = ED_operator_areaactive;
|
|
|
|
|
|
New Operators, duplicate is shift+d, Add operators are accessible from the header.
SEQUENCER_OT_add_duplicate(mode=1)
SEQUENCER_OT_add_image_strip(name='', start_frame=0, channel=1, filename='', replace_sel=True)
SEQUENCER_OT_add_movie_strip(name='', start_frame=0, channel=1, filename='', replace_sel=True)
SEQUENCER_OT_add_sound_strip(name='', start_frame=0, channel=1, filename='', replace_sel=True)
Some of these use the file selector, Note that sound isn't working yet because editsound.c functions are not yet in 2.5 and Operators dont have a way to recieve an array of strings so SEQUENCER_OT_add_image_strip only adds 1 image at the moment.
2009-01-22 15:52:04 +00:00
|
|
|
RNA_def_int(ot->srna, "orientation", -1, INT_MIN, INT_MAX, "Orientation", "DOC_BROKEN", INT_MIN, INT_MAX);
|
2009-01-18 21:36:38 +00:00
|
|
|
}
|
|
|
|
|
|
2008-12-29 04:14:27 +00:00
|
|
|
static void transformops_exit(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
2009-01-03 22:15:59 +00:00
|
|
|
saveTransform(C, op->customdata, op);
|
2008-12-29 04:14:27 +00:00
|
|
|
MEM_freeN(op->customdata);
|
|
|
|
|
op->customdata = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void transformops_data(bContext *C, wmOperator *op, wmEvent *event)
|
|
|
|
|
{
|
2009-01-03 22:15:59 +00:00
|
|
|
if (op->customdata == NULL)
|
|
|
|
|
{
|
|
|
|
|
TransInfo *t = MEM_callocN(sizeof(TransInfo), "TransInfo data");
|
|
|
|
|
|
|
|
|
|
initTransform(C, t, op, event);
|
2008-12-29 04:14:27 +00:00
|
|
|
|
2009-01-03 22:15:59 +00:00
|
|
|
/* store data */
|
|
|
|
|
op->customdata = t;
|
|
|
|
|
}
|
2008-12-29 04:14:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int transform_modal(bContext *C, wmOperator *op, wmEvent *event)
|
|
|
|
|
{
|
2009-01-03 22:15:59 +00:00
|
|
|
int exit_code;
|
|
|
|
|
|
2008-12-29 04:14:27 +00:00
|
|
|
TransInfo *t = op->customdata;
|
2008-12-29 07:19:16 +00:00
|
|
|
|
2008-12-29 04:14:27 +00:00
|
|
|
transformEvent(t, event);
|
|
|
|
|
|
2009-01-07 16:52:18 +00:00
|
|
|
transformApply(C, t);
|
2008-12-29 04:14:27 +00:00
|
|
|
|
2009-01-03 22:15:59 +00:00
|
|
|
|
|
|
|
|
exit_code = transformEnd(C, t);
|
|
|
|
|
|
|
|
|
|
if (exit_code != OPERATOR_RUNNING_MODAL)
|
2008-12-29 04:14:27 +00:00
|
|
|
{
|
|
|
|
|
transformops_exit(C, op);
|
|
|
|
|
}
|
2009-01-03 22:15:59 +00:00
|
|
|
|
|
|
|
|
return exit_code;
|
2008-12-29 04:14:27 +00:00
|
|
|
}
|
|
|
|
|
|
2009-01-03 22:15:59 +00:00
|
|
|
static int transform_cancel(bContext *C, wmOperator *op)
|
2008-12-29 04:14:27 +00:00
|
|
|
{
|
|
|
|
|
TransInfo *t = op->customdata;
|
|
|
|
|
|
2009-01-03 22:15:59 +00:00
|
|
|
t->state = TRANS_CANCEL;
|
|
|
|
|
transformEnd(C, t);
|
|
|
|
|
transformops_exit(C, op);
|
|
|
|
|
|
2009-01-18 21:36:38 +00:00
|
|
|
return OPERATOR_CANCELLED;
|
2009-01-03 22:15:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int transform_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
|
|
|
|
TransInfo *t;
|
|
|
|
|
|
|
|
|
|
transformops_data(C, op, NULL);
|
|
|
|
|
|
|
|
|
|
t = op->customdata;
|
|
|
|
|
|
|
|
|
|
t->options |= CTX_AUTOCONFIRM;
|
|
|
|
|
|
2009-01-07 16:52:18 +00:00
|
|
|
transformApply(C, t);
|
2008-12-29 04:14:27 +00:00
|
|
|
|
2008-12-31 17:11:42 +00:00
|
|
|
transformEnd(C, t);
|
2008-12-29 04:14:27 +00:00
|
|
|
|
|
|
|
|
transformops_exit(C, op);
|
|
|
|
|
|
|
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int transform_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
|
|
|
|
{
|
|
|
|
|
transformops_data(C, op, event);
|
|
|
|
|
|
2009-01-25 17:08:56 +00:00
|
|
|
if(RNA_property_is_set(op->ptr, "values")) {
|
2008-12-29 04:14:27 +00:00
|
|
|
return transform_exec(C, op);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* add temp handler */
|
|
|
|
|
WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op);
|
|
|
|
|
|
|
|
|
|
return OPERATOR_RUNNING_MODAL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TFM_OT_transform(struct wmOperatorType *ot)
|
|
|
|
|
{
|
2009-01-14 16:37:52 +00:00
|
|
|
static const float mtx[3][3] = {{1, 0, 0},{0, 1, 0},{0, 0, 1}};
|
2009-01-18 21:36:38 +00:00
|
|
|
static EnumPropertyItem transform_mode_types[] = {
|
|
|
|
|
{TFM_INIT, "INIT", "Init", ""},
|
|
|
|
|
{TFM_DUMMY, "DUMMY", "Dummy", ""},
|
|
|
|
|
{TFM_TRANSLATION, "TRANSLATION", "Translation", ""},
|
|
|
|
|
{TFM_ROTATION, "ROTATION", "Rotation", ""},
|
|
|
|
|
{TFM_RESIZE, "RESIZE", "Resize", ""},
|
|
|
|
|
{TFM_TOSPHERE, "TOSPHERE", "Tosphere", ""},
|
|
|
|
|
{TFM_SHEAR, "SHEAR", "Shear", ""},
|
|
|
|
|
{TFM_WARP, "WARP", "Warp", ""},
|
|
|
|
|
{TFM_SHRINKFATTEN, "SHRINKFATTEN", "Shrinkfatten", ""},
|
|
|
|
|
{TFM_TILT, "TILT", "Tilt", ""},
|
|
|
|
|
{TFM_LAMP_ENERGY, "LAMP_ENERGY", "Lamp_Energy", ""},
|
|
|
|
|
{TFM_TRACKBALL, "TRACKBALL", "Trackball", ""},
|
|
|
|
|
{TFM_PUSHPULL, "PUSHPULL", "Pushpull", ""},
|
|
|
|
|
{TFM_CREASE, "CREASE", "Crease", ""},
|
|
|
|
|
{TFM_MIRROR, "MIRROR", "Mirror", ""},
|
|
|
|
|
{TFM_BONESIZE, "BONESIZE", "Bonesize", ""},
|
|
|
|
|
{TFM_BONE_ENVELOPE, "BONE_ENVELOPE", "Bone_Envelope", ""},
|
|
|
|
|
{TFM_CURVE_SHRINKFATTEN, "CURVE_SHRINKFATTEN", "Curve_Shrinkfatten", ""},
|
|
|
|
|
{TFM_BONE_ROLL, "BONE_ROLL", "Bone_Roll", ""},
|
|
|
|
|
{TFM_TIME_TRANSLATE, "TIME_TRANSLATE", "Time_Translate", ""},
|
|
|
|
|
{TFM_TIME_SLIDE, "TIME_SLIDE", "Time_Slide", ""},
|
|
|
|
|
{TFM_TIME_SCALE, "TIME_SCALE", "Time_Scale", ""},
|
|
|
|
|
{TFM_TIME_EXTEND, "TIME_EXTEND", "Time_Extend", ""},
|
|
|
|
|
{TFM_BAKE_TIME, "BAKE_TIME", "Bake_Time", ""},
|
|
|
|
|
{TFM_BEVEL, "BEVEL", "Bevel", ""},
|
|
|
|
|
{TFM_BWEIGHT, "BWEIGHT", "Bweight", ""},
|
|
|
|
|
{TFM_ALIGN, "ALIGN", "Align", ""},
|
|
|
|
|
{0, NULL, NULL, NULL}
|
|
|
|
|
};
|
2008-12-29 04:14:27 +00:00
|
|
|
|
|
|
|
|
/* identifiers */
|
|
|
|
|
ot->name = "Transform";
|
|
|
|
|
ot->idname = "TFM_OT_transform";
|
2009-01-03 22:15:59 +00:00
|
|
|
ot->flag= OPTYPE_REGISTER;
|
2008-12-29 04:14:27 +00:00
|
|
|
|
|
|
|
|
/* api callbacks */
|
|
|
|
|
ot->invoke = transform_invoke;
|
|
|
|
|
ot->exec = transform_exec;
|
|
|
|
|
ot->modal = transform_modal;
|
2009-01-03 22:15:59 +00:00
|
|
|
ot->cancel = transform_cancel;
|
2008-12-29 04:14:27 +00:00
|
|
|
ot->poll = ED_operator_areaactive;
|
|
|
|
|
|
2009-01-18 21:36:38 +00:00
|
|
|
RNA_def_enum(ot->srna, "mode", transform_mode_types, 0, "Mode", "");
|
2009-01-16 23:53:11 +00:00
|
|
|
RNA_def_int(ot->srna, "options", 0, INT_MIN, INT_MAX, "Options", "", INT_MIN, INT_MAX);
|
2008-12-29 04:14:27 +00:00
|
|
|
|
2009-01-25 17:08:56 +00:00
|
|
|
RNA_def_float_vector(ot->srna, "values", 4, NULL, -FLT_MAX, FLT_MAX, "Values", "", -FLT_MAX, FLT_MAX);
|
2009-01-10 19:45:48 +00:00
|
|
|
|
2009-01-16 23:53:11 +00:00
|
|
|
RNA_def_int(ot->srna, "constraint_orientation", 0, INT_MIN, INT_MAX, "Constraint Orientation", "", INT_MIN, INT_MAX);
|
|
|
|
|
RNA_def_int(ot->srna, "constraint_mode", 0, INT_MIN, INT_MAX, "Constraint Mode", "", INT_MIN, INT_MAX);
|
2009-01-10 19:45:48 +00:00
|
|
|
|
2009-01-16 23:53:11 +00:00
|
|
|
RNA_def_float_matrix(ot->srna, "constraint_matrix", 9, mtx[0], -FLT_MAX, FLT_MAX, "Constraint Matrix", "", -FLT_MAX, FLT_MAX);
|
2008-12-29 04:14:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void transform_operatortypes(void)
|
|
|
|
|
{
|
|
|
|
|
WM_operatortype_append(TFM_OT_transform);
|
2009-01-18 21:36:38 +00:00
|
|
|
WM_operatortype_append(TFM_OT_select_orientation);
|
2008-12-29 04:14:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void transform_keymap_for_space(struct wmWindowManager *wm, struct ListBase *keymap, int spaceid)
|
|
|
|
|
{
|
|
|
|
|
wmKeymapItem *km;
|
|
|
|
|
switch(spaceid)
|
|
|
|
|
{
|
|
|
|
|
case SPACE_VIEW3D:
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
2009-01-28 15:39:39 +00:00
|
|
|
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
|
|
|
|
|
2008-12-29 04:14:27 +00:00
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", RKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_ROTATION);
|
|
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", SKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_RESIZE);
|
|
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", WKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_WARP);
|
|
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TOSPHERE);
|
|
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", SKEY, KM_PRESS, KM_ALT|KM_CTRL|KM_SHIFT, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_SHEAR);
|
|
|
|
|
|
2009-01-18 21:36:38 +00:00
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_select_orientation", SPACEKEY, KM_PRESS, KM_ALT, 0);
|
|
|
|
|
|
2008-12-29 04:14:27 +00:00
|
|
|
break;
|
2008-12-29 06:06:59 +00:00
|
|
|
case SPACE_ACTION:
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE);
|
|
|
|
|
|
2009-01-28 15:39:39 +00:00
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TIME_TRANSLATE);
|
|
|
|
|
|
2008-12-29 06:06:59 +00:00
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", EKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
|
|
|
|
|
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", SKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TIME_SCALE);
|
|
|
|
|
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", TKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TIME_SLIDE);
|
2009-01-04 01:08:01 +00:00
|
|
|
break;
|
2009-01-28 00:50:56 +00:00
|
|
|
case SPACE_IPO:
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0);
|
2009-01-28 15:39:39 +00:00
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
|
|
|
|
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
|
2009-01-28 00:50:56 +00:00
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
|
|
|
|
|
2009-01-28 02:56:58 +00:00
|
|
|
// XXX the 'mode' identifier here is not quite right
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", EKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
|
|
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", RKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_ROTATION);
|
2009-01-28 00:50:56 +00:00
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", SKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_RESIZE);
|
|
|
|
|
break;
|
2009-01-02 23:58:03 +00:00
|
|
|
case SPACE_NODE:
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0);
|
2009-01-04 01:08:01 +00:00
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
|
|
|
|
|
2009-01-28 15:39:39 +00:00
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", EVT_TWEAK_A, KM_ANY, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
|
|
|
|
|
2009-01-04 01:08:01 +00:00
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", RKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_ROTATION);
|
|
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", SKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_RESIZE);
|
|
|
|
|
break;
|
2009-01-21 07:01:20 +00:00
|
|
|
case SPACE_SEQ:
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
2009-01-28 15:39:39 +00:00
|
|
|
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
|
|
|
|
|
2009-01-24 05:38:25 +00:00
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", EKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TIME_EXTEND);
|
2009-01-21 07:01:20 +00:00
|
|
|
break;
|
2009-01-28 21:43:43 +00:00
|
|
|
case SPACE_IMAGE:
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", GKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
|
|
|
|
|
|
|
|
|
km= WM_keymap_add_item(keymap, "TFM_OT_transform", EVT_TWEAK_S, KM_ANY, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_TRANSLATION);
|
|
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", RKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_ROTATION);
|
|
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", SKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_RESIZE);
|
|
|
|
|
|
|
|
|
|
km = WM_keymap_add_item(keymap, "TFM_OT_transform", SKEY, KM_PRESS, KM_ALT|KM_CTRL|KM_SHIFT, 0);
|
|
|
|
|
RNA_int_set(km->ptr, "mode", TFM_SHEAR);
|
|
|
|
|
break;
|
2008-12-29 04:14:27 +00:00
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|