diff options
-rw-r--r-- | source/blender/blenkernel/BKE_blender.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 1 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 9 | ||||
-rw-r--r-- | source/blender/include/BIF_keyframing.h | 18 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 4 | ||||
-rw-r--r-- | source/blender/src/header_time.c | 4 | ||||
-rw-r--r-- | source/blender/src/space.c | 3 |
8 files changed, 36 insertions, 9 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 14270d3a7c9..f7af2e4b938 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -41,7 +41,7 @@ struct ListBase; struct MemFile; #define BLENDER_VERSION 247 -#define BLENDER_SUBVERSION 7 +#define BLENDER_SUBVERSION 8 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 701e8ecb311..dea36a69643 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -188,6 +188,7 @@ Scene *add_scene(char *name) sce->lay= 1; sce->selectmode= SCE_SELECT_VERTEX; sce->editbutsize= 0.1; + sce->autokey_mode= U.autokey_mode; sce->r.mode= R_GAMMA; sce->r.cfra= 1; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d38eed4d094..5692627281d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7908,6 +7908,15 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } } + /* autokey mode settings now used from scene, but need to be initialised off userprefs */ + if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 8)) { + Scene *sce; + + for (sce= main->scene.first; sce; sce= sce->id.next) { + if (sce->autokey_mode == 0) + sce->autokey_mode= U.autokey_mode; + } + } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/include/BIF_keyframing.h b/source/blender/include/BIF_keyframing.h index eeaef957b90..7989e6adb45 100644 --- a/source/blender/include/BIF_keyframing.h +++ b/source/blender/include/BIF_keyframing.h @@ -80,6 +80,24 @@ short deletekey(struct ID *id, int blocktype, char *actname, char *constname, in void common_insertkey(void); void common_deletekey(void); +/* ************ Auto-Keyframing ********************** */ +/* Notes: + * - All the defines for this (User-Pref settings and Per-Scene settings) + * are defined in DNA_userdef_types.h + * - Scene settings take presidence over those for userprefs, with old files + * inheriting userpref settings for the scene settings + * - "On/Off + Mode" are stored per Scene, but "settings" are currently stored + * as userprefs + */ + +/* Auto-Keying macros for use by various tools */ + /* check if auto-keyframing is enabled (per scene takes presidence) */ +#define IS_AUTOKEY_ON ((G.scene) ? (G.scene->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON)) + /* check the mode for auto-keyframing (per scene takes presidence) */ +#define IS_AUTOKEY_MODE(mode) ((G.scene) ? (G.scene->autokey_mode == AUTOKEY_MODE_##mode) : (U.autokey_mode == AUTOKEY_MODE_##mode)) + /* check if a flag is set for auto-keyframing (as userprefs only!) */ +#define IS_AUTOKEY_FLAG(flag) (U.autokey_flag & AUTOKEY_FLAG_##flag) + /* ************ Keyframe Checking ******************** */ /* Checks whether a keyframe exists for the given ID-block one the given frame */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 3888cb48520..a5eaf222941 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -520,7 +520,9 @@ typedef struct Scene { float editbutsize; /* size of normals */ short selectmode; /* for mesh only! */ short proportional, prop_mode; - short automerge, pad5, pad6, pad7; + short automerge, pad5, pad6; + + short autokey_mode; /* mode for autokeying (defines in DNA_userdef_types.h */ short use_nodes; diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 5d36d5ca973..ead1df4ddac 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -290,10 +290,6 @@ extern UserDef U; /* from usiblender.c !!!! */ #define AUTOKEY_FLAG_INSERTNEEDED (1<<1) #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) /* transopts */ #define USER_TR_TOOLTIPS (1 << 0) diff --git a/source/blender/src/header_time.c b/source/blender/src/header_time.c index a67422879d4..5de4d744a0a 100644 --- a/source/blender/src/header_time.c +++ b/source/blender/src/header_time.c @@ -554,12 +554,12 @@ void time_buttons(ScrArea *sa) xco+= XIC+8; 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, 0, XIC, YIC, &(G.scene->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, + xco, 0, 3*XIC, YIC, &(G.scene->autokey_mode), 0, 1, 0, 0, "Mode of automatic keyframe insertion for Objects and Bones"); xco+= (4*XIC); } diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 92b5580775e..2814e03b75f 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -122,6 +122,7 @@ #include "BIF_imasel.h" #include "BIF_interface.h" #include "BIF_interface_icons.h" +#include "BIF_keyframing.h" #include "BIF_meshtools.h" #include "BIF_mywindow.h" #include "BIF_oops.h" @@ -4034,7 +4035,7 @@ void drawinfospace(ScrArea *sa, void *spacedata) (xpos+edgsp+(2*mpref)+(2*midsp)),y5,mpref, buth, &(U.autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones"); - if (IS_AUTOKEY_ON) { + if (U.autokey_mode & 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, |