跳到內容

Asset from Smart Folder

Asset from Smart Folder 可用於引用 Smart Folder 中包含的資源(圖片、影片、音訊等)。參見 Image Smart FolderAudio Smart Folder

Mode - 選擇引用資源的方式:

  • Path - 透過檔案名稱/檔案路徑引用資源。
  • Auto Index - 透過 index 引用資源。這在 Duplicator 中使用 Smart Folder 時很有用。Smart Folder 按字母順序排列,因此將模式設為 Auto Index 將按相同順序輸出資源。
  • Specific Index - 設定要輸出的 Smart Folder 中的特定索引。可以設定值或連接 Behaviour 以向每個 context 傳遞不同的索引。

Smart Folder Asset - 將來自 Assets WindowImage Smart FolderAudio Smart Folder 連接到此屬性。

Path - 輸入檔名,或連接一個包含 Smart Folder 中資源檔名的 Spreadsheet 或 Array。

Index - 設定特定索引或連接一個 Behaviour。

Count - 一個唯讀屬性,返回在 Image Smart FolderAudio Smart Folder 中找到的資源數量。注意,Smart Folder 限制為最大深度 5 個目錄

Out Path - 一個唯讀屬性,可用於輸出資源的 Path。當 Mode 設為 Specific Index 時,可用於連接到 Render Queue ItemFile Name

可以透過將 Out Path 連接到 String,然後使用 Replace String 來編輯檔案路徑。例如:

要移除 .png 副檔名:

  • Replace 設為 .png
  • With 留空。

要將 / 替換為 -

  • Replace 設為 /
  • With 設為 -

然後可以將 String 連接到 Text Shape 作為「標籤」,或連接到 Render Queue ItemFile Name 以在任何渲染中引用圖片名稱。

右鍵點擊 Assets Window 中的 Smart Folder,選擇 View File Paths… 以預覽資源的索引。

  1. 匯入一個包含檔案 apple.pngorange.pngbanana.pngSmart Folder
  2. 將該 Smart FolderAssets Window 拖入 Attribute Editor 或 Viewport。
  3. 建立一個 String Array
  4. 使用 Button iconAdd 按鈕加入另外兩個索引,並分別輸入 apple.pngorange.pngbanana.png
  5. String Array 連接到 Asset from Smart FolderPath 屬性。
  6. 取消勾選 String ArrayAuto Index,並在 Index 中輸入 1

圖片應從蘋果變為橙子。

嘗試將 String Array 替換為 Spreadsheet,並將 Render ManagerDynamic Index 連接到其 Index