Skip to main content

Asset from Smart Folder

Pro Feature

Pro features are only available with a Professional licence. To upgrade, visit cavalry.scenegroup.co.

Intro

The Asset from Smart Folder can be used to reference assets (images, videos, audio etc) contained within a Smart Folder. See Image Smart Folder or Audio Smart Folder.

UI

Mode - Choose how to reference the assets:

  • Path - Reference assets via their file name/filepath.
  • Auto Index - Reference assets via their index. This is useful for using Smart Folders in a Duplicator. Smart Folders are ordered alphabetically so setting the mode to Auto Index will output the assets in the same order.
  • Specific Index - Set a specific index within a Smart Folder to output. Either set a value or connect a Behaviour to pass different indices to each context.

Smart Folder Asset - Connect an Image Smart Folder or Audio Smart Folder from the Assets Window to this attribute.

Path - Enter a filename, or connect a Spreadsheet or Array that includes the filenames of the assets contained within the Smart Folder.

Index - Set an specific index or connect a Behaviour.

Count - A read only attribute that returns the number of assets found within an Image Smart Folder or Audio Smart Folder. Note that Smart Folders are limited to a maximum depth of 5 directories.

Out Path - A read only attribute that can be used to output the Path of an asset. This can be used to connect to a Render Queue Item's File Name when Mode is set to Specific Index.

Manipulate Paths

File paths can be edited by connecting the Out Path to a String and then using a Replace String. For example:

To remove a .png file extension:

  • Set Replace to .png.
  • Leave With empty.

To replace a / with -:

  • Set Replace to /.
  • Set With -.

The String can then be connected to Text Shape as a 'label' or a Render Queue Item's File Name to reference the name of the image in any renders.

File Paths

Right click on a Smart Folder in the Assets Window and choose View File Paths... to preview an asset's index.

Example
  1. Import a Smart Folder containing the files apple.png, orange.png and banana.png.
  2. Drag that Smart Folder from the Assets Window into the Attribute Editor or Viewport.
  3. Create an String Array.
  4. Add two more indices using the
    Button iconAdd
    button and enter apple.png, orange.png and banana.png into each.
  5. Connect the String Array to the Asset from Smart Folder's Path attribute.
  6. Uncheck Auto Index on the String Array and enter 1 into the Index.

The image should change from an apple to an orange.

Try swapping the String Array for a Spreadsheet and connecting the Render Manager's Dynamic Index to its Index.