Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-01-05 12:54:39 +0300
committerJoshua Leung <aligorith@gmail.com>2009-01-05 12:54:39 +0300
commitdf20a12728626372de8a5eb127e57cb2cca40649 (patch)
tree1db0a794e8bd2bcdc899857715859ede024ca564 /source/blender/editors/space_action/space_action.c
parent7de52578c044f20b166045eaf5e925c6714f6598 (diff)
2.5 - Animation Fixes + More Porting work in Action Editor
* Added crash fixes for loading old files with Actions/Armatures in them. Was caused by usage of some old globals still and the functions in question not performing NULL checks on the validity of the data they're given. * Added back reorganise action channels tools (shift/ctrl-shif pageup/down) for Action Editor. These are only available in 'Action Mode' only. * Tidied up Action Editor/Dopesheet tools code - removed various unused things, and also, added an API call in anim_deps.c to send the correct notifiers, since I anticipate that they're likely to require a few context checks which would be better to centralise than copy+paste everywhere. Note to Ton: could you have a look at this notifier stuff here? I'm not sure which ones I should be sending... * Also added a few assorted comments in various places
Diffstat (limited to 'source/blender/editors/space_action/space_action.c')
-rw-r--r--source/blender/editors/space_action/space_action.c85
1 files changed, 59 insertions, 26 deletions
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index 172e5d1d839..5c7519774bf 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -254,28 +254,6 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar)
UI_view2d_scrollers_free(scrollers);
}
-static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
-{
- /* context changes */
- switch(wmn->category) {
- case NC_SCENE:
- switch(wmn->data) {
- case ND_OB_ACTIVE:
- ED_region_tag_redraw(ar);
- break;
- }
- break;
- case NC_OBJECT:
- switch(wmn->data) {
- case ND_BONE_ACTIVE:
- case ND_BONE_SELECT:
- ED_region_tag_redraw(ar);
- break;
- }
- break;
- }
-}
-
/* add handlers, stuff you only do once or on area/region changes */
static void action_header_area_init(wmWindowManager *wm, ARegion *ar)
@@ -305,6 +283,28 @@ static void action_header_area_draw(const bContext *C, ARegion *ar)
UI_view2d_view_restore(C);
}
+static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+ /* context changes */
+ switch(wmn->category) {
+ case NC_SCENE:
+ switch(wmn->data) {
+ case ND_OB_ACTIVE:
+ ED_region_tag_redraw(ar);
+ break;
+ }
+ break;
+ case NC_OBJECT:
+ switch(wmn->data) {
+ case ND_BONE_ACTIVE:
+ case ND_BONE_SELECT:
+ ED_region_tag_redraw(ar);
+ break;
+ }
+ break;
+ }
+}
+
static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
{
/* context changes */
@@ -333,19 +333,52 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
static void action_listener(ScrArea *sa, wmNotifier *wmn)
{
/* context changes */
- switch(wmn->category) {
+ switch (wmn->category) {
case NC_SCENE:
- switch(wmn->data) {
+ /*switch (wmn->data) {
case ND_OB_ACTIVE:
+ case ND_OB_SELECT:
ED_area_tag_refresh(sa);
break;
- }
+ }*/
+ ED_area_tag_refresh(sa);
+ break;
+ case NC_OBJECT:
+ /*switch (wmn->data) {
+ case ND_BONE_SELECT:
+ case ND_BONE_ACTIVE:
+ ED_area_tag_refresh(sa);
+ break;
+ }*/
+ ED_area_tag_refresh(sa);
+ break;
}
}
static void action_refresh(const bContext *C, ScrArea *sa)
{
- printf("Heya, Action refresh needed!\n");
+ SpaceAction *saction = (SpaceAction *)sa->spacedata.first;
+
+ /* updates to data needed depends on Action Editor mode... */
+ switch (saction->mode) {
+ case SACTCONT_DOPESHEET: /* DopeSheet - for now, just all armatures... */
+ {
+
+ }
+ break;
+
+ case SACTCONT_ACTION: /* Action Editor - just active object will do */
+ {
+ Object *ob= CTX_data_active_object(C);
+
+ /* sync changes to bones to the corresponding action channels */
+ ANIM_pose_to_action_sync(ob, sa);
+ }
+ break;
+ }
+
+ /* region updates? */
+ // XXX resizing y-extents of tot should go here?
}
/* only called once, from space/spacetypes.c */