diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-01-12 14:06:51 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-01-12 14:06:51 +0300 |
commit | 4830f12680b963d6d95fe0bd5ed4d3d9acb6eeb6 (patch) | |
tree | 7c2ff90653a8a948e0ec2938e7a65ca9aff28921 /source | |
parent | 60722bfb1d1a1dc1d76fa602f95892756ab65680 (diff) |
== AutoKeying - Tidy Up ==
This commit restores the "big red button". When Auto-Keying is enabled (record button toggled on), a menu appears beside it to choose which behaviour for auto-keying should be used. This should be more efficient for quickly turning Auto-Keying on/off.
I've also added the relevant version-patches to fix up old files so that sensible default options are in use.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 9 | ||||
-rw-r--r-- | source/blender/src/header_time.c | 17 | ||||
-rw-r--r-- | source/blender/src/space.c | 43 | ||||
-rw-r--r-- | source/blender/src/transform_conversions.c | 2 | ||||
-rw-r--r-- | source/blender/src/usiblender.c | 10 |
5 files changed, 54 insertions, 27 deletions
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index cbbd729cb83..68692b82ba5 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -262,9 +262,11 @@ extern UserDef U; /* from usiblender.c !!!! */ #define USER_SHOW_FPS (1 << 21) /* Auto-Keying mode */ -#define AUTOKEY_MODE_OFF 0 -#define AUTOKEY_MODE_NORMAL 1 -#define AUTOKEY_MODE_EDITKEYS 2 + /* AUTOKEY_ON is a bitflag */ +#define AUTOKEY_ON 1 + /* AUTOKEY_ON + 2**n... (i.e. AUTOKEY_MODE_NORMAL = AUTOKEY_ON + 2) to preserve setting, even when autokey turned off */ +#define AUTOKEY_MODE_NORMAL 3 +#define AUTOKEY_MODE_EDITKEYS 5 /* Auto-Keying flag */ #define AUTOKEY_FLAG_INSERTAVAIL (1<<0) @@ -272,6 +274,7 @@ extern UserDef U; /* from usiblender.c !!!! */ #define AUTOKEY_FLAG_AUTOMATKEY (1<<2) /* Auto-Keying macros */ +#define IS_AUTOKEY_ON (U.autokey_mode & AUTOKEY_ON) #define IS_AUTOKEY_MODE(mode) (U.autokey_mode == AUTOKEY_MODE_##mode) #define IS_AUTOKEY_FLAG(flag) (U.autokey_flag == AUTOKEY_FLAG_##flag) diff --git a/source/blender/src/header_time.c b/source/blender/src/header_time.c index bd7cbb39610..7b98d2f5f4c 100644 --- a/source/blender/src/header_time.c +++ b/source/blender/src/header_time.c @@ -524,13 +524,18 @@ void time_buttons(ScrArea *sa) xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Skip to End frame (Shift UpArrow)"); xco+= XIC+8; - // FIXME: give this icons (and maybe make it XIC wide again) - it used to use the "ICON_REC" (red dot) - uiDefButS(block, MENU, REDRAWINFO, - "Auto-Keying Mode %t|No Auto-Keying %x0|Add/Replace Keys%x1|Replace Keys %x2", - xco, 0, 4*XIC, YIC, &(U.autokey_mode), 0, 1, 0, 0, - "Automatic keyframe insertion for Objects and Bones"); + uiDefIconButBitS(block, TOG, AUTOKEY_ON, REDRAWINFO, ICON_REC, + xco, 0, XIC, YIC, &(U.autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones"); + xco+= XIC; + if (IS_AUTOKEY_ON) { + uiDefButS(block, MENU, REDRAWINFO, + "Auto-Keying Mode %t|Add/Replace Keys%x3|Replace Keys %x5", + xco, 0, 3*XIC, YIC, &(U.autokey_mode), 0, 1, 0, 0, + "Mode of automatic keyframe insertion for Objects and Bones"); + xco+= (4*XIC); + } - xco+= (4*XIC)+16; + xco+= 16; uiDefIconButBitI(block, TOG, TIME_WITH_SEQ_AUDIO, B_DIFF, ICON_SPEAKER, xco, 0, XIC, YIC, &(stime->redraws), 0, 0, 0, 0, "Play back and sync with audio from Sequence Editor"); diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 770401e3399..dee87f2380c 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -3668,26 +3668,35 @@ void drawinfospace(ScrArea *sa, void *spacedata) uiDefBut(block, LABEL,0,"Auto Keyframe", - (xpos+(2*edgsp)+(2*mpref)+midsp),y5label,mpref,buth, + (xpos+(2*edgsp)+(2*mpref)+midsp),y6label,mpref,buth, 0, 0, 0, 0, 0, ""); - uiDefButS(block, MENU, REDRAWTIME, - "Auto-Keying Mode %t|No Auto-Keying %x0|Add/Replace Keys%x1|Replace Keys %x2", - (xpos+edgsp+(2*mpref)+(2*midsp)),y4,mpref, buth, - &(U.autokey_mode), 0, 1, 0, 0, - "Automatic keyframe insertion for Objects and Bones"); - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, AUTOKEY_FLAG_INSERTAVAIL, REDRAWTIME, "Available", - (xpos+edgsp+(2*mpref)+(2*midsp)),y3,mpref, buth, - &(U.autokey_flag), 0, 0, 0, 0, "Automatic keyframe insertion in available curves"); - uiDefButBitS(block, TOG, AUTOKEY_FLAG_INSERTNEEDED, REDRAWTIME, "Needed", - (xpos+edgsp+(2*mpref)+(2*midsp)),y2,mpref, buth, - &(U.autokey_flag), 0, 0, 0, 0, "Automatic keyframe insertion only when keyframe needed"); + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, AUTOKEY_ON, REDRAWTIME, "Auto-Keying Enabled", + (xpos+edgsp+(2*mpref)+(2*midsp)),y5,mpref, buth, + &(U.autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones"); - uiDefButBitS(block, TOG, AUTOKEY_FLAG_AUTOMATKEY, REDRAWTIME, "Use Visual Keying", - (xpos+edgsp+(2*mpref)+(2*midsp)),y1,mpref, buth, - &(U.autokey_flag), 0, 0, 0, 0, "Use Visual keying automatically for constrained objects"); + if (IS_AUTOKEY_ON) { + uiDefButS(block, MENU, REDRAWTIME, + "Auto-Keying Mode %t|Add/Replace Keys%x3|Replace Keys %x5", + (xpos+edgsp+(2*mpref)+(2*midsp)),y4,mpref, buth, + &(U.autokey_mode), 0, 1, 0, 0, + "Mode of automatic keyframe insertion for Objects and Bones"); + } + uiBlockEndAlign(block); + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, AUTOKEY_FLAG_INSERTAVAIL, REDRAWTIME, "Available", + (xpos+edgsp+(2*mpref)+(2*midsp)),y3,mpref, buth, + &(U.autokey_flag), 0, 0, 0, 0, "Automatic keyframe insertion in available curves"); + + uiDefButBitS(block, TOG, AUTOKEY_FLAG_INSERTNEEDED, REDRAWTIME, "Needed", + (xpos+edgsp+(2*mpref)+(2*midsp)),y2,mpref, buth, + &(U.autokey_flag), 0, 0, 0, 0, "Automatic keyframe insertion only when keyframe needed"); + + uiDefButBitS(block, TOG, AUTOKEY_FLAG_AUTOMATKEY, REDRAWTIME, "Use Visual Keying", + (xpos+edgsp+(2*mpref)+(2*midsp)),y1,mpref, buth, + &(U.autokey_flag), 0, 0, 0, 0, "Use Visual keying automatically for constrained objects"); uiBlockEndAlign(block); diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c index 2ec8dffa9f7..77d9938f778 100644 --- a/source/blender/src/transform_conversions.c +++ b/source/blender/src/transform_conversions.c @@ -2967,7 +2967,7 @@ short autokeyframe_cfra_can_key(Object *ob) short found= 0; /* only filter if auto-key mode requires this */ - if (IS_AUTOKEY_MODE(OFF)) + if (IS_AUTOKEY_ON == 0) return 0; else if (IS_AUTOKEY_MODE(NORMAL)) return 1; diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 2bf2d5d9ae9..147f5a79137 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -197,6 +197,16 @@ static void init_userdef_file(void) if(U.flag & USER_CUSTOM_RANGE) vDM_ColorBand_store(&U.coba_weight); /* signal for derivedmesh to use colorband */ + /* Auto-keyframing settings */ + if(U.autokey_mode == 0) { + /* AUTOKEY_MODE_NORMAL - AUTOKEY_ON = x <==> 3 - 1 = 2 */ + U.autokey_mode |= 2; + + if(U.flag & (1<<15)) U.autokey_flag |= AUTOKEY_FLAG_INSERTAVAIL; + if(U.flag & (1<<19)) U.autokey_flag |= AUTOKEY_FLAG_INSERTNEEDED; + if(G.flags & (1<<30)) U.autokey_flag |= AUTOKEY_FLAG_AUTOMATKEY; + } + if (G.main->versionfile <= 191) { strcpy(U.plugtexdir, U.textudir); strcpy(U.sounddir, "/"); |