Asset from Smart Folder
Asset from Smart Folder 可用於引用 Smart Folder 中包含的資源(圖片、影片、音訊等)。參見 Image Smart Folder 或 Audio Smart Folder。
Mode - 選擇引用資源的方式:
- Path - 透過檔案名稱/檔案路徑引用資源。
- Auto Index - 透過
index引用資源。這在 Duplicator 中使用 Smart Folder 時很有用。Smart Folder 按字母順序排列,因此將模式設為 Auto Index 將按相同順序輸出資源。 - Specific Index - 設定要輸出的 Smart Folder 中的特定索引。可以設定值或連接 Behaviour 以向每個 context 傳遞不同的索引。
Smart Folder Asset - 將來自 Assets Window 的 Image Smart Folder 或 Audio Smart Folder 連接到此屬性。
Path - 輸入檔名,或連接一個包含 Smart Folder 中資源檔名的 Spreadsheet 或 Array。
Index - 設定特定索引或連接一個 Behaviour。
Count - 一個唯讀屬性,返回在 Image Smart Folder 或 Audio Smart Folder 中找到的資源數量。注意,Smart Folder 限制為最大深度 5 個目錄。
Out Path - 一個唯讀屬性,可用於輸出資源的 Path。當 Mode 設為 Specific Index 時,可用於連接到 Render Queue Item 的 File Name。
可以透過將 Out Path 連接到 String,然後使用 Replace String 來編輯檔案路徑。例如:
要移除 .png 副檔名:
- 將 Replace 設為
.png。 - 將 With 留空。
要將 / 替換為 -:
- 將 Replace 設為
/。 - 將 With 設為
-。
然後可以將 String 連接到 Text Shape 作為「標籤」,或連接到 Render Queue Item 的 File Name 以在任何渲染中引用圖片名稱。
右鍵點擊 Assets Window 中的 Smart Folder,選擇 View File Paths… 以預覽資源的索引。
- 匯入一個包含檔案
apple.png、orange.png和banana.png的 Smart Folder。 - 將該 Smart Folder 從 Assets Window 拖入 Attribute Editor 或 Viewport。
- 建立一個 String Array。
- 使用
Add 按鈕加入另外兩個索引,並分別輸入
apple.png、orange.png和banana.png。 - 將 String Array 連接到 Asset from Smart Folder 的 Path 屬性。
- 取消勾選 String Array 的 Auto Index,並在 Index 中輸入
1。
圖片應從蘋果變為橙子。
嘗試將 String Array 替換為 Spreadsheet,並將 Render Manager 的 Dynamic Index 連接到其 Index。