2.5 - Object name display in 3d-view now highlights on frames with keyframes again.
authorJoshua Leung <aligorith@gmail.com>
Sun, 21 Dec 2008 10:33:24 +0000 (10:33 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sun, 21 Dec 2008 10:33:24 +0000 (10:33 +0000)
* 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!

source/blender/blenkernel/BKE_action.h
source/blender/blenkernel/intern/action.c
source/blender/editors/animation/anim_keyframing.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/space_view3d/SConscript
source/blender/editors/space_view3d/view3d_draw.c

index 37ced4cb00b234f639da9a85be7f61525afd4bf3..37b1332170aae9cd49420f9141726f554cfffd81 100644 (file)
@@ -92,6 +92,12 @@ void do_all_shape_actions(struct Object *);
  */
 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
index 98f8a83f8094203131313db04107d75f53f2e033..13ceced789b70591e1e43ee23a9a8aee7280b677 100644 (file)
@@ -278,6 +278,24 @@ bPoseChannel *verify_pose_channel(bPose* pose, const char* name)
        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)
index 51dc04fa4078c5f321fcab90baadae829e662a63..7a0e133a670773e159219836aa53093edbab227c 100644 (file)
@@ -25,7 +25,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#if 0 // XXX reenable this file again later...
+
 
 #include <stdio.h>
 #include <string.h>
@@ -382,6 +382,8 @@ void insert_vert_icu (IpoCurve *icu, float x, float y, short fast)
        }
 }
 
+#if 0 // XXX code to clean up
+
 /* ------------------- Get Data ------------------------ */
 
 /* Get pointer to use to get values from */
@@ -2083,6 +2085,8 @@ void common_deletekey (void)
        common_modifykey(COMMONKEY_MODE_DELETE);
 }
 
+#endif // XXX reenable this file again later...
+
 /* ************************************************** */
 /* KEYFRAME DETECTION */
 
@@ -2282,5 +2286,3 @@ short id_frame_has_keyframe (ID *id, float frame, short filter)
 }
 
 /* ************************************************** */
-
-#endif // XXX reenable this file again later...
index c63c4d8a872ab82180c7e03c8e5c662fe5dc9522..077dd110269759950c5fec11413ceb6f31b60083 100644 (file)
@@ -247,7 +247,7 @@ static int previewrange_define_exec(bContext *C, wmOperator *op)
        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;
 } 
index fac4cd65ee2fc250d8df8ef280576c3acdcb8797..4d9d484ffa16a42f2c425a2926c2a532a8664a29 100644 (file)
@@ -8,4 +8,4 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 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] )
index a4134aac4498b6e735c115aff59e2f9cc74062d5..d2f9831ec6e0431c49b0b458ba2f23dc701d1e2a 100644 (file)
@@ -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 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d)
                }
                
                /* 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 {