[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34634] trunk/blender: Moved Auto-Keying " Insert for KeyingSet only" option from UserPrefs to
Joshua Leung
aligorith at gmail.com
Fri Feb 4 09:33:08 CET 2011
Revision: 34634
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34634
Author: aligorith
Date: 2011-02-04 08:33:07 +0000 (Fri, 04 Feb 2011)
Log Message:
-----------
Moved Auto-Keying "Insert for KeyingSet only" option from UserPrefs to
Scene (Toolsettings, i.e. alongside "layered" option for using NLA
while doing auto-keying)
This option makes all Auto-Keying operations use the active Keying Set
to carry out keyframing operations instead of picking and choosing
their own Keying Sets to use, thus cutting down on the number of
unwanted keys.
Warning: if the older userpref option was enabled in an old
startup.blend, it may be difficult to turn this option off.
Modified Paths:
--------------
trunk/blender/release/scripts/ui/space_time.py
trunk/blender/source/blender/editors/animation/keyframing.c
trunk/blender/source/blender/editors/animation/keyingsets.c
trunk/blender/source/blender/editors/include/ED_keyframing.h
trunk/blender/source/blender/editors/interface/resources.c
trunk/blender/source/blender/editors/transform/transform_conversions.c
trunk/blender/source/blender/editors/transform/transform_generics.c
trunk/blender/source/blender/makesdna/DNA_userdef_types.h
trunk/blender/source/blender/makesrna/intern/rna_scene.c
trunk/blender/source/blender/makesrna/intern/rna_userdef.c
Modified: trunk/blender/release/scripts/ui/space_time.py
===================================================================
--- trunk/blender/release/scripts/ui/space_time.py 2011-02-04 04:12:24 UTC (rev 34633)
+++ trunk/blender/release/scripts/ui/space_time.py 2011-02-04 08:33:07 UTC (rev 34634)
@@ -80,6 +80,7 @@
row = layout.row(align=True)
row.prop(tools, "use_keyframe_insert_auto", text="", toggle=True)
+ row.prop(tools, "use_keyframe_insert_keyingset", text="", toggle=True)
if screen.is_animation_playing and tools.use_keyframe_insert_auto:
subsub = row.row()
subsub.prop(tools, "use_record_with_nla", toggle=True)
Modified: trunk/blender/source/blender/editors/animation/keyframing.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyframing.c 2011-02-04 04:12:24 UTC (rev 34633)
+++ trunk/blender/source/blender/editors/animation/keyframing.c 2011-02-04 08:33:07 UTC (rev 34634)
@@ -88,15 +88,15 @@
/* standard flags */
{
/* visual keying */
- if (IS_AUTOKEY_FLAG(AUTOMATKEY))
+ if (IS_AUTOKEY_FLAG(scene, AUTOMATKEY))
flag |= INSERTKEY_MATRIX;
/* only needed */
- if (IS_AUTOKEY_FLAG(INSERTNEEDED))
+ if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED))
flag |= INSERTKEY_NEEDED;
/* default F-Curve color mode - RGB from XYZ indices */
- if (IS_AUTOKEY_FLAG(XYZ2RGB))
+ if (IS_AUTOKEY_FLAG(scene, XYZ2RGB))
flag |= INSERTKEY_XYZ2RGB;
}
Modified: trunk/blender/source/blender/editors/animation/keyingsets.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyingsets.c 2011-02-04 04:12:24 UTC (rev 34633)
+++ trunk/blender/source/blender/editors/animation/keyingsets.c 2011-02-04 08:33:07 UTC (rev 34634)
@@ -308,7 +308,7 @@
keyingflag |= ANIM_get_keyframing_flags(scene, 0);
- if (IS_AUTOKEY_FLAG(XYZ2RGB))
+ if (IS_AUTOKEY_FLAG(scene, XYZ2RGB))
keyingflag |= INSERTKEY_XYZ2RGB;
/* call the API func, and set the active keyingset index */
@@ -680,9 +680,9 @@
* - use the active KeyingSet if defined (and user wants to use it for all autokeying),
* or otherwise key transforms only
*/
- if (IS_AUTOKEY_FLAG(ONLYKEYINGSET) && (scene->active_keyingset))
+ if (IS_AUTOKEY_FLAG(scene, ONLYKEYINGSET) && (scene->active_keyingset))
return ANIM_scene_get_active_keyingset(scene);
- else if (IS_AUTOKEY_FLAG(INSERTAVAIL))
+ else if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL))
return ANIM_builtin_keyingset_get_named(NULL, "Available");
else
return ANIM_builtin_keyingset_get_named(NULL, tranformKSName);
Modified: trunk/blender/source/blender/editors/include/ED_keyframing.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_keyframing.h 2011-02-04 04:12:24 UTC (rev 34633)
+++ trunk/blender/source/blender/editors/include/ED_keyframing.h 2011-02-04 08:33:07 UTC (rev 34634)
@@ -259,8 +259,12 @@
#define IS_AUTOKEY_ON(scene) ((scene) ? (scene->toolsettings->autokey_mode & AUTOKEY_ON) : (U.autokey_mode & AUTOKEY_ON))
/* check the mode for auto-keyframing (per scene takes presidence) */
#define IS_AUTOKEY_MODE(scene, mode) ((scene) ? (scene->toolsettings->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)
+ /* check if a flag is set for auto-keyframing (per scene takes presidence) */
+#define IS_AUTOKEY_FLAG(scene, flag) \
+ ((scene)? \
+ ((scene->toolsettings->autokey_flag & AUTOKEY_FLAG_##flag) || (U.autokey_flag & AUTOKEY_FLAG_##flag)) \
+ : \
+ (U.autokey_flag & AUTOKEY_FLAG_##flag))
/* auto-keyframing feature - checks for whether anything should be done for the current frame */
int autokeyframe_cfra_can_key(struct Scene *scene, struct ID *id);
Modified: trunk/blender/source/blender/editors/interface/resources.c
===================================================================
--- trunk/blender/source/blender/editors/interface/resources.c 2011-02-04 04:12:24 UTC (rev 34633)
+++ trunk/blender/source/blender/editors/interface/resources.c 2011-02-04 08:33:07 UTC (rev 34634)
@@ -1511,6 +1511,11 @@
}
}
+ if (bmain->versionfile < 257) {
+ /* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs, so that it doesn't linger around from old configs like a ghost */
+ U.autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET;
+ }
+
/* GL Texture Garbage Collection (variable abused above!) */
if (U.textimeout == 0) {
U.texcollectrate = 60;
Modified: trunk/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_conversions.c 2011-02-04 04:12:24 UTC (rev 34633)
+++ trunk/blender/source/blender/editors/transform/transform_conversions.c 2011-02-04 08:33:07 UTC (rev 34634)
@@ -4586,13 +4586,13 @@
/* add datasource override for the camera object */
ANIM_relative_keyingset_add_source(&dsources, id, NULL, NULL);
- if (IS_AUTOKEY_FLAG(ONLYKEYINGSET) && (active_ks)) {
+ if (IS_AUTOKEY_FLAG(scene, ONLYKEYINGSET) && (active_ks)) {
/* only insert into active keyingset
* NOTE: we assume here that the active Keying Set does not need to have its iterator overridden spe
*/
ANIM_apply_keyingset(C, &dsources, NULL, active_ks, MODIFYKEY_MODE_INSERT, cfra);
}
- else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) {
+ else if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL)) {
AnimData *adt= ob->adt;
/* only key on available channels */
@@ -4603,7 +4603,7 @@
}
}
}
- else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) {
+ else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) {
short doLoc=0, doRot=0, doScale=0;
/* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */
@@ -4700,12 +4700,12 @@
ANIM_relative_keyingset_add_source(&dsources, id, &RNA_PoseBone, pchan);
/* only insert into active keyingset? */
- if (IS_AUTOKEY_FLAG(ONLYKEYINGSET) && (active_ks)) {
+ if (IS_AUTOKEY_FLAG(scene, ONLYKEYINGSET) && (active_ks)) {
/* run the active Keying Set on the current datasource */
ANIM_apply_keyingset(C, &dsources, NULL, active_ks, MODIFYKEY_MODE_INSERT, cfra);
}
/* only insert into available channels? */
- else if (IS_AUTOKEY_FLAG(INSERTAVAIL)) {
+ else if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL)) {
if (act) {
for (fcu= act->curves.first; fcu; fcu= fcu->next) {
/* only insert keyframes for this F-Curve if it affects the current bone */
@@ -4724,7 +4724,7 @@
}
}
/* only insert keyframe if needed? */
- else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) {
+ else if (IS_AUTOKEY_FLAG(scene, INSERTNEEDED)) {
short doLoc=0, doRot=0, doScale=0;
/* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */
Modified: trunk/blender/source/blender/editors/transform/transform_generics.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_generics.c 2011-02-04 04:12:24 UTC (rev 34633)
+++ trunk/blender/source/blender/editors/transform/transform_generics.c 2011-02-04 08:33:07 UTC (rev 34634)
@@ -269,7 +269,7 @@
* - we're not only keying for available channels
* - the option to add new actions for each round is not enabled
*/
- if (IS_AUTOKEY_FLAG(INSERTAVAIL)==0 && (scene->toolsettings->autokey_flag & ANIMRECORD_FLAG_WITHNLA)) {
+ if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL)==0 && (scene->toolsettings->autokey_flag & ANIMRECORD_FLAG_WITHNLA)) {
/* if playback has just looped around, we need to add a new NLA track+strip to allow a clean pass to occur */
if ((sad) && (sad->flag & ANIMPLAY_FLAG_JUMPED)) {
AnimData *adt= BKE_animdata_from_id(id);
Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2011-02-04 04:12:24 UTC (rev 34633)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h 2011-02-04 08:33:07 UTC (rev 34634)
@@ -492,9 +492,9 @@
#define AUTOKEY_FLAG_INSERTNEEDED (1<<1)
#define AUTOKEY_FLAG_AUTOMATKEY (1<<2)
#define AUTOKEY_FLAG_XYZ2RGB (1<<3)
- /* U.autokey_flag (strictly autokeying only) */
+
+/* toolsettings->autokey_flag */
#define AUTOKEY_FLAG_ONLYKEYINGSET (1<<6)
- /* toolsettings->autokey_flag */
#define ANIMRECORD_FLAG_WITHNLA (1<<10)
/* transopts */
Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c 2011-02-04 04:12:24 UTC (rev 34633)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c 2011-02-04 08:33:07 UTC (rev 34634)
@@ -1159,7 +1159,12 @@
prop= RNA_def_property(srna, "use_record_with_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", ANIMRECORD_FLAG_WITHNLA);
RNA_def_property_ui_text(prop, "Layered", "Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking");
-
+
+ prop= RNA_def_property(srna, "use_keyframe_insert_keyingset", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_ONLYKEYINGSET);
+ RNA_def_property_ui_text(prop, "Auto Keyframe Insert Keying Set", "Automatic keyframe insertion using active Keying Set only");
+ RNA_def_property_ui_icon(prop, ICON_KEY_HLT, 0); // XXX: we need a dedicated icon
+
/* UV */
prop= RNA_def_property(srna, "uv_select_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "uv_selectmode");
Modified: trunk/blender/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_userdef.c 2011-02-04 04:12:24 UTC (rev 34633)
+++ trunk/blender/source/blender/makesrna/intern/rna_userdef.c 2011-02-04 08:33:07 UTC (rev 34634)
@@ -2185,10 +2185,6 @@
RNA_def_property_boolean_sdna(prop, NULL, "autokey_flag", AUTOKEY_FLAG_INSERTAVAIL);
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list