[Bf-blender-cvs] [713faedb607] temp-sybren-usd-patch-01: USD: use `BKE_animdata_id_is_animated()`

Sybren A. Stüvel noreply at git.blender.org
Tue Nov 26 18:22:57 CET 2019


Commit: 713faedb6079cbe9818d969cbb7b7a7cb5500474
Author: Sybren A. Stüvel
Date:   Tue Nov 26 15:14:35 2019 +0100
Branches: temp-sybren-usd-patch-01
https://developer.blender.org/rB713faedb6079cbe9818d969cbb7b7a7cb5500474

USD: use `BKE_animdata_id_is_animated()`

`BKE_animdata_id_is_animated()` is now used to determine whether object data
has any animation. This also includes counting the fcurves+drivers; previously
the presense of a non-NULL AnimData pointer was enough to consider the
object data animated.

===================================================================

M	source/blender/usd/intern/usd_writer_abstract.cc

===================================================================

diff --git a/source/blender/usd/intern/usd_writer_abstract.cc b/source/blender/usd/intern/usd_writer_abstract.cc
index eb988521df5..af6d92ed72d 100644
--- a/source/blender/usd/intern/usd_writer_abstract.cc
+++ b/source/blender/usd/intern/usd_writer_abstract.cc
@@ -73,14 +73,8 @@ bool USDAbstractWriter::check_is_animated(const HierarchyContext &context) const
 {
   const Object *object = context.object;
 
-  if (object->data != nullptr) {
-    AnimData *adt = BKE_animdata_from_id(static_cast<ID *>(object->data));
-    /* TODO(Sybren): make this check more strict, as the AnimationData may
-     * actually be empty (no fcurves, drivers, etc.) and thus effectively
-     * have no animation at all. */
-    if (adt != nullptr) {
-      return true;
-    }
+  if (BKE_animdata_id_is_animated(static_cast<ID *>(object->data))) {
+    return true;
   }
   if (BKE_key_from_object(object) != nullptr) {
     return true;



More information about the Bf-blender-cvs mailing list