diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-11-26 16:35:47 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-11-26 18:26:52 +0300 |
commit | f18ad385dffe70f5e57df00ff9bbb7b42fa05be0 (patch) | |
tree | 00c70215a421b1187d7482f428d1548d0b29ea1c /source/blender/blenkernel/BKE_animsys.h | |
parent | a018a7fb0d5b2cd6de2bb7b4f4aa092594655fdd (diff) |
Alembic export: don't assume transform is always animated
Instead of always writing the transform on every frame, it's now checked
whether the object is animated at all. This could be made stricter to
reduce false positives, for example by checking FCurves and drivers to
see whether translation/rotation/scale is animated. However, this
approach is already better than the `return true` we had before.
This commit adds the BKE_animdata_id_is_animated(id) function, which
returns true if the ID datablock has non-empty animation data. This is
determined by checking the the active action's fcurves, the drivers, and
NLA tracks.
Diffstat (limited to 'source/blender/blenkernel/BKE_animsys.h')
-rw-r--r-- | source/blender/blenkernel/BKE_animsys.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h index 4e4528ff92b..985dce70bdc 100644 --- a/source/blender/blenkernel/BKE_animsys.h +++ b/source/blender/blenkernel/BKE_animsys.h @@ -60,6 +60,9 @@ bool BKE_animdata_set_action(struct ReportList *reports, struct ID *id, struct b /* Free AnimData */ void BKE_animdata_free(struct ID *id, const bool do_id_user); +/* Return true if the ID-block has non-empty AnimData. */ +bool BKE_animdata_id_is_animated(struct ID *id); + /* Copy AnimData */ struct AnimData *BKE_animdata_copy(struct Main *bmain, struct AnimData *adt, const int flag); |