[Durian-svn] [3475] quick script to remove fcurve doubles

campbell institute at blender.org
Mon May 17 16:11:45 CEST 2010


Revision: 3475
          https://blenderinstitute.dyndns.org/durian-svn/?do=log&project=durian&path=/&rev=3475
Author:   campbell
Date:     2010-05-17 16:11:45 +0200 (Mon, 17 May 2010)
Log Message:
-----------
quick script to remove fcurve doubles

Added Paths:
-----------
    pro/scripts/utilities/action_rem_doubles.py

Added: pro/scripts/utilities/action_rem_doubles.py
===================================================================
--- pro/scripts/utilities/action_rem_doubles.py	                        (rev 0)
+++ pro/scripts/utilities/action_rem_doubles.py	2010-05-17 14:11:45 UTC (rev 3475)
@@ -0,0 +1,12 @@
+ACTION = "Action"
+THRESHOLD = 0.1
+for bpy.data.actions[ACTION] in act.fcurves:
+    i = len(fcu.keyframe_points) - 1
+    while i > 0:
+        pt = fcu.keyframe_points[i]
+        pt_prev = fcu.keyframe_points[i - 1]
+        if abs(pt_prev.co.x - pt.co.x) < THRESHOLD:
+            fcu.keyframe_points.remove(pt)
+            if i < len(fcu.keyframe_points):
+                continue
+        i -= 1
\ No newline at end of file



More information about the Durian-svn mailing list