TouchDesigner AbsTime 教學:掌握 frame、seconds、step 與 stepSeconds 用法

深入解析 TouchDesigner 的 AbsTime 類別,了解 frame、seconds、step、stepSeconds 四個成員的用途與計算方式,掌握絕對時間的核心概念,提升互動內容同步與效能設計能力。

Mar 21, 2020
我們開課囉!
本月開設課程 TD101 (TouchDesigner 101 - Intro, TD 入門介紹) 以及 IAI-01 (AI 工作坊 - StreamDiffusionTD 入門操作),歡迎報名參加~

⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑
 
根據 TouchDesigner 官方 Wiki 的說法,AbsTime 代表「絕對時間」,即自 TouchDesigner 啟動以來所經過的時間。
當您開啟 TouchDesigner 時,它會持續運行直到您關閉它為止。而且您無法再控制它。AbsTime 是一個唯讀(Read Only)的類別。

AbsTime 類別的成員

它包含四個成員:
  • frame
  • seconds
  • step
  • stepSeconds
讓我們逐一探索它們。

1. frame

AbsTime.seconds
frame會顯示自 TouchDesigner 啟動以來所播放的總幀數。您可以看到圖片中,frame的值不斷增加。
notion image

2. seconds

AbsTime.seconds
seconds會顯示自 TouchDesigner 啟動以來所經過的總秒數。
notion image
同樣地,seconds的值也在不斷增加,但它比frame的值要小。原因是在預設設置中,FPS(每秒幀數)為 60。您可以在介面底部找到該資訊。
notion image
notion image

3. step & 4. stepSeconds

AbsTime.step AbsTime.stepSeconds
讓我們將 step 和 stepSeconds 放在一起討論。
根據 Wiki 的定義:
step是從前一幀開始到當前幀開始所經過的絕對幀數。
stepSeconds是從前一幀開始到當前幀開始所經過的絕對時間(以秒為單位)。
notion image
在圖片中,step為 1,stepSeconds為 0.01667。
我們可以手動計算 stepSeconds:FPS 為 60,這意味著每秒播放 60 幀。
1 / 60 = 0.016666666666667
是的,這正是我們所預期的。
因此,您可以這樣做,它們幾乎是相同的:
absTime.frame * absTime.stepSeconds
notion image
stepstepSeconds看起來像是常數。這對我們來說是一件好事,您絕對不希望看到它像使用舊電腦玩線上 FPS 遊戲一樣。
 
Refer
⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑⭑
Luxmin Institute 互動研究院 策劃了一系列關於互動體驗技術、科技藝術與多媒體整合為核心的主題課程、工作坊、社群、聚會,以及 TXRX 互動體驗大會
關注我們最新的活動動態與報名資訊:https://www.threads.com/@luxmin.institute