~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to source/blender/python/api2_2x/Pose.c

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#include "DNA_scene_types.h"
44
44
#include "DNA_space_types.h"    //1 - this order
45
45
#include "BSE_editipo.h"                        //2
 
46
#include "BIF_keyframing.h"
46
47
#include "BLI_blenlib.h"
47
48
#include "BLI_arithb.h"
48
49
#include "Mathutils.h"
413
414
{
414
415
        PyObject *parent_object = NULL;
415
416
        PyObject *constants = NULL, *item = NULL;
416
 
        int frame = 1, oldframe, length, x, numeric_value = 0, oldflag, no_ipo_update = 0;
 
417
        int frame = 1, oldframe, length, x, numeric_value = 0, oldflag, no_ipo_update = 0, flag = 0;
417
418
        bPoseChannel *pchan = NULL;
418
419
        
419
420
 
420
421
        if (!PyArg_ParseTuple(args, "O!i|Oi", &Object_Type, &parent_object, &frame, &constants, &no_ipo_update ))
421
422
                goto AttributeError;
422
423
        
423
 
        /* incase we ever have a value other then 1 for fast */
424
 
        if (no_ipo_update)
425
 
                no_ipo_update = 1;
 
424
        /* flag should be initialised with the 'autokeying' flags like for normal keying */
 
425
        if (no_ipo_update) flag |= INSERTKEY_FAST;
 
426
        if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
 
427
        if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
426
428
        
427
429
        //verify that this pchannel is part of the object->pose
428
430
        for (pchan = ((BPy_Object*)parent_object)->object->pose->chanbase.first; 
492
494
        //insert the pose keys
493
495
        if (self->posechannel->flag & POSE_ROT){
494
496
                insertkey(&((BPy_Object*)parent_object)->object->id, 
495
 
                        ID_PO, self->posechannel->name, NULL, AC_QUAT_X, no_ipo_update);
496
 
                insertkey(&((BPy_Object*)parent_object)->object->id, 
497
 
                        ID_PO, self->posechannel->name, NULL, AC_QUAT_Y, no_ipo_update);
498
 
                insertkey(&((BPy_Object*)parent_object)->object->id, 
499
 
                        ID_PO, self->posechannel->name, NULL, AC_QUAT_Z, no_ipo_update);
500
 
                insertkey(&((BPy_Object*)parent_object)->object->id, 
501
 
                        ID_PO, self->posechannel->name, NULL, AC_QUAT_W, no_ipo_update);
 
497
                        ID_PO, self->posechannel->name, NULL, AC_QUAT_X, flag);
 
498
                insertkey(&((BPy_Object*)parent_object)->object->id, 
 
499
                        ID_PO, self->posechannel->name, NULL, AC_QUAT_Y, flag);
 
500
                insertkey(&((BPy_Object*)parent_object)->object->id, 
 
501
                        ID_PO, self->posechannel->name, NULL, AC_QUAT_Z, flag);
 
502
                insertkey(&((BPy_Object*)parent_object)->object->id, 
 
503
                        ID_PO, self->posechannel->name, NULL, AC_QUAT_W, flag);
502
504
        }
503
505
        if (self->posechannel->flag & POSE_LOC){
504
506
                insertkey(&((BPy_Object*)parent_object)->object->id, 
505
 
                        ID_PO, self->posechannel->name, NULL, AC_LOC_X, no_ipo_update);
506
 
                insertkey(&((BPy_Object*)parent_object)->object->id, 
507
 
                        ID_PO, self->posechannel->name, NULL, AC_LOC_Y, no_ipo_update);
508
 
                insertkey(&((BPy_Object*)parent_object)->object->id, 
509
 
                        ID_PO, self->posechannel->name, NULL, AC_LOC_Z, no_ipo_update);
 
507
                        ID_PO, self->posechannel->name, NULL, AC_LOC_X, flag);
 
508
                insertkey(&((BPy_Object*)parent_object)->object->id, 
 
509
                        ID_PO, self->posechannel->name, NULL, AC_LOC_Y, flag);
 
510
                insertkey(&((BPy_Object*)parent_object)->object->id, 
 
511
                        ID_PO, self->posechannel->name, NULL, AC_LOC_Z, flag);
510
512
        }
511
513
        if (self->posechannel->flag & POSE_SIZE){
512
514
                insertkey(&((BPy_Object*)parent_object)->object->id, 
513
 
                        ID_PO, self->posechannel->name, NULL, AC_SIZE_X, no_ipo_update);
514
 
                insertkey(&((BPy_Object*)parent_object)->object->id, 
515
 
                        ID_PO, self->posechannel->name, NULL, AC_SIZE_Y, no_ipo_update);
516
 
                insertkey(&((BPy_Object*)parent_object)->object->id, 
517
 
                        ID_PO, self->posechannel->name, NULL, AC_SIZE_Z, no_ipo_update);
 
515
                        ID_PO, self->posechannel->name, NULL, AC_SIZE_X, flag);
 
516
                insertkey(&((BPy_Object*)parent_object)->object->id, 
 
517
                        ID_PO, self->posechannel->name, NULL, AC_SIZE_Y, flag);
 
518
                insertkey(&((BPy_Object*)parent_object)->object->id, 
 
519
                        ID_PO, self->posechannel->name, NULL, AC_SIZE_Z, flag);
518
520
        }
519
521
 
520
522
        //flip the frame back