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>2007-12-19 13:03:54 +0300
committerJoshua Leung <aligorith@gmail.com>2007-12-19 13:03:54 +0300
commitbbc7894dd84b71e4f7aabd337231b164765e8f9c (patch)
tree9de98fc1198666bc8cabc1a625980ac7bf922b33 /source/blender/src/headerbuttons.c
parentef4fa972babcbf788fd70ac5f50887406ca90bac (diff)
== Action Editor - Pinned Actions Bugfix ==
When using a pinned action, "Add New" now makes a new action. This new action is only assigned to the current Action Editor (i.e. not to any active object, as one might not exist, or might not be the object that the action is related to).
Diffstat (limited to 'source/blender/src/headerbuttons.c')
-rw-r--r--source/blender/src/headerbuttons.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c
index 18bbba89ce8..505206ed6e0 100644
--- a/source/blender/src/headerbuttons.c
+++ b/source/blender/src/headerbuttons.c
@@ -938,14 +938,14 @@ void do_global_buttons(unsigned short event)
break;
act=ob->action;
id= (ID *)act;
-
+
if (G.saction->actnr== -2){
activate_databrowse((ID *)G.saction->action, ID_AC, 0, B_ACTIONBROWSE, &G.saction->actnr, do_global_buttons);
return;
}
-
+
if(G.saction->actnr < 0) break;
-
+
/* See if we have selected a valid action */
for (idtest= G.main->action.first; idtest; idtest= idtest->next) {
if(nr==G.saction->actnr) {
@@ -956,7 +956,16 @@ void do_global_buttons(unsigned short event)
}
if(G.saction->pin) {
- G.saction->action= (bAction *)idtest;
+ if (idtest == NULL) {
+ /* assign new/copy of pinned action only - messy as it doesn't assign to any obj's */
+ if (G.saction->action)
+ G.saction->action= (bAction *)copy_action(G.saction->action);
+ else
+ G.saction->action= (bAction *)add_empty_action("PinnedAction");
+ }
+ else {
+ G.saction->action= (bAction *)idtest;
+ }
allqueue(REDRAWACTION, 0);
}
else {