2.5 - 2 Armature Related Crash Fixes
authorJoshua Leung <aligorith@gmail.com>
Sun, 20 Sep 2009 01:36:11 +0000 (01:36 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sun, 20 Sep 2009 01:36:11 +0000 (01:36 +0000)
* #19397: Properties panel (transform panel in 3D-View) crashed when there was no active posechannel.

* Breakdown/Push/Relax Pose tools crashed when auto-keyframing was enabled. There where 2 main causes here: 1) laziness to try and avoid having to clear some data everytime, 2) a typo for one of the KeyingSet names

source/blender/editors/armature/poseSlide.c
source/blender/editors/space_view3d/view3d_buttons.c

index e55c56081125b877a1fe852031bfc33804363f95..eb290b1f83c2d96b64bee8c4c4f0c63d761bc239 100644 (file)
@@ -219,7 +219,7 @@ static int pose_slide_init (bContext *C, wmOperator *op, short mode)
        /* get builtin KeyingSets */
        pso->ks_loc= ANIM_builtin_keyingset_get_named(NULL, "Location");
        pso->ks_rot= ANIM_builtin_keyingset_get_named(NULL, "Rotation");
-       pso->ks_scale= ANIM_builtin_keyingset_get_named(NULL, "Scale");
+       pso->ks_scale= ANIM_builtin_keyingset_get_named(NULL, "Scaling");
        
        /* return status is whether we've got all the data we were requested to get */
        return 1;
@@ -393,8 +393,7 @@ static void pose_slide_autoKeyframe (bContext *C, tPoseSlideOp *pso, bPoseChanne
                ListBase dsources = {&cks, &cks};
                
                /* init common-key-source for use by KeyingSets */
-               // TODO: for now, we don't clear it out, since it should be safe to do so...
-               //memset(&cks, 0, sizeof(bCommonKeySrc));
+               memset(&cks, 0, sizeof(bCommonKeySrc));
                cks.id= &pso->ob->id;
                
                /* init cks for this PoseChannel, then use the relative KeyingSets to keyframe it */
index 286b0ca0898dec4f20b4518182133c835a723bfd..89d07fbbfea4027ad47a0d8f904db81afa59b4a9 100644 (file)
@@ -512,6 +512,10 @@ static void v3d_posearmature_buts(uiBlock *block, View3D *v3d, Object *ob, float
                if(bone && (bone->flag & BONE_ACTIVE) && (bone->layer & arm->layer))
                        break;
        }
+       if (!pchan)     {
+               uiDefBut(block, LABEL, 0, "No Bone Active",                     0, 240, 100, 20, 0, 0, 0, 0, 0, "");
+               return; 
+       }
        
        if (pchan->rotmode == PCHAN_ROT_AXISANGLE) {
                float quat[4];
@@ -1447,25 +1451,12 @@ void view3d_buttons_register(ARegionType *art)
        pt->draw= view3d_panel_transform_spaces;
        BLI_addtail(&art->paneltypes, pt);
 
-       pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil");
-       strcpy(pt->idname, "VIEW3D_PT_gpencil");
-       strcpy(pt->label, "Greas Pencil");
-       pt->draw= view3d_panel_gpencil;
-       BLI_addtail(&art->paneltypes, pt);*/
-
        pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel bonesketch spaces");
        strcpy(pt->idname, "VIEW3D_PT_bonesketch_spaces");
        strcpy(pt->label, "Bone Sketching");
        pt->draw= view3d_panel_bonesketch_spaces;
        pt->poll= view3d_panel_bonesketch_spaces_poll;
        BLI_addtail(&art->paneltypes, pt);
-
-       /*
-       pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel redo");
-       strcpy(pt->idname, "VIEW3D_PT_redo");
-       strcpy(pt->label, "Last Operator");
-       pt->draw= view3d_panel_operator_redo;
-       BLI_addtail(&art->paneltypes, pt);
 */
        // XXX view3d_panel_preview(C, ar, 0);
 }