Revision: 17985
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17985
Author:   aligorith
Date:     2008-12-21 11:33:24 +0100 (Sun, 21 Dec 2008)

Log Message:
-----------
2.5 - Object name display in 3d-view now highlights on frames with keyframes 
again.

* Re-exposed relevant parts of anim_keyframing.c code that doesn't have 
external dependencies. 
* Added get_active_posechannel() to blenkernel api for poses/posechannels to 
solve the only missing link I found. This should have been moved there ages ago!

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/blenkernel/BKE_action.h
    branches/blender2.5/blender/source/blender/blenkernel/intern/action.c
    
branches/blender2.5/blender/source/blender/editors/animation/anim_keyframing.c
    branches/blender2.5/blender/source/blender/editors/animation/anim_ops.c
    branches/blender2.5/blender/source/blender/editors/space_view3d/SConscript
    
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_draw.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/BKE_action.h
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/BKE_action.h  
2008-12-21 09:58:32 UTC (rev 17984)
+++ branches/blender2.5/blender/source/blender/blenkernel/BKE_action.h  
2008-12-21 10:33:24 UTC (rev 17985)
@@ -92,6 +92,12 @@
  */
 struct  bPoseChannel *get_pose_channel(const struct bPose *pose,
                                                                           
const char *name);
+                                                                          
+/**
+ * Return a pointer to the active pose channel from this Object.
+ * (Note: Object, not bPose is used here, as we need layer info from Armature)
+ */
+struct bPoseChannel *get_active_posechannel(struct Object *ob);
 
 /** 
  * Looks to see if the channel with the given name

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/action.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/action.c       
2008-12-21 09:58:32 UTC (rev 17984)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/action.c       
2008-12-21 10:33:24 UTC (rev 17985)
@@ -278,7 +278,25 @@
        return chan;
 }
 
+/* Find the active posechannel for an object (we can't just use pose, as layer 
info is in armature) */
+bPoseChannel *get_active_posechannel (Object *ob)
+{
+       bArmature *arm= (ob) ? ob->data : NULL;
+       bPoseChannel *pchan;
+       
+       if ELEM3(NULL, ob, ob->pose, arm)
+               return NULL;
+       
+       /* find active */
+       for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
+               if ((pchan->bone) && (pchan->bone->flag & BONE_ACTIVE) && 
(pchan->bone->layer & arm->layer))
+                       return pchan;
+       }
+       
+       return NULL;
+}
 
+
 /* dst should be freed already, makes entire duplicate */
 void copy_pose(bPose **dst, bPose *src, int copycon)
 {

Modified: 
branches/blender2.5/blender/source/blender/editors/animation/anim_keyframing.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/animation/anim_keyframing.c  
    2008-12-21 09:58:32 UTC (rev 17984)
+++ 
branches/blender2.5/blender/source/blender/editors/animation/anim_keyframing.c  
    2008-12-21 10:33:24 UTC (rev 17985)
@@ -25,8 +25,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#if 0 // XXX reenable this file again later...
 
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -382,6 +382,8 @@
        }
 }
 
+#if 0 // XXX code to clean up
+
 /* ------------------- Get Data ------------------------ */
 
 /* Get pointer to use to get values from */
@@ -2083,6 +2085,8 @@
        common_modifykey(COMMONKEY_MODE_DELETE);
 }
 
+#endif // XXX reenable this file again later...
+
 /* ************************************************** */
 /* KEYFRAME DETECTION */
 
@@ -2282,5 +2286,3 @@
 }
 
 /* ************************************************** */
-
-#endif // XXX reenable this file again later...

Modified: 
branches/blender2.5/blender/source/blender/editors/animation/anim_ops.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_ops.c     
2008-12-21 09:58:32 UTC (rev 17984)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_ops.c     
2008-12-21 10:33:24 UTC (rev 17985)
@@ -247,7 +247,7 @@
        scene->r.psfra= (int)sfra;
        scene->r.pefra= (int)efra;
        
-       //BIF_undo_push("Set Preview Range");
+       //BIF_undo_push("Clear Preview Range");
        
        return OPERATOR_FINISHED;
 } 

Modified: 
branches/blender2.5/blender/source/blender/editors/space_view3d/SConscript
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_view3d/SConscript  
2008-12-21 09:58:32 UTC (rev 17984)
+++ branches/blender2.5/blender/source/blender/editors/space_view3d/SConscript  
2008-12-21 10:33:24 UTC (rev 17985)
@@ -8,4 +8,4 @@
 incs += ' ../../render/extern/include #/intern/guardedalloc #intern/bmfont'
 incs += ' ../../gpu ../../makesrna'
 
-env.BlenderLib ( 'bf_editors_space_view3d', sources, Split(incs), [], 
libtype=['core','intern'], priority=[35, 40] )
+env.BlenderLib ( 'bf_editors_space_view3d', sources, Split(incs), [], 
libtype=['core','intern'], priority=[33, 38] )

Modified: 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_draw.c   
    2008-12-21 09:58:32 UTC (rev 17984)
+++ 
branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_draw.c   
    2008-12-21 10:33:24 UTC (rev 17985)
@@ -70,6 +70,7 @@
 
 #include "WM_api.h"
 
+#include "ED_keyframing.h"
 #include "ED_screen.h"
 #include "ED_util.h"
 #include "ED_types.h"
@@ -795,9 +796,9 @@
                }
                
                /* colour depends on whether there is a keyframe */
-// XXX         if (id_frame_has_keyframe((ID *)ob, frame_to_float(CFRA), 
v3d->keyflags))
-//                     UI_ThemeColor(TH_VERTEX_SELECT);
-//             else
+       if (id_frame_has_keyframe((ID *)ob, frame_to_float(CFRA), 
v3d->keyflags))
+                       UI_ThemeColor(TH_VERTEX_SELECT);
+               else
                        UI_ThemeColor(TH_TEXT_HI);
        }
        else {


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to