2 minor glitches
authorCampbell Barton <ideasman42@gmail.com>
Wed, 18 May 2011 08:16:33 +0000 (08:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 18 May 2011 08:16:33 +0000 (08:16 +0000)
- removing bone groups didnt set the next one active.
- removing poselib was using int for enum rna property.

source/blender/blenkernel/intern/action.c
source/blender/editors/armature/poselib.c

index 5b49d9a..77f5605 100644 (file)
@@ -831,7 +831,10 @@ void pose_remove_group (Object *ob)
                
                /* now, remove it from the pose */
                BLI_freelinkN(&pose->agroups, grp);
-               pose->active_group= 0;
+               pose->active_group--;
+               if(pose->active_group < 0 || pose->agroups.first == NULL) {
+                       pose->active_group= 0;
+               }
        }
 }
 
index 5897da9..9e0e937 100644 (file)
@@ -527,7 +527,7 @@ static int poselib_remove_exec (bContext *C, wmOperator *op)
        }
        
        /* get index (and pointer) of pose to remove */
-       marker= BLI_findlink(&act->markers, RNA_int_get(op->ptr, "pose"));
+       marker= BLI_findlink(&act->markers, RNA_enum_get(op->ptr, "pose"));
        if (marker == NULL) {
                BKE_reportf(op->reports, RPT_ERROR, "Invalid Pose specified %d", RNA_int_get(op->ptr, "pose"));
                return OPERATOR_CANCELLED;