diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-07-07 07:35:48 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-07-07 07:35:48 +0400 |
commit | d00a3c8ddf4f722ae829bbfa025fb09446a8fba3 (patch) | |
tree | 71650d19f51b2a217e5a25f456e450797a589942 /source/blender/makesrna/intern/rna_animation.c | |
parent | 34c5784f992f64e52f5b07e0f457ec53d9709874 (diff) |
Outliner RMB Menu - AnimData mangement
* When clicking on "Animation" items in the Outliner, there's now a
menu containing from which you can change the action used, and
refresh/delete all drivers.
* Moved action-setting logic for AnimData actions to a single utility
function in anim_sys, since this was starting to be done in too many
places already.
* Fixed Outliner refresh bug after changing the active action
Diffstat (limited to 'source/blender/makesrna/intern/rna_animation.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_animation.c | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 5664fac149e..a3b3d0ac8c9 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -74,42 +74,7 @@ static int rna_AnimData_action_editable(PointerRNA *ptr) static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value) { ID *ownerId = (ID *)ptr->id.data; - AnimData *adt = (AnimData *)ptr->data; - - /* manage usercount for current action */ - if (adt->action) - id_us_min((ID*)adt->action); - - /* assume that AnimData's action can in fact be edited... */ - if ((value.data) && (ownerId)) { - bAction *act = (bAction *)value.data; - - /* action must have same type as owner */ - if (ownerId) { - if (ELEM(act->idroot, 0, GS(ownerId->name))) { - /* can set */ - adt->action = act; - id_us_plus((ID*)adt->action); - } - else { - /* cannot set */ - printf("ERROR: Couldn't set Action '%s' onto ID '%s', as it doesn't have suitably rooted paths for this purpose\n", - act->id.name+2, ownerId->name); - } - } - else { - /* cannot tell if we can set, so let's just be generous... */ - printf("Warning: Set Action '%s' onto AnimData block with an unknown ID-owner. May have attached invalid data\n", - act->id.name+2); - - adt->action = act; - id_us_plus((ID*)adt->action); - } - } - else { - /* just clearing the action... */ - adt->action = NULL; - } + BKE_animdata_set_action(NULL, ownerId, value.data); } /* ****************************** */ |