瀏覽代碼

allow unique naming of passed in names on LerpFuncIntervals

Joe Shochet 19 年之前
父節點
當前提交
2cf3938811
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      direct/src/interval/LerpInterval.py

+ 7 - 0
direct/src/interval/LerpInterval.py

@@ -622,6 +622,13 @@ class LerpFunctionInterval(Interval.Interval):
             name = ('LerpFunctionInterval-%d' %
                     LerpFunctionInterval.lerpFunctionIntervalNum)
             LerpFunctionInterval.lerpFunctionIntervalNum += 1
+        else:
+            # Allow the user to pass in a %d in the name and we'll go ahead
+            # and uniquify the name for them.
+            if "%d" in name:
+                name = name % LerpFunctionInterval.lerpFunctionIntervalNum
+                LerpFunctionInterval.lerpFunctionIntervalNum += 1
+            
         # Initialize superclass
         Interval.Interval.__init__(self, name, duration)