2.5
authorTon Roosendaal <ton@blender.org>
Wed, 28 Jan 2009 13:16:43 +0000 (13:16 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 28 Jan 2009 13:16:43 +0000 (13:16 +0000)
Joshua asked me to check depsgraph drivers; i've added the
very minimal case, but further I'm stuck, need help.
Also made region listeners for Graph Editor work for all.

source/blender/blenkernel/intern/depsgraph.c
source/blender/editors/space_ipo/space_ipo.c

index 4f083c4bf9b5f93c364d93a8d6c6e8a096b8e897..265fb1258a14767f3bb43e197f68443844b6ed24 100644 (file)
@@ -347,11 +347,16 @@ static void dag_add_driver_relation(AnimData *adt, DagForest *dag, DagNode *node
                        // XXX rotational difference 
                }
                else if (driver->id) {
-                       /* normal channel-drives-channel */
-                       node1 = dag_get_node(dag, driver->id);  // XXX we assume that id is an object...
+                       if(GS(driver->id->name)==ID_OB) {
+                               /* normal channel-drives-channel */
+                               node1 = dag_get_node(dag, driver->id);
                        
-                       // XXX what happens for bone drivers?
-                       dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB, "Ipo Driver");
+                               // XXX how to find out rnapath is bone?
+                               if( ((Object *)driver->id)->type==OB_ARMATURE )
+                                       dag_add_relation(dag, node1, node, isdata?DAG_RL_DATA_DATA:DAG_RL_DATA_OB, "Ipo Driver");
+                               else
+                                       dag_add_relation(dag, node1, node, isdata?DAG_RL_OB_DATA:DAG_RL_OB_OB, "Ipo Driver");
+                       }
                }
 #if 0 // XXX old 'normal' type
 
index c3b932802680200198253b3b2c82c047a2511858..4ca891006c2addad99d05b10e6f59d76b2831e7e 100644 (file)
@@ -279,7 +279,7 @@ static void graph_header_area_draw(const bContext *C, ARegion *ar)
        UI_view2d_view_restore(C);
 }
 
-static void graph_main_area_listener(ARegion *ar, wmNotifier *wmn)
+static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
        switch(wmn->category) {
@@ -377,7 +377,7 @@ void ED_spacetype_ipo(void)
        art->regionid = RGN_TYPE_WINDOW;
        art->init= graph_main_area_init;
        art->draw= graph_main_area_draw;
-       art->listener= graph_main_area_listener;
+       art->listener= graph_region_listener;
        art->keymapflag= ED_KEYMAP_VIEW2D/*|ED_KEYMAP_MARKERS*/|ED_KEYMAP_ANIMATION|ED_KEYMAP_FRAMES;
 
        BLI_addhead(&st->regiontypes, art);
@@ -387,7 +387,7 @@ void ED_spacetype_ipo(void)
        art->regionid = RGN_TYPE_HEADER;
        art->minsizey= HEADERY;
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES;
-       
+       art->listener= graph_region_listener;
        art->init= graph_header_area_init;
        art->draw= graph_header_area_draw;
        
@@ -398,7 +398,7 @@ void ED_spacetype_ipo(void)
        art->regionid = RGN_TYPE_CHANNELS;
        art->minsizex= 200;
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES;
-       
+       art->listener= graph_region_listener;
        art->init= graph_channel_area_init;
        art->draw= graph_channel_area_draw;