From 0a2b8b13089ef479d4a2d135b567410c8a5e6ab5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Sep 2007 06:41:29 +0000 Subject: 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. --- .../blenkernel/bad_level_call_stubs/stubs.c | 4 +- source/blender/include/BSE_editipo.h | 4 +- source/blender/python/api2_2x/Camera.c | 6 +- source/blender/python/api2_2x/Constraint.c | 4 +- source/blender/python/api2_2x/Ipo.c | 2 +- source/blender/python/api2_2x/Ipocurve.c | 4 +- source/blender/python/api2_2x/Lamp.c | 22 +- source/blender/python/api2_2x/Material.c | 72 ++-- source/blender/python/api2_2x/Object.c | 70 ++-- source/blender/python/api2_2x/Pose.c | 30 +- source/blender/python/api2_2x/World.c | 42 +-- source/blender/src/buttons_object.c | 4 +- source/blender/src/drawaction.c | 2 +- source/blender/src/editaction.c | 6 +- source/blender/src/editipo.c | 362 +++++++++++---------- source/blender/src/editkey.c | 2 +- source/blender/src/editview.c | 12 +- source/blender/src/poseobject.c | 20 +- source/blender/src/space.c | 146 ++++----- source/blender/src/transform_conversions.c | 46 +-- 20 files changed, 427 insertions(+), 433 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/bad_level_call_stubs/stubs.c b/source/blender/blenkernel/bad_level_call_stubs/stubs.c index dc65750f7ba..2524a804e53 100644 --- a/source/blender/blenkernel/bad_level_call_stubs/stubs.c +++ b/source/blender/blenkernel/bad_level_call_stubs/stubs.c @@ -59,7 +59,7 @@ struct bPythonConstraint; struct bConstraintOb; char *getIpoCurveName( struct IpoCurve * icu ); -void insert_vert_icu(struct IpoCurve *icu, float x, float y); +void insert_vert_icu(struct IpoCurve *icu, float x, float y, short fast); struct IpoCurve *verify_ipocurve(struct ID *id, short a, char *b, char *d, int e); void elbeemDebugOut(char *msg); void fluidsimSettingsFree(struct FluidsimSettings* sb); @@ -83,7 +83,7 @@ char *getIpoCurveName( struct IpoCurve * icu ) return 0; } -void insert_vert_icu(struct IpoCurve *icu, float x, float y) +void insert_vert_icu(struct IpoCurve *icu, float x, float y, short fast) { } diff --git a/source/blender/include/BSE_editipo.h b/source/blender/include/BSE_editipo.h index 077d89fbadd..617710e1b28 100644 --- a/source/blender/include/BSE_editipo.h +++ b/source/blender/include/BSE_editipo.h @@ -92,7 +92,7 @@ struct Ipo *verify_ipo(struct ID *, short, char *, char *); int texchannel_to_adrcode(int channel); int insert_bezt_icu(struct IpoCurve *icu, struct BezTriple *bezt); -void insert_vert_icu(struct IpoCurve *icu, float x, float y); +void insert_vert_icu(struct IpoCurve *icu, float x, float y, short fast); void add_vert_ipo(void); void add_duplicate_editipo(void); @@ -121,7 +121,7 @@ void paste_editipo(void); void set_exprap_ipo(int mode); void set_speed_editipo(float speed); -void insertkey(ID *id, int blocktype, char *actname, char *constname, int adrcode); +void insertkey(ID *id, int blocktype, char *actname, char *constname, int adrcode, short fast); void insertkey_smarter(ID *id, int blocktype, char *actname, char *constname, int adrcode); void insertkey_editipo(void); void common_insertkey(void); diff --git a/source/blender/python/api2_2x/Camera.c b/source/blender/python/api2_2x/Camera.c index 23e6880bbfe..f6b443e5d06 100644 --- a/source/blender/python/api2_2x/Camera.c +++ b/source/blender/python/api2_2x/Camera.c @@ -1040,11 +1040,11 @@ static PyObject *Camera_insertIpoKey( BPy_Camera * self, PyObject * args ) "expected int argument" ) ); if (key == IPOKEY_LENS){ - insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_LENS); + insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_LENS, 0); } else if (key == IPOKEY_CLIPPING){ - insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_STA); - insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_END); + insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_STA, 0); + insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_END, 0); } allspace(REMAKEIPO, 0); diff --git a/source/blender/python/api2_2x/Constraint.c b/source/blender/python/api2_2x/Constraint.c index 1bd303a5126..0e235082c61 100644 --- a/source/blender/python/api2_2x/Constraint.c +++ b/source/blender/python/api2_2x/Constraint.c @@ -431,9 +431,9 @@ static PyObject *Constraint_insertKey( BPy_Constraint * self, PyObject * value ) "cannot get a curve from this IPO, may be using libdata" ); if( ob->action ) - insert_vert_icu( icu, get_action_frame(ob, cfra), con->enforce); + insert_vert_icu( icu, get_action_frame(ob, cfra), con->enforce, 0); else - insert_vert_icu( icu, cfra, con->enforce); + insert_vert_icu( icu, cfra, con->enforce, 0); Py_RETURN_NONE; } diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c index e3bef1468dc..9b2fd082bee 100644 --- a/source/blender/python/api2_2x/Ipo.c +++ b/source/blender/python/api2_2x/Ipo.c @@ -1483,7 +1483,7 @@ static int Ipo_setIpoCurveByName( BPy_Ipo * self, PyObject * key, icu->flag |= IPO_VISIBLE|IPO_AUTO_HORIZ; set_icu_vars( icu ); BLI_addtail( &(ipo->curve), icu); - insert_vert_icu( icu, time, curval ); + insert_vert_icu( icu, time, curval, 0); allspace( REMAKEIPO, 0 ); EXPP_allqueue( REDRAWIPO, 0 ); diff --git a/source/blender/python/api2_2x/Ipocurve.c b/source/blender/python/api2_2x/Ipocurve.c index 383826d8938..b8f3c3f6dd0 100644 --- a/source/blender/python/api2_2x/Ipocurve.c +++ b/source/blender/python/api2_2x/Ipocurve.c @@ -531,7 +531,7 @@ static PyObject *IpoCurve_append( C_IpoCurve * self, PyObject * value ) Py_DECREF( xobj ); y = (float)PyFloat_AsDouble( yobj ); Py_DECREF( yobj ); - insert_vert_icu( icu, x, y); + insert_vert_icu( icu, x, y, 0); } Py_RETURN_NONE; @@ -745,7 +745,7 @@ static int IpoCurve_setCurval( C_IpoCurve * self, PyObject * key, /* insert a key at the specified time */ - insert_vert_icu( self->ipocurve, time, curval ); + insert_vert_icu( self->ipocurve, time, curval, 0); allspace(REMAKEIPO, 0); return 0; } diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c index fc8a7809de1..d40cc5a2cfc 100644 --- a/source/blender/python/api2_2x/Lamp.c +++ b/source/blender/python/api2_2x/Lamp.c @@ -1287,25 +1287,25 @@ static PyObject *Lamp_insertIpoKey( BPy_Lamp * self, PyObject * args ) map = texchannel_to_adrcode(self->lamp->texact); if (key == IPOKEY_RGB ) { - insertkey((ID *)self->lamp, ID_LA, NULL, NULL, LA_COL_R); - insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_COL_G); - insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_COL_B); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL, LA_COL_R, 0); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_COL_G, 0); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_COL_B, 0); } if (key == IPOKEY_ENERGY ) { - insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_ENERGY); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_ENERGY, 0); } if (key == IPOKEY_SPOTSIZE ) { - insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_SPOTSI); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_SPOTSI, 0); } if (key == IPOKEY_OFFSET ) { - insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_X); - insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_Y); - insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_Z); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_X, 0); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_Y, 0); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_Z, 0); } if (key == IPOKEY_SIZE ) { - insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_X); - insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_Y); - insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_Z); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_X, 0); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_Y, 0); + insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_Z, 0); } allspace(REMAKEIPO, 0); diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index 8eb716b1aee..851a46d51e5 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -1691,58 +1691,58 @@ static PyObject *Material_insertIpoKey( BPy_Material * self, PyObject * args ) map = texchannel_to_adrcode(self->material->texact); if(key==IPOKEY_RGB || key==IPOKEY_ALLCOLOR) { - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_R); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_G); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_B); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_R, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_G, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_B, 0); } if(key==IPOKEY_ALPHA || key==IPOKEY_ALLCOLOR) { - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_ALPHA); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_ALPHA, 0); } if(key==IPOKEY_HALOSIZE || key==IPOKEY_ALLCOLOR) { - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_HASIZE); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_HASIZE, 0); } if(key==IPOKEY_MODE || key==IPOKEY_ALLCOLOR) { - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_MODE); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_MODE, 0); } if(key==IPOKEY_ALLCOLOR) { - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_R); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_G); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_B); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_REF); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_EMIT); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_AMB); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_HARD); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_MODE); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_TRANSLU); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_ADD); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_R, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_G, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_B, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_REF, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_EMIT, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_AMB, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_HARD, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_MODE, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_TRANSLU, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_ADD, 0); } if(key==IPOKEY_ALLMIRROR) { - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_RAYM); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESMIR); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESMIRI); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESTRA); - insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESTRAI); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_RAYM, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESMIR, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESMIRI, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESTRA, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESTRAI, 0); } if(key==IPOKEY_OFS || key==IPOKEY_ALLMAPPING) { - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_X); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_Y); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_Z); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_X, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_Y, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_Z, 0); } if(key==IPOKEY_SIZE || key==IPOKEY_ALLMAPPING) { - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_X); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_Y); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_Z); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_X, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_Y, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_Z, 0); } if(key==IPOKEY_ALLMAPPING) { - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_R); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_G); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_B); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_DVAR); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_COLF); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_NORF); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_VARF); - insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_DISP); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_R, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_G, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_B, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_DVAR, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_COLF, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_NORF, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_VARF, 0); + insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_DISP, 0); } allspace(REMAKEIPO, 0); diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 730ae6c0726..e62f685cdf5 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -2358,31 +2358,31 @@ static PyObject *Object_insertIpoKey( BPy_Object * self, PyObject * args ) actname= "Object"; if (key == IPOKEY_LOC || key == IPOKEY_LOCROT || key == IPOKEY_LOCROTSIZE){ - insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_X); - insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_Y); - insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_Z); + insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_X, 0); + insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_Y, 0); + insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_Z, 0); } if (key == IPOKEY_ROT || key == IPOKEY_LOCROT || key == IPOKEY_LOCROTSIZE){ - insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_X); - insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_Y); - insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_Z); + insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_X, 0); + insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_Y, 0); + insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_Z, 0); } if (key == IPOKEY_SIZE || key == IPOKEY_LOCROTSIZE ){ - insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_X); - insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Y); - insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Z); + insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_X, 0); + insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Y, 0); + insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Z, 0); } if (key == IPOKEY_PI_STRENGTH ){ - insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FSTR); + insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FSTR, 0); } else if (key == IPOKEY_PI_FALLOFF ){ - insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FFALL); + insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FFALL, 0); } else if (key == IPOKEY_PI_SURFACEDAMP ){ - insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_SDAMP); + insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_SDAMP, 0); } else if (key == IPOKEY_PI_RANDOMDAMP ){ - insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_RDAMP); + insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_RDAMP, 0); } else if (key == IPOKEY_PI_PERM ){ - insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_PERM); + insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_PERM, 0); } allspace(REMAKEIPO, 0); @@ -2425,16 +2425,16 @@ static PyObject *Object_insertPoseKey( BPy_Object * self, PyObject * args ) /* XXX: must check chanName actually exists, otherwise segfaults! */ //achan = get_action_channel(sourceact->action, chanName); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_X); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Y); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Z); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_X); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Y); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Z); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_W); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_X, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Y, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Z, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_X, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Y, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Z, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_W, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z, 0); G.scene->r.cfra = oldframe; @@ -2471,16 +2471,16 @@ static PyObject *Object_insertCurrentPoseKey( BPy_Object * self, PyObject * args /* XXX: must check chanName actually exists, otherwise segfaults! */ - insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_X); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Y); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Z); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_X); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Y); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Z); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_W); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y); - insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_X, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Y, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Z, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_X, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Y, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Z, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_W, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y, 0); + insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z, 0); G.scene->r.cfra = oldframe; @@ -2517,7 +2517,7 @@ static PyObject *Object_setConstraintInfluenceForBone( BPy_Object * self, return EXPP_ReturnPyObjError( PyExc_RuntimeError, "cannot get a curve from this IPO, may be using libdata" ); - insert_vert_icu(icu, (float)CFRA, influence); + insert_vert_icu(icu, (float)CFRA, influence, 0); self->object->recalc |= OB_RECALC_OB; Py_RETURN_NONE; 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; diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c index 6d5b20b46d9..7804a443639 100644 --- a/source/blender/python/api2_2x/World.c +++ b/source/blender/python/api2_2x/World.c @@ -991,37 +991,37 @@ static PyObject *World_insertIpoKey( BPy_World * self, PyObject * args ) map = texchannel_to_adrcode(self->world->texact); if(key == IPOKEY_ZENITH) { - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_R); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_G); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_B); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_R, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_G, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_B, 0); } if(key == IPOKEY_HORIZON) { - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_R); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_G); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_B); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_R, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_G, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_B, 0); } if(key == IPOKEY_MIST) { - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISI); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTDI); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTSTA); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTHI); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISI, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTDI, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTSTA, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTHI, 0); } if(key == IPOKEY_STARS) { - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_R); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_G); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_B); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STARDIST); - insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STARSIZE); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_R, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_G, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_B, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STARDIST, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STARSIZE, 0); } if(key == IPOKEY_OFFSET) { - insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_X); - insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_Y); - insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_Z); + insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_X, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_Y, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_Z, 0); } if(key == IPOKEY_SIZE) { - insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_X); - insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_Y); - insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_Z); + insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_X, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_Y, 0); + insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_Z, 0); } allspace(REMAKEIPO, 0); diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index 33229d1d38b..033a7dc18cc 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -263,9 +263,9 @@ static void add_influence_key_to_constraint_func (void *ob_v, void *con_v) } if(ob->action) - insert_vert_icu(icu, get_action_frame(ob, (float)CFRA), con->enforce); + insert_vert_icu(icu, get_action_frame(ob, (float)CFRA), con->enforce, 0); else - insert_vert_icu(icu, CFRA, con->enforce); + insert_vert_icu(icu, CFRA, con->enforce, 0); /* make sure ipowin shows it */ ob->ipowin= ID_CO; diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index 6f8fdc17166..b6f13f76426 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -198,7 +198,7 @@ static void icu_slider_func(void *voidicu, void *voidignore) * otherwise modify it's value */ if (!bezt) { - insert_vert_icu(icu, cfra, icu->curval); + insert_vert_icu(icu, cfra, icu->curval, 0); } else { bezt->vec[1][1] = icu->curval; diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 9dcb7f68363..76fc21b13e6 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -1333,9 +1333,9 @@ void insertkey_action(void) IpoCurve *icu= (IpoCurve *)ale->key_data; if (ob) - insertkey((ID *)ob, icu->blocktype, achan->name, NULL, icu->adrcode); + insertkey((ID *)ob, icu->blocktype, achan->name, NULL, icu->adrcode, 0); else - insert_vert_icu(icu, cfra, icu->curval); + insert_vert_icu(icu, cfra, icu->curval, 0); } } @@ -1352,7 +1352,7 @@ void insertkey_action(void) if (key->ipo) { for (icu= key->ipo->curve.first; icu; icu=icu->next) { - insert_vert_icu(icu, cfra, icu->curval); + insert_vert_icu(icu, cfra, icu->curval, 0); } } } diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index 800a859c8bf..f65e70ce59e 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -1951,8 +1951,10 @@ int insert_bezt_icu (IpoCurve *icu, BezTriple *bezt) /* This function is a wrapper for insert_bezt_icu, and should be used when * adding a new keyframe to a curve, when the keyframe doesn't exist anywhere * else yet. + * + * 'fast' - is only for the python API where importing BVH's would take an extreamly long time. */ -void insert_vert_icu (IpoCurve *icu, float x, float y) +void insert_vert_icu (IpoCurve *icu, float x, float y, short fast) { BezTriple beztr; int a, h1, h2; @@ -1971,7 +1973,7 @@ void insert_vert_icu (IpoCurve *icu, float x, float y) /* add temp beztriple to keyframes */ a= insert_bezt_icu(icu, &beztr); - calchandles_ipocurve(icu); + if (!fast) calchandles_ipocurve(icu); /* set handletype */ if (icu->totvert > 2) { @@ -1986,7 +1988,7 @@ void insert_vert_icu (IpoCurve *icu, float x, float y) bezt->h1= h1; bezt->h2= h2; - calchandles_ipocurve(icu); + if (!fast) calchandles_ipocurve(icu); } } @@ -2039,7 +2041,7 @@ void add_vert_ipo(void) y= (float)(1 << val); } - insert_vert_icu(ei->icu, x, y); + insert_vert_icu(ei->icu, x, y, 0); /* to be sure: if icu was 0, or only 1 curve visible */ ei->flag |= IPO_SELECT; @@ -2216,7 +2218,7 @@ static void insertkey_nonrecurs(ID *id, int blocktype, char *actname, char *cons } } - insert_vert_icu(icu, cfra, curval); + insert_vert_icu(icu, cfra, curval, 0); } } } @@ -2402,7 +2404,7 @@ static int match_adr_constraint(ID * id, int blocktype, char *actname, int adrco } -void insertkey(ID *id, int blocktype, char *actname, char *constname, int adrcode) +void insertkey(ID *id, int blocktype, char *actname, char *constname, int adrcode, short fast) { IpoCurve *icu; Object *ob; @@ -2438,7 +2440,7 @@ void insertkey(ID *id, int blocktype, char *actname, char *constname, int adrcod } } - insert_vert_icu(icu, cfra, curval); + insert_vert_icu(icu, cfra, curval, fast); } } } @@ -2485,7 +2487,7 @@ void insertkey_smarter(ID *id, int blocktype, char *actname, char *constname, in /* insert new keyframe at current frame */ if (insert_mode) - insert_vert_icu(icu, cfra, curval); + insert_vert_icu(icu, cfra, curval, 0); /* delete keyframe immediately before/after newly added */ switch (insert_mode) { @@ -2532,7 +2534,7 @@ void insertfloatkey(ID *id, int blocktype, char *actname, char *constname, int a } /* insert new keyframe at current frame */ - insert_vert_icu(icu, cfra, floatkey); + insert_vert_icu(icu, cfra, floatkey, 0); } } } @@ -2563,16 +2565,16 @@ void insertkey_editipo(void) ei->icu->totvert= 0; ei->icu->bezt= NULL; - insert_vert_icu(ei->icu, 0.0f, 0.0f); + insert_vert_icu(ei->icu, 0.0f, 0.0f, 0); if(ELEM3(driver->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) { if(ei->disptype==IPO_DISPDEGR) - insert_vert_icu(ei->icu, 18.0f, 18.0f); + insert_vert_icu(ei->icu, 18.0f, 18.0f, 0); else - insert_vert_icu(ei->icu, 18.0f, 1.0f); + insert_vert_icu(ei->icu, 18.0f, 1.0f, 0); } else - insert_vert_icu(ei->icu, 1.0f, 1.0f); + insert_vert_icu(ei->icu, 1.0f, 1.0f, 0); ei->flag |= IPO_SELECT|IPO_VISIBLE; ei->icu->flag= ei->flag; @@ -2649,7 +2651,7 @@ void insertkey_editipo(void) } fp= insertvals; for(a=0; aicu, fp[0], fp[1]); + insert_vert_icu(ei->icu, fp[0], fp[1], 0); } MEM_freeN(insertvals); @@ -2702,58 +2704,58 @@ void common_insertkey(void) map= texchannel_to_adrcode(ma->texact); if(event==0 || event==10) { - insertkey(id, ID_MA, NULL, NULL, MA_COL_R); - insertkey(id, ID_MA, NULL, NULL, MA_COL_G); - insertkey(id, ID_MA, NULL, NULL, MA_COL_B); + insertkey(id, ID_MA, NULL, NULL, MA_COL_R, 0); + insertkey(id, ID_MA, NULL, NULL, MA_COL_G, 0); + insertkey(id, ID_MA, NULL, NULL, MA_COL_B, 0); } if(event==1 || event==10) { - insertkey(id, ID_MA, NULL, NULL, MA_ALPHA); + insertkey(id, ID_MA, NULL, NULL, MA_ALPHA, 0); } if(event==2 || event==10) { - insertkey(id, ID_MA, NULL, NULL, MA_HASIZE); + insertkey(id, ID_MA, NULL, NULL, MA_HASIZE, 0); } if(event==3 || event==10) { - insertkey(id, ID_MA, NULL, NULL, MA_MODE); + insertkey(id, ID_MA, NULL, NULL, MA_MODE, 0); } if(event==10) { - insertkey(id, ID_MA, NULL, NULL, MA_SPEC_R); - insertkey(id, ID_MA, NULL, NULL, MA_SPEC_G); - insertkey(id, ID_MA, NULL, NULL, MA_SPEC_B); - insertkey(id, ID_MA, NULL, NULL, MA_REF); - insertkey(id, ID_MA, NULL, NULL, MA_EMIT); - insertkey(id, ID_MA, NULL, NULL, MA_AMB); - insertkey(id, ID_MA, NULL, NULL, MA_SPEC); - insertkey(id, ID_MA, NULL, NULL, MA_HARD); - insertkey(id, ID_MA, NULL, NULL, MA_MODE); - insertkey(id, ID_MA, NULL, NULL, MA_TRANSLU); - insertkey(id, ID_MA, NULL, NULL, MA_ADD); + insertkey(id, ID_MA, NULL, NULL, MA_SPEC_R, 0); + insertkey(id, ID_MA, NULL, NULL, MA_SPEC_G, 0); + insertkey(id, ID_MA, NULL, NULL, MA_SPEC_B, 0); + insertkey(id, ID_MA, NULL, NULL, MA_REF, 0); + insertkey(id, ID_MA, NULL, NULL, MA_EMIT, 0); + insertkey(id, ID_MA, NULL, NULL, MA_AMB, 0); + insertkey(id, ID_MA, NULL, NULL, MA_SPEC, 0); + insertkey(id, ID_MA, NULL, NULL, MA_HARD, 0); + insertkey(id, ID_MA, NULL, NULL, MA_MODE, 0); + insertkey(id, ID_MA, NULL, NULL, MA_TRANSLU, 0); + insertkey(id, ID_MA, NULL, NULL, MA_ADD, 0); } if(event==14) { - insertkey(id, ID_MA, NULL, NULL, MA_RAYM); - insertkey(id, ID_MA, NULL, NULL, MA_FRESMIR); - insertkey(id, ID_MA, NULL, NULL, MA_FRESMIRI); - insertkey(id, ID_MA, NULL, NULL, MA_FRESTRA); - insertkey(id, ID_MA, NULL, NULL, MA_FRESTRAI); + insertkey(id, ID_MA, NULL, NULL, MA_RAYM, 0); + insertkey(id, ID_MA, NULL, NULL, MA_FRESMIR, 0); + insertkey(id, ID_MA, NULL, NULL, MA_FRESMIRI, 0); + insertkey(id, ID_MA, NULL, NULL, MA_FRESTRA, 0); + insertkey(id, ID_MA, NULL, NULL, MA_FRESTRAI, 0); } if(event==12 || event==11) { - insertkey(id, ID_MA, NULL, NULL, map+MAP_OFS_X); - insertkey(id, ID_MA, NULL, NULL, map+MAP_OFS_Y); - insertkey(id, ID_MA, NULL, NULL, map+MAP_OFS_Z); + insertkey(id, ID_MA, NULL, NULL, map+MAP_OFS_X, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_OFS_Y, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_OFS_Z, 0); } if(event==13 || event==11) { - insertkey(id, ID_MA, NULL, NULL, map+MAP_SIZE_X); - insertkey(id, ID_MA, NULL, NULL, map+MAP_SIZE_Y); - insertkey(id, ID_MA, NULL, NULL, map+MAP_SIZE_Z); + insertkey(id, ID_MA, NULL, NULL, map+MAP_SIZE_X, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_SIZE_Y, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_SIZE_Z, 0); } if(event==11) { - insertkey(id, ID_MA, NULL, NULL, map+MAP_R); - insertkey(id, ID_MA, NULL, NULL, map+MAP_G); - insertkey(id, ID_MA, NULL, NULL, map+MAP_B); - insertkey(id, ID_MA, NULL, NULL, map+MAP_DVAR); - insertkey(id, ID_MA, NULL, NULL, map+MAP_COLF); - insertkey(id, ID_MA, NULL, NULL, map+MAP_NORF); - insertkey(id, ID_MA, NULL, NULL, map+MAP_VARF); - insertkey(id, ID_MA, NULL, NULL, map+MAP_DISP); + insertkey(id, ID_MA, NULL, NULL, map+MAP_R, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_G, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_B, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_DVAR, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_COLF, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_NORF, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_VARF, 0); + insertkey(id, ID_MA, NULL, NULL, map+MAP_DISP, 0); } } } @@ -2767,37 +2769,37 @@ void common_insertkey(void) map= texchannel_to_adrcode(wo->texact); if(event==0) { - insertkey(id, ID_WO, NULL, NULL, WO_ZEN_R); - insertkey(id, ID_WO, NULL, NULL, WO_ZEN_G); - insertkey(id, ID_WO, NULL, NULL, WO_ZEN_B); + insertkey(id, ID_WO, NULL, NULL, WO_ZEN_R, 0); + insertkey(id, ID_WO, NULL, NULL, WO_ZEN_G, 0); + insertkey(id, ID_WO, NULL, NULL, WO_ZEN_B, 0); } if(event==1) { - insertkey(id, ID_WO, NULL, NULL, WO_HOR_R); - insertkey(id, ID_WO, NULL, NULL, WO_HOR_G); - insertkey(id, ID_WO, NULL, NULL, WO_HOR_B); + insertkey(id, ID_WO, NULL, NULL, WO_HOR_R, 0); + insertkey(id, ID_WO, NULL, NULL, WO_HOR_G, 0); + insertkey(id, ID_WO, NULL, NULL, WO_HOR_B, 0); } if(event==2) { - insertkey(id, ID_WO, NULL, NULL, WO_MISI); - insertkey(id, ID_WO, NULL, NULL, WO_MISTDI); - insertkey(id, ID_WO, NULL, NULL, WO_MISTSTA); - insertkey(id, ID_WO, NULL, NULL, WO_MISTHI); + insertkey(id, ID_WO, NULL, NULL, WO_MISI, 0); + insertkey(id, ID_WO, NULL, NULL, WO_MISTDI, 0); + insertkey(id, ID_WO, NULL, NULL, WO_MISTSTA, 0); + insertkey(id, ID_WO, NULL, NULL, WO_MISTHI, 0); } if(event==3) { - insertkey(id, ID_WO, NULL, NULL, WO_STAR_R); - insertkey(id, ID_WO, NULL, NULL, WO_STAR_G); - insertkey(id, ID_WO, NULL, NULL, WO_STAR_B); - insertkey(id, ID_WO, NULL, NULL, WO_STARDIST); - insertkey(id, ID_WO, NULL, NULL, WO_STARSIZE); + insertkey(id, ID_WO, NULL, NULL, WO_STAR_R, 0); + insertkey(id, ID_WO, NULL, NULL, WO_STAR_G, 0); + insertkey(id, ID_WO, NULL, NULL, WO_STAR_B, 0); + insertkey(id, ID_WO, NULL, NULL, WO_STARDIST, 0); + insertkey(id, ID_WO, NULL, NULL, WO_STARSIZE, 0); } if(event==12) { - insertkey(id, ID_WO, NULL, NULL, map+MAP_OFS_X); - insertkey(id, ID_WO, NULL, NULL, map+MAP_OFS_Y); - insertkey(id, ID_WO, NULL, NULL, map+MAP_OFS_Z); + insertkey(id, ID_WO, NULL, NULL, map+MAP_OFS_X, 0); + insertkey(id, ID_WO, NULL, NULL, map+MAP_OFS_Y, 0); + insertkey(id, ID_WO, NULL, NULL, map+MAP_OFS_Z, 0); } if(event==13) { - insertkey(id, ID_WO, NULL, NULL, map+MAP_SIZE_X); - insertkey(id, ID_WO, NULL, NULL, map+MAP_SIZE_Y); - insertkey(id, ID_WO, NULL, NULL, map+MAP_SIZE_Z); + insertkey(id, ID_WO, NULL, NULL, map+MAP_SIZE_X, 0); + insertkey(id, ID_WO, NULL, NULL, map+MAP_SIZE_Y, 0); + insertkey(id, ID_WO, NULL, NULL, map+MAP_SIZE_Z, 0); } } } @@ -2811,25 +2813,25 @@ void common_insertkey(void) map= texchannel_to_adrcode(la->texact); if(event==0) { - insertkey(id, ID_LA, NULL, NULL, LA_COL_R); - insertkey(id, ID_LA, NULL, NULL, LA_COL_G); - insertkey(id, ID_LA, NULL, NULL, LA_COL_B); + insertkey(id, ID_LA, NULL, NULL, LA_COL_R, 0); + insertkey(id, ID_LA, NULL, NULL, LA_COL_G, 0); + insertkey(id, ID_LA, NULL, NULL, LA_COL_B, 0); } if(event==1) { - insertkey(id, ID_LA, NULL, NULL, LA_ENERGY); + insertkey(id, ID_LA, NULL, NULL, LA_ENERGY, 0); } if(event==2) { - insertkey(id, ID_LA, NULL, NULL, LA_SPOTSI); + insertkey(id, ID_LA, NULL, NULL, LA_SPOTSI, 0); } if(event==12) { - insertkey(id, ID_LA, NULL, NULL, map+MAP_OFS_X); - insertkey(id, ID_LA, NULL, NULL, map+MAP_OFS_Y); - insertkey(id, ID_LA, NULL, NULL, map+MAP_OFS_Z); + insertkey(id, ID_LA, NULL, NULL, map+MAP_OFS_X, 0); + insertkey(id, ID_LA, NULL, NULL, map+MAP_OFS_Y, 0); + insertkey(id, ID_LA, NULL, NULL, map+MAP_OFS_Z, 0); } if(event==13) { - insertkey(id, ID_LA, NULL, NULL, map+MAP_SIZE_X); - insertkey(id, ID_LA, NULL, NULL, map+MAP_SIZE_Y); - insertkey(id, ID_LA, NULL, NULL, map+MAP_SIZE_Z); + insertkey(id, ID_LA, NULL, NULL, map+MAP_SIZE_X, 0); + insertkey(id, ID_LA, NULL, NULL, map+MAP_SIZE_Y, 0); + insertkey(id, ID_LA, NULL, NULL, map+MAP_SIZE_Z, 0); } } @@ -2842,74 +2844,74 @@ void common_insertkey(void) if(event== -1) return; if(event==0) { - insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); - insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH); - insertkey(id, ID_TE, NULL, NULL, TE_NTYPE); - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1); + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE, 0); + insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH, 0); + insertkey(id, ID_TE, NULL, NULL, TE_NTYPE, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1, 0); } if(event==1) { - insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); - insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH); - insertkey(id, ID_TE, NULL, NULL, TE_NTYPE); - insertkey(id, ID_TE, NULL, NULL, TE_TURB); - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS2); + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE, 0); + insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH, 0); + insertkey(id, ID_TE, NULL, NULL, TE_NTYPE, 0); + insertkey(id, ID_TE, NULL, NULL, TE_TURB, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1, 0); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS2, 0); } if(event==2) { - insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); - insertkey(id, ID_TE, NULL, NULL, TE_NTYPE); - insertkey(id, ID_TE, NULL, NULL, TE_TURB); - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1); + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE, 0); + insertkey(id, ID_TE, NULL, NULL, TE_NTYPE, 0); + insertkey(id, ID_TE, NULL, NULL, TE_TURB, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1, 0); } if(event==3) { - insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); - insertkey(id, ID_TE, NULL, NULL, TE_NTYPE); - insertkey(id, ID_TE, NULL, NULL, TE_TURB); - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1); - insertkey(id, ID_TE, NULL, NULL, TE_N_BAS2); + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE, 0); + insertkey(id, ID_TE, NULL, NULL, TE_NTYPE, 0); + insertkey(id, ID_TE, NULL, NULL, TE_TURB, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS1, 0); + insertkey(id, ID_TE, NULL, NULL, TE_N_BAS2, 0); } if(event==4) { - insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH); - insertkey(id, ID_TE, NULL, NULL, TE_TURB); + insertkey(id, ID_TE, NULL, NULL, TE_NDEPTH, 0); + insertkey(id, ID_TE, NULL, NULL, TE_TURB, 0); } if(event==5) { - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); } if(event==6) { - insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP); - insertkey(id, ID_TE, NULL, NULL, TE_MGH); - insertkey(id, ID_TE, NULL, NULL, TE_MG_LAC); - insertkey(id, ID_TE, NULL, NULL, TE_MG_OCT); - insertkey(id, ID_TE, NULL, NULL, TE_MG_OFF); - insertkey(id, ID_TE, NULL, NULL, TE_MG_GAIN); + insertkey(id, ID_TE, NULL, NULL, TE_MG_TYP, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MGH, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MG_LAC, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MG_OCT, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MG_OFF, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MG_GAIN, 0); } if(event==7) { - insertkey(id, ID_TE, NULL, NULL, TE_VNW1); - insertkey(id, ID_TE, NULL, NULL, TE_VNW2); - insertkey(id, ID_TE, NULL, NULL, TE_VNW3); - insertkey(id, ID_TE, NULL, NULL, TE_VNW4); - insertkey(id, ID_TE, NULL, NULL, TE_VNMEXP); - insertkey(id, ID_TE, NULL, NULL, TE_VN_DISTM); - insertkey(id, ID_TE, NULL, NULL, TE_VN_COLT); - insertkey(id, ID_TE, NULL, NULL, TE_ISCA); - insertkey(id, ID_TE, NULL, NULL, TE_NSIZE); + insertkey(id, ID_TE, NULL, NULL, TE_VNW1, 0); + insertkey(id, ID_TE, NULL, NULL, TE_VNW2, 0); + insertkey(id, ID_TE, NULL, NULL, TE_VNW3, 0); + insertkey(id, ID_TE, NULL, NULL, TE_VNW4, 0); + insertkey(id, ID_TE, NULL, NULL, TE_VNMEXP, 0); + insertkey(id, ID_TE, NULL, NULL, TE_VN_DISTM, 0); + insertkey(id, ID_TE, NULL, NULL, TE_VN_COLT, 0); + insertkey(id, ID_TE, NULL, NULL, TE_ISCA, 0); + insertkey(id, ID_TE, NULL, NULL, TE_NSIZE, 0); } if(event==8) { - insertkey(id, ID_TE, NULL, NULL, TE_MG_OCT); - insertkey(id, ID_TE, NULL, NULL, TE_MG_OFF); - insertkey(id, ID_TE, NULL, NULL, TE_MG_GAIN); - insertkey(id, ID_TE, NULL, NULL, TE_DISTA); + insertkey(id, ID_TE, NULL, NULL, TE_MG_OCT, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MG_OFF, 0); + insertkey(id, ID_TE, NULL, NULL, TE_MG_GAIN, 0); + insertkey(id, ID_TE, NULL, NULL, TE_DISTA, 0); } if(event==9) { - insertkey(id, ID_TE, NULL, NULL, TE_COL_R); - insertkey(id, ID_TE, NULL, NULL, TE_COL_G); - insertkey(id, ID_TE, NULL, NULL, TE_COL_B); - insertkey(id, ID_TE, NULL, NULL, TE_BRIGHT); - insertkey(id, ID_TE, NULL, NULL, TE_CONTRA); + insertkey(id, ID_TE, NULL, NULL, TE_COL_R, 0); + insertkey(id, ID_TE, NULL, NULL, TE_COL_G, 0); + insertkey(id, ID_TE, NULL, NULL, TE_COL_B, 0); + insertkey(id, ID_TE, NULL, NULL, TE_BRIGHT, 0); + insertkey(id, ID_TE, NULL, NULL, TE_CONTRA, 0); } } } @@ -2926,19 +2928,19 @@ void common_insertkey(void) if(event == -1) return; if(event==0) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_SDAMP); + insertkey(id, ID_OB, NULL, NULL, OB_PD_SDAMP, 0); } if(event==1) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_RDAMP); + insertkey(id, ID_OB, NULL, NULL, OB_PD_RDAMP, 0); } if(event==2) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_PERM); + insertkey(id, ID_OB, NULL, NULL, OB_PD_PERM, 0); } if(event==3) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_FSTR); + insertkey(id, ID_OB, NULL, NULL, OB_PD_FSTR, 0); } if(event==4) { - insertkey(id, ID_OB, NULL, NULL, OB_PD_FFALL); + insertkey(id, ID_OB, NULL, NULL, OB_PD_FFALL, 0); } } @@ -2958,21 +2960,21 @@ void common_insertkey(void) if(event== -1) return; if(event==0) { - insertkey(id, ID_CA, NULL, NULL, CAM_LENS); + insertkey(id, ID_CA, NULL, NULL, CAM_LENS, 0); } else if(event==1) { - insertkey(id, ID_CA, NULL, NULL, CAM_STA); - insertkey(id, ID_CA, NULL, NULL, CAM_END); + insertkey(id, ID_CA, NULL, NULL, CAM_STA, 0); + insertkey(id, ID_CA, NULL, NULL, CAM_END, 0); } else if(event==2) { - insertkey(id, ID_CA, NULL, NULL, CAM_YF_APERT); + insertkey(id, ID_CA, NULL, NULL, CAM_YF_APERT, 0); } else if(event==3) { - insertkey(id, ID_CA, NULL, NULL, CAM_YF_FDIST); + insertkey(id, ID_CA, NULL, NULL, CAM_YF_FDIST, 0); } else if(event==4) { - insertkey(id, ID_CA, NULL, NULL, CAM_SHIFT_X); - insertkey(id, ID_CA, NULL, NULL, CAM_SHIFT_Y); + insertkey(id, ID_CA, NULL, NULL, CAM_SHIFT_X, 0); + insertkey(id, ID_CA, NULL, NULL, CAM_SHIFT_Y, 0); } } } @@ -2985,16 +2987,16 @@ void common_insertkey(void) if(event== -1) return; if(event==0) { - insertkey(id, ID_SO, NULL, NULL, SND_VOLUME); + insertkey(id, ID_SO, NULL, NULL, SND_VOLUME, 0); } if(event==1) { - insertkey(id, ID_SO, NULL, NULL, SND_PITCH); + insertkey(id, ID_SO, NULL, NULL, SND_PITCH, 0); } if(event==2) { - insertkey(id, ID_SO, NULL, NULL, SND_PANNING); + insertkey(id, ID_SO, NULL, NULL, SND_PANNING, 0); } if(event==3) { - insertkey(id, ID_SO, NULL, NULL, SND_ATTEN); + insertkey(id, ID_SO, NULL, NULL, SND_ATTEN, 0); } } } @@ -3058,20 +3060,20 @@ void common_insertkey(void) for (pchan=ob->pose->chanbase.first; pchan; pchan=pchan->next) { if (pchan->flag & POSE_KEY){ if(event==0 || event==3 ||event==4) { - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X); - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y); - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z); + insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0); } if(event==1 || event==3 ||event==4) { - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0); } if(event==2 || event==4) { - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X); - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Y); - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Z); + insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Y, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Z, 0); } if (event==9 && ob->action) { bActionChannel *achan; @@ -3079,7 +3081,7 @@ void common_insertkey(void) for (achan = ob->action->chanbase.first; achan; achan=achan->next){ if (achan->ipo && !strcmp (achan->name, pchan->name)){ for (icu = achan->ipo->curve.first; icu; icu=icu->next){ - insertkey(id, ID_PO, achan->name, NULL, icu->adrcode); + insertkey(id, ID_PO, achan->name, NULL, icu->adrcode, 0); } break; } @@ -3101,10 +3103,10 @@ void common_insertkey(void) insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y); insertmatrixkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z); if (matsuccess==0) { - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0); } } if (event==15 && ob->action) { @@ -3159,7 +3161,7 @@ void common_insertkey(void) switch (event) { case 9: - insertkey(id, ID_OB, actname, NULL, icu->adrcode); + insertkey(id, ID_OB, actname, NULL, icu->adrcode, 0); break; case 15: insertkey_smarter(id, ID_OB, actname, NULL, icu->adrcode); @@ -3170,25 +3172,25 @@ void common_insertkey(void) } if(event==0 || event==3 ||event==4) { - insertkey(id, ID_OB, actname, NULL, OB_LOC_X); - insertkey(id, ID_OB, actname, NULL, OB_LOC_Y); - insertkey(id, ID_OB, actname, NULL, OB_LOC_Z); + insertkey(id, ID_OB, actname, NULL, OB_LOC_X, 0); + insertkey(id, ID_OB, actname, NULL, OB_LOC_Y, 0); + insertkey(id, ID_OB, actname, NULL, OB_LOC_Z, 0); } if(event==1 || event==3 ||event==4) { - insertkey(id, ID_OB, actname, NULL, OB_ROT_X); - insertkey(id, ID_OB, actname, NULL, OB_ROT_Y); - insertkey(id, ID_OB, actname, NULL, OB_ROT_Z); + insertkey(id, ID_OB, actname, NULL, OB_ROT_X, 0); + insertkey(id, ID_OB, actname, NULL, OB_ROT_Y, 0); + insertkey(id, ID_OB, actname, NULL, OB_ROT_Z, 0); } if(event==2 || event==4) { - insertkey(id, ID_OB, actname, NULL, OB_SIZE_X); - insertkey(id, ID_OB, actname, NULL, OB_SIZE_Y); - insertkey(id, ID_OB, actname, NULL, OB_SIZE_Z); + insertkey(id, ID_OB, actname, NULL, OB_SIZE_X, 0); + insertkey(id, ID_OB, actname, NULL, OB_SIZE_Y, 0); + insertkey(id, ID_OB, actname, NULL, OB_SIZE_Z, 0); } if(event==5) { /* remove localview */ tlay= base->object->lay; base->object->lay &= 0xFFFFFF; - insertkey(id, ID_OB, actname, NULL, OB_LAY); + insertkey(id, ID_OB, actname, NULL, OB_LAY, 0); base->object->lay= tlay; } if(event==11 || event==13) { @@ -3439,7 +3441,7 @@ void clean_ipo_curve(IpoCurve *icu) /* now insert first keyframe, as it should be ok */ bezt = old_bezts; - insert_vert_icu(icu, bezt->vec[1][0], bezt->vec[1][1]); + insert_vert_icu(icu, bezt->vec[1][0], bezt->vec[1][1], 0); /* Loop through BezTriples, comparing them. Skip any that do * not fit the criteria for "ok" points. @@ -3476,7 +3478,7 @@ void clean_ipo_curve(IpoCurve *icu) if (cur[1] > next[1]) { if (IS_EQT(cur[1], prev[1], thresh) == 0) { /* add new keyframe */ - insert_vert_icu(icu, cur[0], cur[1]); + insert_vert_icu(icu, cur[0], cur[1], 0); } } } @@ -3484,7 +3486,7 @@ void clean_ipo_curve(IpoCurve *icu) /* only add if values are a considerable distance apart */ if (IS_EQT(cur[1], prev[1], thresh) == 0) { /* add new keyframe */ - insert_vert_icu(icu, cur[0], cur[1]); + insert_vert_icu(icu, cur[0], cur[1], 0); } } } @@ -3494,18 +3496,18 @@ void clean_ipo_curve(IpoCurve *icu) /* does current have same value as previous and next? */ if (IS_EQT(cur[1], prev[1], thresh) == 0) { /* add new keyframe*/ - insert_vert_icu(icu, cur[0], cur[1]); + insert_vert_icu(icu, cur[0], cur[1], 0); } else if (IS_EQT(cur[1], next[1], thresh) == 0) { /* add new keyframe */ - insert_vert_icu(icu, cur[0], cur[1]); + insert_vert_icu(icu, cur[0], cur[1], 0); } } else { /* add if value doesn't equal that of previous */ if (IS_EQT(cur[1], prev[1], thresh) == 0) { /* add new keyframe */ - insert_vert_icu(icu, cur[0], cur[1]); + insert_vert_icu(icu, cur[0], cur[1], 0); } } } diff --git a/source/blender/src/editkey.c b/source/blender/src/editkey.c index 8dc0b3d2b9d..671889d6431 100644 --- a/source/blender/src/editkey.c +++ b/source/blender/src/editkey.c @@ -185,7 +185,7 @@ static void rvk_slider_func(void *voidob, void *voidkeynum) * otherwise modify it's value */ if (bezt == NULL) { - insert_vert_icu(icu, cfra, meshslidervals[keynum]); + insert_vert_icu(icu, cfra, meshslidervals[keynum], 0); } else { bezt->vec[1][1] = meshslidervals[keynum]; diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c index bd90d887cd0..215aea1921f 100644 --- a/source/blender/src/editview.c +++ b/source/blender/src/editview.c @@ -2564,14 +2564,14 @@ void fly(void) cfra = G.scene->r.cfra; if (xlock || zlock || moffset[0] || moffset[1]) { - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_X); - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_Y); - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_Z); + insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_X, 0); + insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_Y, 0); + insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_Z, 0); } if (speed) { - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_X); - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Y); - insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Z); + insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_X, 0); + insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Y, 0); + insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Z, 0); } } } diff --git a/source/blender/src/poseobject.c b/source/blender/src/poseobject.c index 3318b3758fc..ab6d3f47eeb 100644 --- a/source/blender/src/poseobject.c +++ b/source/blender/src/poseobject.c @@ -711,20 +711,20 @@ void paste_posebuf (int flip) /* Set keys on pose */ if (chan->flag & POSE_ROT){ - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z); - insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0); } if (chan->flag & POSE_SIZE){ - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X); - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Y); - insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Z); + insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Y, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_SIZE_Z, 0); } if (chan->flag & POSE_LOC){ - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X); - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y); - insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z); + insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_X, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0); + insertkey(id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0); } } } diff --git a/source/blender/src/space.c b/source/blender/src/space.c index a4287d03c59..13b28e30cc1 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -87,6 +87,7 @@ #include "BKE_node.h" #include "BKE_scene.h" #include "BKE_utildefines.h" +#include "BKE_image.h" /* for IMA_TYPE_COMPOSITE and IMA_TYPE_R_RESULT */ #include "BIF_spacetypes.h" /* first, nasty dependency with typedef */ @@ -4781,29 +4782,16 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt) break; } } - else { - /* Draw tool is inactive */ - switch(event) { + else if (G.obedit) { + /* Draw tool is inactive, editmode is enabled and the image is not a render or composite */ + if (EM_texFaceCheck() && (G.sima->image==0 || (G.sima->image->type != IMA_TYPE_R_RESULT && G.sima->image->type != IMA_TYPE_COMPOSITE))) { + switch(event) { case LEFTMOUSE: - if(G.qual & LR_SHIFTKEY) { - if(G.sima->image && G.sima->image->tpageflag & IMA_TILES) - mouseco_to_curtile(); - else - sima_sample_color(); - } - else if(EM_texFaceCheck()) { - if (!gesture()) { - mouseco_to_cursor_sima(); - } - } else { - sima_sample_color(); - } + if (!gesture()) + mouseco_to_cursor_sima(); break; case RIGHTMOUSE: - if(EM_texFaceCheck()) - mouse_select_sima(); - else if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT)) - sample_vpaint(); + mouse_select_sima(); break; case AKEY: select_swap_tface_uv(); @@ -4814,31 +4802,16 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt) else if((G.qual==0)) borderselect_sima(UV_SELECT_ALL); break; + case CKEY: if (G.sima->flag & SI_SYNC_UVSEL) { /* operate on the editmesh */ if (G.qual==0) { if (G.scene->selectmode != SCE_SELECT_FACE) toggle_uv_select('f'); - - /* we could do this too but better not to */ - /*if ((G.scene->selectmode & SCE_SELECT_FACE)==0) { - G.scene->selectmode= SCE_SELECT_FACE; - EM_selectmode_set(); - BIF_undo_push("Selectmode Set: Face"); - - } else { - G.scene->selectmode= SCE_SELECT_VERTEX; - EM_selectmode_set(); - BIF_undo_push("Selectmode Set: Vertex"); - } - countall(); - allqueue(REDRAWVIEW3D, 1); */ - } else { error("Sync selection to Edit Mesh disables UV select options"); } - } else { /* normal operaton */ if(G.qual==LR_CTRLKEY) @@ -4855,12 +4828,6 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt) if(okee("Unwrap")) unwrap_lscm(0); break; - case GKEY: - if((G.qual==0) && is_uv_tface_editing_allowed()) { - initTransform(TFM_TRANSLATION, CTX_NONE); - Transform(); - } - break; case HKEY: if(G.qual==LR_ALTKEY) reveal_tface_uv(); @@ -4879,39 +4846,19 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt) else if(G.qual==LR_ALTKEY) unlink_selection(); break; - case MKEY: - if((G.qual==0)) - mirrormenu_tface_uv(); - break; - case NKEY: - if(G.qual==LR_CTRLKEY) - replace_names_but(); - break; - case OKEY: - if (G.qual==LR_SHIFTKEY) { - G.scene->prop_mode = (G.scene->prop_mode+1)%7; - allqueue(REDRAWHEADERS, 0); - } - else if((G.qual==0)) { - G.scene->proportional= !G.scene->proportional; - } - break; case PKEY: - /*if(G.f & G_FACESELECT) {*/ - if (EM_texFaceCheck()) { - if(G.qual==LR_CTRLKEY) - pack_charts_tface_uv(); - else if(G.qual==LR_SHIFTKEY) - select_pinned_tface_uv(); - else if(G.qual==LR_ALTKEY) - pin_tface_uv(0); - else - pin_tface_uv(1); - } else { - if(G.qual==LR_SHIFTKEY) { - toggle_blockhandler(sa, IMAGE_HANDLER_PREVIEW, 0); - scrarea_queue_winredraw(sa); - } + if(G.qual==LR_CTRLKEY) + pack_charts_tface_uv(); + else if(G.qual==LR_SHIFTKEY) + select_pinned_tface_uv(); + else if(G.qual==LR_ALTKEY) + pin_tface_uv(0); + else + pin_tface_uv(1); + case GKEY: + if((G.qual==0) && is_uv_tface_editing_allowed()) { + initTransform(TFM_TRANSLATION, CTX_NONE); + Transform(); } break; case RKEY: @@ -4942,11 +4889,10 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt) case WKEY: weld_align_menu_tface_uv(); break; - case PADPERIOD: - if(G.qual==0) - image_viewcenter(); + case MKEY: + if((G.qual==0)) + mirrormenu_tface_uv(); break; - case COMMAKEY: if(G.qual==LR_SHIFTKEY) { G.v2d->around= V3D_CENTROID; @@ -4964,10 +4910,52 @@ static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt) } else if(G.qual==0) { G.v2d->around= V3D_CURSOR; } - scrarea_queue_headredraw(curarea); scrarea_queue_winredraw(curarea); break; + case OKEY: + if(G.qual==0) { + G.scene->proportional= !G.scene->proportional; + allqueue(REDRAWHEADERS, 0); + } else if (G.qual==LR_SHIFTKEY) { + G.scene->prop_mode = (G.scene->prop_mode+1)%7; + allqueue(REDRAWHEADERS, 0); + } + + break; + } + } + } else { + /* Draw and editmode are inactive */ + switch(event) { + case LEFTMOUSE: + if(G.qual & LR_SHIFTKEY) { + if(G.sima->image && G.sima->image->tpageflag & IMA_TILES) + mouseco_to_curtile(); + else + sima_sample_color(); + } else { + sima_sample_color(); + } + break; + case RIGHTMOUSE: + if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT)) + sample_vpaint(); + break; + case NKEY: + if(G.qual==LR_CTRLKEY) + replace_names_but(); + break; + case PKEY: + if(G.qual==LR_SHIFTKEY) { + toggle_blockhandler(sa, IMAGE_HANDLER_PREVIEW, 0); + scrarea_queue_winredraw(sa); + } + break; + case PADPERIOD: + if(G.qual==0) + image_viewcenter(); + break; } } diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 684baec0d18..bda66896485 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -2289,7 +2289,7 @@ void autokeyframe_ob_cb_func(Object *ob, int tmode) if (U.uiflag & USER_KEYINSERTNEED) insertkey_smarter(id, ID_OB, actname, NULL, icu->adrcode); else - insertkey(id, ID_OB, actname, NULL, icu->adrcode); + insertkey(id, ID_OB, actname, NULL, icu->adrcode, 0); icu= icu->next; } } @@ -2312,17 +2312,17 @@ void autokeyframe_ob_cb_func(Object *ob, int tmode) } } else { - insertkey(&ob->id, ID_OB, actname, NULL, OB_ROT_X); - insertkey(&ob->id, ID_OB, actname, NULL, OB_ROT_Y); - insertkey(&ob->id, ID_OB, actname, NULL, OB_ROT_Z); + insertkey(&ob->id, ID_OB, actname, NULL, OB_ROT_X, 0); + insertkey(&ob->id, ID_OB, actname, NULL, OB_ROT_Y, 0); + insertkey(&ob->id, ID_OB, actname, NULL, OB_ROT_Z, 0); - insertkey(&ob->id, ID_OB, actname, NULL, OB_LOC_X); - insertkey(&ob->id, ID_OB, actname, NULL, OB_LOC_Y); - insertkey(&ob->id, ID_OB, actname, NULL, OB_LOC_Z); + insertkey(&ob->id, ID_OB, actname, NULL, OB_LOC_X, 0); + insertkey(&ob->id, ID_OB, actname, NULL, OB_LOC_Y, 0); + insertkey(&ob->id, ID_OB, actname, NULL, OB_LOC_Z, 0); - insertkey(&ob->id, ID_OB, actname, NULL, OB_SIZE_X); - insertkey(&ob->id, ID_OB, actname, NULL, OB_SIZE_Y); - insertkey(&ob->id, ID_OB, actname, NULL, OB_SIZE_Z); + insertkey(&ob->id, ID_OB, actname, NULL, OB_SIZE_X, 0); + insertkey(&ob->id, ID_OB, actname, NULL, OB_SIZE_Y, 0); + insertkey(&ob->id, ID_OB, actname, NULL, OB_SIZE_Z, 0); } remake_object_ipos(ob); @@ -2364,7 +2364,7 @@ void autokeyframe_pose_cb_func(Object *ob, int tmode, short targetless_ik) if (U.uiflag & USER_KEYINSERTNEED) insertkey_smarter(&ob->id, ID_PO, pchan->name, NULL, icu->adrcode); else - insertkey(&ob->id, ID_PO, pchan->name, NULL, icu->adrcode); + insertkey(&ob->id, ID_PO, pchan->name, NULL, icu->adrcode, 0); } break; } @@ -2389,18 +2389,18 @@ void autokeyframe_pose_cb_func(Object *ob, int tmode, short targetless_ik) } } else { - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_X); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_Y); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_Z); - - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_W); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_X); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_Y); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_Z); - - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_X); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_Y); - insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_Z); + insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_X, 0); + insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_Y, 0); + insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_SIZE_Z, 0); + + insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_W, 0); + insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_X, 0); + insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_Y, 0); + insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_QUAT_Z, 0); + + insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_X, 0); + insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_Y, 0); + insertkey(&ob->id, ID_PO, pchan->name, NULL, AC_LOC_Z, 0); } } } -- cgit v1.2.3