2.5 - More Animation Bugfixes
authorJoshua Leung <aligorith@gmail.com>
Sat, 19 Sep 2009 12:36:22 +0000 (12:36 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sat, 19 Sep 2009 12:36:22 +0000 (12:36 +0000)
* Updating Preview Range settings results in correct updates for Animation Editors

* Compositing nodes now correctly animate when the values were set by IKEY/RMB on suitable node parameters. Beware that these nodes are not relinkable node-trees, hence the standard code not working.

* Ctrl-P to parent objects to bones now works in Pose Mode too. I needed to add a special keymap entry for this, though I thought this would have been better to be automatically inherited/present from Object keymap already?
* Ctrl-P -> Parent to Bone option now works correctly again. 1.5 lines of code missing here...

* Breakdowns tool now shows custom cursor during 'modal' phase so that it's not that confusing what's going on.

source/blender/blenkernel/intern/anim_sys.c
source/blender/editors/armature/armature_ops.c
source/blender/editors/armature/poseSlide.c
source/blender/editors/object/object_relations.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_nla/space_nla.c

index 522297da1d729ace549847d7c4e1a357817458fb..8b761a2ee0e4639d2a3b5a51b6bc432ed18ac93d 100644 (file)
@@ -40,6 +40,7 @@
 #include "BLI_dynstr.h"
 
 #include "DNA_anim_types.h"
+#include "DNA_scene_types.h"
 
 #include "BKE_animsys.h"
 #include "BKE_action.h"
@@ -1517,7 +1518,10 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
                AnimData *adt= BKE_animdata_from_id(id);
                Curve *cu= (Curve *)id;
                
+               /* set ctime variable for curve */
                cu->ctime= ctime;
+               
+               /* now execute animation data on top of this as per normal */
                BKE_animsys_evaluate_animdata(id, adt, ctime, ADT_RECALC_ANIM);
        }
        
@@ -1537,7 +1541,19 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
        EVAL_ANIM_IDS(main->world.first, ADT_RECALC_ANIM);
        
        /* scenes */
-       EVAL_ANIM_IDS(main->scene.first, ADT_RECALC_ANIM);
+       for (id= main->scene.first; id; id= id->next) {
+               AnimData *adt= BKE_animdata_from_id(id);
+               Scene *scene= (Scene *)id;
+               
+               /* do compositing nodes first (since these aren't included in main tree) */
+               if (scene->nodetree) {
+                       AnimData *adt2= BKE_animdata_from_id((ID *)scene->nodetree);
+                       BKE_animsys_evaluate_animdata((ID *)scene->nodetree, adt2, ctime, ADT_RECALC_ANIM);
+               }
+               
+               /* now execute scene animation data as per normal */
+               BKE_animsys_evaluate_animdata(id, adt, ctime, ADT_RECALC_ANIM);
+       }
 }
 
 /* ***************************************** */ 
index a8b8b8aecc172a58a6ab9b11f7946433e174d95c..fae0b0935513d6908e3b0243778895c35e4ce4b9 100644 (file)
@@ -298,6 +298,9 @@ void ED_keymap_armature(wmWindowManager *wm)
        keymap= WM_keymap_find(wm, "Pose", 0, 0);
        keymap->poll= ED_operator_posemode;
        
+       // XXX: set parent is object-based operator, but it should also be available here...
+       WM_keymap_add_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
+       
        WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, 0, 0);
        kmi= WM_keymap_add_item(keymap, "POSE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0);
                RNA_boolean_set(kmi->ptr, "unselected", 1);
@@ -310,7 +313,6 @@ void ED_keymap_armature(wmWindowManager *wm)
        WM_keymap_add_item(keymap, "POSE_OT_loc_clear", GKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "POSE_OT_scale_clear", SKEY, KM_PRESS, KM_ALT, 0);
        
-               // for now, we include hotkeys for copy/paste
        WM_keymap_add_item(keymap, "POSE_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0);
        kmi= WM_keymap_add_item(keymap, "POSE_OT_paste", VKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
index bbc9ef4d09c94961f79576648aa9da4da2d3c7c9..e55c56081125b877a1fe852031bfc33804363f95 100644 (file)
@@ -480,6 +480,7 @@ static int pose_slide_invoke_common (bContext *C, wmOperator *op, tPoseSlideOp *
 {
        tPChanFCurveLink *pfl;
        AnimData *adt= pso->ob->adt;
+       wmWindow *win= CTX_wm_window(C);
        
        /* for each link, add all its keyframes to the search tree */
        for (pfl= pso->pfLinks.first; pfl; pfl= pfl->next) {
@@ -543,6 +544,9 @@ static int pose_slide_invoke_common (bContext *C, wmOperator *op, tPoseSlideOp *
                /* initial apply for operator... */
                pose_slide_apply(C, op, pso);
                
+               /* set cursor to indicate modal */
+               WM_cursor_modal(win, BC_EW_SCROLLCURSOR);
+               
                /* add a modal handler for this operator */
                WM_event_add_modal_handler(C, op);
                return OPERATOR_RUNNING_MODAL;
@@ -559,14 +563,17 @@ static int pose_slide_invoke_common (bContext *C, wmOperator *op, tPoseSlideOp *
 static int pose_slide_modal (bContext *C, wmOperator *op, wmEvent *evt)
 {
        tPoseSlideOp *pso= op->customdata;
+       wmWindow *win= CTX_wm_window(C);
        
        switch (evt->type) {
                case LEFTMOUSE: /* confirm */
+                       WM_cursor_restore(win);
                        pose_slide_exit(C, op);
                        return OPERATOR_FINISHED;
                
                case ESCKEY:    /* cancel */
                case RIGHTMOUSE: 
+                       WM_cursor_restore(win);
                        pose_slide_exit(C, op);
                        return OPERATOR_CANCELLED;
                        
index 12cb2b95e068cc2e127f758a091223362e896ee9..65061e8dfb9368fb18e0dc0316c3d4052737f544 100644 (file)
@@ -647,6 +647,8 @@ static int parent_set_exec(bContext *C, wmOperator *op)
                                
                                if( ELEM(partype, PAR_CURVE, PAR_LATTICE) || pararm )
                                        ob->partype= PARSKEL; /* note, dna define, not operator property */
+                               else if (partype == PAR_BONE)
+                                       ob->partype= PARBONE; /* note, dna define, not operator property */
                                else
                                        ob->partype= PAROBJECT; /* note, dna define, not operator property */
                        }
index bceee73d5f052ee03fe81555e98e9c77d659876e..3b275cab814be8d702f13b7cbfbec0203d14c899 100644 (file)
@@ -323,6 +323,7 @@ static void action_main_area_listener(ARegion *ar, wmNotifier *wmn)
                        break;
                case NC_SCENE:
                        switch(wmn->data) {
+                               case ND_RENDER_OPTIONS:
                                case ND_OB_ACTIVE:
                                case ND_FRAME:
                                case ND_MARKERS:
index e0b961b38f17c5f60a1d2b89bb18d8a94015ae41..a7ea2294ed49a8e1ffa43e139156f12ddec57062 100644 (file)
@@ -374,6 +374,7 @@ static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
                        break;
                case NC_SCENE:
                        switch(wmn->data) {
+                               case ND_RENDER_OPTIONS:
                                case ND_OB_ACTIVE:
                                case ND_FRAME:
                                case ND_MARKERS:
index 06ee34a6573a87a37a0c81c59a1a1a842763ec8b..414358108893b97078b1e8295330258305b2e14f 100644 (file)
@@ -409,6 +409,7 @@ static void nla_main_area_listener(ARegion *ar, wmNotifier *wmn)
                        break;
                case NC_SCENE:
                        switch(wmn->data) {
+                               case ND_RENDER_OPTIONS:
                                case ND_OB_ACTIVE:
                                case ND_FRAME:
                                case ND_MARKERS: