[Bf-blender-cvs] [6ab3421fd94] temp-sybren-usd-patch-02: USD: use `BKE_animdata_id_is_animated()`

Sybren A. Stüvel noreply at git.blender.org
Thu Nov 28 17:56:11 CET 2019


Commit: 6ab3421fd9486b8d4468ee6809aabaedfbc751d0
Author: Sybren A. Stüvel
Date:   Tue Nov 26 15:14:35 2019 +0100
Branches: temp-sybren-usd-patch-02
https://developer.blender.org/rB6ab3421fd9486b8d4468ee6809aabaedfbc751d0

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