forked from bartvdbraak/blender
Auto-Keyframing (per scene):
Now auto-keyframing can be enabled/disabled per scene (with the insertion mode also stored per scene). The flags used when insertng keyframes are still stored in the user-prefs. New scenes have their auto-keyframing settings initialised from the user-preferences.
This commit is contained in:
parent
049b88f0d2
commit
50faaccf2e
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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! */
|
||||
|
@ -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 */
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user