[Bf-blender-cvs] [8d840898553] temp-sybren-usd-patch-01: USD: replace check_is_transform_animated() with BKE_object_moves_in_time()

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


Commit: 8d84089855335ad5d4e9b0638e4afbd0d2907fb7
Author: Sybren A. Stüvel
Date:   Tue Nov 26 18:06:30 2019 +0100
Branches: temp-sybren-usd-patch-01
https://developer.blender.org/rB8d84089855335ad5d4e9b0638e4afbd0d2907fb7

USD: replace check_is_transform_animated() with BKE_object_moves_in_time()

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

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

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

diff --git a/source/blender/usd/intern/usd_writer_transform.cc b/source/blender/usd/intern/usd_writer_transform.cc
index 91ca889568e..ec0241083c5 100644
--- a/source/blender/usd/intern/usd_writer_transform.cc
+++ b/source/blender/usd/intern/usd_writer_transform.cc
@@ -23,7 +23,7 @@
 #include <pxr/usd/usdGeom/xform.h>
 
 extern "C" {
-#include "BKE_animsys.h"
+#include "BKE_object.h"
 
 #include "BLI_math_matrix.h"
 
@@ -48,27 +48,6 @@ void USDTransformWriter::do_write(HierarchyContext &context)
   xformOp_.Set(pxr::GfMatrix4d(parent_relative_matrix), get_export_time_code());
 }
 
-static bool check_is_transform_animated(Object *object, bool recurse_parent)
-{
-  AnimData *adt = BKE_animdata_from_id(&object->id);
-  /* 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 (object->constraints.first != nullptr) {
-    return true;
-  }
-
-  if (recurse_parent && object->parent != nullptr) {
-    return check_is_transform_animated(object->parent, recurse_parent);
-  }
-
-  return false;
-}
-
 bool USDTransformWriter::check_is_animated(const HierarchyContext &context) const
 {
   if (context.duplicator != NULL) {
@@ -77,5 +56,5 @@ bool USDTransformWriter::check_is_animated(const HierarchyContext &context) cons
      * depsgraph whether this object instance has a time source. */
     return true;
   }
-  return check_is_transform_animated(context.object, context.animation_check_include_parent);
+  return BKE_object_moves_in_time(context.object, context.animation_check_include_parent);
 }



More information about the Bf-blender-cvs mailing list