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>2011-04-26 17:49:40 +0400
committerJoshua Leung <aligorith@gmail.com>2011-04-26 17:49:40 +0400
commit64a37fadf09e32772520272a831034a9fe790fc8 (patch)
tree6cadbf712bc9186b731cfeeda256d2228820da5f /source/blender/blenkernel/intern/anim_sys.c
parent481aed1d0e7f943b9b7caa12a890c0cc4286ac00 (diff)
Adding support for adding copies of existing drivers to other animdata
blocks via PyAPI/RNA For example: ob = bpy.context.active_object # assumes default cube has some drivers added already before running script dst = bpy.data.objects["Camera"] adt = dst.animation_data_create() for driver in ob.animation_data.drivers: new_driver = adt.drivers.from_existing(driver)
Diffstat (limited to 'source/blender/blenkernel/intern/anim_sys.c')
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index f7eaff475fa..5198172c205 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -194,7 +194,7 @@ AnimData *BKE_copy_animdata (AnimData *adt, const short do_action)
dadt= MEM_dupallocN(adt);
/* make a copy of action - at worst, user has to delete copies... */
- if(do_action) {
+ if (do_action) {
dadt->action= copy_action(adt->action);
dadt->tmpact= copy_action(adt->tmpact);
}
@@ -216,11 +216,11 @@ AnimData *BKE_copy_animdata (AnimData *adt, const short do_action)
return dadt;
}
-int BKE_copy_animdata_id(struct ID *id_to, struct ID *id_from, const short do_action)
+int BKE_copy_animdata_id (ID *id_to, ID *id_from, const short do_action)
{
AnimData *adt;
- if((id_to && id_from) && (GS(id_to->name) != GS(id_from->name)))
+ if ((id_to && id_from) && (GS(id_to->name) != GS(id_from->name)))
return 0;
BKE_free_animdata(id_to);
@@ -237,13 +237,13 @@ int BKE_copy_animdata_id(struct ID *id_to, struct ID *id_from, const short do_ac
void BKE_copy_animdata_id_action(struct ID *id)
{
AnimData *adt= BKE_animdata_from_id(id);
- if(adt) {
- if(adt->action) {
- ((ID *)adt->action)->us--;
+ if (adt) {
+ if (adt->action) {
+ id_us_min((ID *)adt->action);
adt->action= copy_action(adt->action);
}
- if(adt->tmpact) {
- ((ID *)adt->tmpact)->us--;
+ if (adt->tmpact) {
+ id_us_min((ID *)adt->tmpact);
adt->tmpact= copy_action(adt->tmpact);
}
}