diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-09-18 10:41:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-09-18 10:41:29 +0400 |
commit | 0a2b8b13089ef479d4a2d135b567410c8a5e6ab5 (patch) | |
tree | 3377b2bd39b6e7c2e3ce302a3bb01d7b2ddfbe25 /source/blender/python/api2_2x/Pose.c | |
parent | d86a03113d24904dd4b6227f16431eb6735aa5d7 (diff) |
A user submitted a BVH file that took a long time to import (I didnt end up finishing since it was so slow)
this is mainly because adding pose keyframes recalculates every handle so importing became increasingly slow.
added a 'fast' argument to insertkey that python api's insertPoseKey can make use of since it alredy accepts a 'fast' option.
The ~4450 frame, 31 bone BVH imports in ~108sec now
Seperated editmode switch statement in space.c's event handling,
if editmode is disabled, or the images is a render or composite, UV editing operations are ignored.
In previous releases it has given an annoying warning if selecting or scaling is attempted when out of UV/Face mode.
Diffstat (limited to 'source/blender/python/api2_2x/Pose.c')
-rw-r--r-- | source/blender/python/api2_2x/Pose.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/source/blender/python/api2_2x/Pose.c b/source/blender/python/api2_2x/Pose.c index 47ae96b2286..34807c4a85c 100644 --- a/source/blender/python/api2_2x/Pose.c +++ b/source/blender/python/api2_2x/Pose.c @@ -422,7 +422,11 @@ static PyObject *PoseBone_insertKey(BPy_PoseBone *self, PyObject *args) if (!PyArg_ParseTuple(args, "O!i|Oi", &Object_Type, &parent_object, &frame, &constants, &no_ipo_update )) goto AttributeError; - + + /* incase we ever have a value other then 1 for fast */ + if (no_ipo_update) + no_ipo_update = 1; + //verify that this pchannel is part of the object->pose for (pchan = ((BPy_Object*)parent_object)->object->pose->chanbase.first; pchan; pchan = pchan->next){ @@ -487,40 +491,40 @@ static PyObject *PoseBone_insertKey(BPy_PoseBone *self, PyObject *args) //add the action channel if it's not there verify_action_channel(((BPy_Object*)parent_object)->object->action, self->posechannel->name); - + //insert the pose keys if (self->posechannel->flag & POSE_ROT){ insertkey(&((BPy_Object*)parent_object)->object->id, - ID_PO, self->posechannel->name, NULL, AC_QUAT_X); + ID_PO, self->posechannel->name, NULL, AC_QUAT_X, no_ipo_update); insertkey(&((BPy_Object*)parent_object)->object->id, - ID_PO, self->posechannel->name, NULL, AC_QUAT_Y); + ID_PO, self->posechannel->name, NULL, AC_QUAT_Y, no_ipo_update); insertkey(&((BPy_Object*)parent_object)->object->id, - ID_PO, self->posechannel->name, NULL, AC_QUAT_Z); + ID_PO, self->posechannel->name, NULL, AC_QUAT_Z, no_ipo_update); insertkey(&((BPy_Object*)parent_object)->object->id, - ID_PO, self->posechannel->name, NULL, AC_QUAT_W); + ID_PO, self->posechannel->name, NULL, AC_QUAT_W, no_ipo_update); } if (self->posechannel->flag & POSE_LOC){ insertkey(&((BPy_Object*)parent_object)->object->id, - ID_PO, self->posechannel->name, NULL, AC_LOC_X); + ID_PO, self->posechannel->name, NULL, AC_LOC_X, no_ipo_update); insertkey(&((BPy_Object*)parent_object)->object->id, - ID_PO, self->posechannel->name, NULL, AC_LOC_Y); + ID_PO, self->posechannel->name, NULL, AC_LOC_Y, no_ipo_update); insertkey(&((BPy_Object*)parent_object)->object->id, - ID_PO, self->posechannel->name, NULL, AC_LOC_Z); + ID_PO, self->posechannel->name, NULL, AC_LOC_Z, no_ipo_update); } if (self->posechannel->flag & POSE_SIZE){ insertkey(&((BPy_Object*)parent_object)->object->id, - ID_PO, self->posechannel->name, NULL, AC_SIZE_X); + ID_PO, self->posechannel->name, NULL, AC_SIZE_X, no_ipo_update); insertkey(&((BPy_Object*)parent_object)->object->id, - ID_PO, self->posechannel->name, NULL, AC_SIZE_Y); + ID_PO, self->posechannel->name, NULL, AC_SIZE_Y, no_ipo_update); insertkey(&((BPy_Object*)parent_object)->object->id, - ID_PO, self->posechannel->name, NULL, AC_SIZE_Z); + ID_PO, self->posechannel->name, NULL, AC_SIZE_Z, no_ipo_update); } //flip the frame back G.scene->r.cfra = oldframe; //update the IPOs - if (!no_ipo_update) + if (no_ipo_update==0) remake_action_ipos (((BPy_Object*)parent_object)->object->action); Py_RETURN_NONE; |