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/src | |
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/src')
-rw-r--r-- | source/blender/src/buttons_object.c | 4 | ||||
-rw-r--r-- | source/blender/src/drawaction.c | 2 | ||||
-rw-r--r-- | source/blender/src/editaction.c | 6 | ||||
-rw-r--r-- | source/blender/src/editipo.c | 362 | ||||
-rw-r--r-- | source/blender/src/editkey.c | 2 | ||||
-rw-r--r-- | source/blender/src/editview.c | 12 | ||||
-rw-r--r-- | source/blender/src/poseobject.c | 20 | ||||
-rw-r--r-- | source/blender/src/space.c | 146 | ||||
-rw-r--r-- | source/blender/src/transform_conversions.c | 46 |
9 files changed, 295 insertions, 305 deletions
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; a<tot; a++, fp+=2) { - insert_vert_icu(ei->icu, 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); } } } |