diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-12-23 14:02:39 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-12-23 14:02:39 +0300 |
commit | 87c05f7836e5b646e0053bd23f138bc36ab18773 (patch) | |
tree | 97bd56f7e3f9a28cf544dc904ba0790697764a5b /source/blender/editors/space_action/action_ops.c | |
parent | 58da63cd3efb8c4a1789f0a49afa144c40c551b0 (diff) |
2.5 Action Editor - Big WIP Commit
* Brought back backend for editing keyframes IPO/IPO-Curves. Did some refactoring work here that will still have to be verified when operators using them are added.
* Animation channel filtering code now returns the number of channels filtered (for Action Editor to set totrect of channels - TODO still!)
* View2D - made function to check if mouse is in View2D scrollers an API function
* Renamed keyframe related files. The old names were too clumsy.
* Started porting click-select operators for Action Editor. These don't work currently, as the events are being stolen by the markers. This needs to be fixed ASAP.
Diffstat (limited to 'source/blender/editors/space_action/action_ops.c')
-rw-r--r-- | source/blender/editors/space_action/action_ops.c | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c new file mode 100644 index 00000000000..9a64a026f81 --- /dev/null +++ b/source/blender/editors/space_action/action_ops.c @@ -0,0 +1,91 @@ +/** + * $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_listBase.h" +#include "DNA_action_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_windowmanager_types.h" + +#include "BLI_blenlib.h" + +#include "BKE_context.h" +#include "BKE_utildefines.h" + +#include "UI_interface.h" +#include "UI_view2d.h" + +#include "action_intern.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "WM_api.h" +#include "WM_types.h" + + +/* ************************** registration - operator types **********************************/ + +void action_operatortypes(void) +{ + /* channels */ + + /* keyframes */ + WM_operatortype_append(ED_ACT_OT_keyframes_clickselect); +} + +/* ************************** registration - keymaps **********************************/ + +static void action_keymap_keyframes (ListBase *keymap) +{ + /* click-select */ + WM_keymap_add_item(keymap, "ED_ACT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "ED_ACT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend_select", 1); + RNA_boolean_set(WM_keymap_add_item(keymap, "ED_ACT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_ALT, 0)->ptr, "left_right", 1); +} + +/* --------------- */ + +void action_keymap(wmWindowManager *wm) +{ + ListBase *keymap; + + /* channels */ + keymap= WM_keymap_listbase(wm, "Action_Channels", SPACE_ACTION, 0); + + /* keyframes */ + keymap= WM_keymap_listbase(wm, "Action_Keys", SPACE_ACTION, 0); + action_keymap_keyframes(keymap); +} + |