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:
authorCampbell Barton <ideasman42@gmail.com>2010-01-10 23:23:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-10 23:23:59 +0300
commit0185e248619b883aa818d136ee1b8bd4bfa9f8ef (patch)
tree86e0f20ae1be2f681735b2d21224b582f56610ba
parent6a15ac70b6558873dc15aa2172024477362fc33f (diff)
Make linked animdata working again, copies NLA too, as well as ObData animdata where types match
-rw-r--r--source/blender/blenkernel/BKE_animsys.h3
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c20
-rw-r--r--source/blender/editors/object/object_relations.c10
3 files changed, 25 insertions, 8 deletions
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h
index 045095567bc..ad89d3bbd53 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -55,6 +55,9 @@ void BKE_free_animdata(struct ID *id);
/* Copy AnimData */
struct AnimData *BKE_copy_animdata(struct AnimData *adt);
+/* Copy AnimData */
+int BKE_copy_animdata_id(struct ID *id_to, struct ID *id_from);
+
/* Make Local */
void BKE_animdata_make_local(struct AnimData *adt);
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 8b86f6a5d1f..2a5a12cc513 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -203,6 +203,26 @@ AnimData *BKE_copy_animdata (AnimData *adt)
return dadt;
}
+int BKE_copy_animdata_id(struct ID *id_to, struct ID *id_from)
+{
+ AnimData *adt;
+
+ if((id_to && id_from) && (GS(id_to->name) != GS(id_from->name)))
+ return 0;
+
+ BKE_free_animdata(id_to);
+
+ adt = BKE_animdata_from_id(id_from);
+ if (adt) {
+ IdAdtTemplate *iat = (IdAdtTemplate *)id_to;
+ iat->adt= BKE_copy_animdata(adt);
+ }
+
+ return 1;
+}
+
+
+
/* Make Local -------------------------------------------- */
static void make_local_strips(ListBase *strips)
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index d4bf721e14e..237498f15fd 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -1219,14 +1219,8 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
}
break;
case MAKE_LINKS_ANIMDATA:
-#if 0 // XXX old animation system
- if(obt->ipo) obt->ipo->id.us--;
- obt->ipo= ob->ipo;
- if(obt->ipo) {
- id_us_plus((ID *)obt->ipo);
- do_ob_ipo(scene, obt);
- }
-#endif // XXX old animation system
+ BKE_copy_animdata_id((ID *)obt, (ID *)ob);
+ BKE_copy_animdata_id((ID *)obt->data, (ID *)ob->data);
break;
case MAKE_LINKS_DUPLIGROUP:
if(ob->dup_group) ob->dup_group->id.us--;