Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2013-10-02 16:14:50 +0400
committerJoshua Leung <aligorith@gmail.com>2013-10-02 16:14:50 +0400
commit8e70db78f4e1c7c9b99cad709b347b3da92f442e (patch)
treebb283f6c77eb5cebc475075d83c3cce7a977ea7d
parent724b015da2ed219ab12a64c01c4fd1608231edf4 (diff)
Bugfix: All actions created when keyframing now have their "id-root" set appropriately
This means that it will no longer be possible to accidentally load a nodetree action in the Action Editor (object-level actions only), resulting in F-Curves getting invalidated/disabled.
-rw-r--r--source/blender/editors/animation/keyframing.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 70361f00004..b5844b2aab2 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -141,9 +141,18 @@ bAction *verify_adt_action(ID *id, short add)
/* init action if none available yet */
/* TODO: need some wizardry to handle NLA stuff correct */
if ((adt->action == NULL) && (add)) {
+ /* init action name from name of ID block */
char actname[sizeof(id->name) - 2];
BLI_snprintf(actname, sizeof(actname), "%sAction", id->name + 2);
+
+ /* create action */
adt->action = add_empty_action(G.main, actname);
+
+ /* set ID-type from ID-block that this is going to be assigned to
+ * so that users can't accidentally break actions by assigning them
+ * to the wrong places
+ */
+ adt->action->idroot = GS(id->name);
}
/* return the action */