Volumes are used to store large asset files to keep the Docker images for channels small, which translates to faster startup times for the channel. Volumes are specified in a Package using the package.yml file. The below package.yml file is from the example package in the example channel.

  example: 'e66b164e-8796-48aa-8597-636d85bec240'

    filename: example:YoYo.blend
    filename: example:BubbleBottle.blend
    filename: example:Skateboard.blend
    filename: example:Cube.blend
  Light Wooden Box:
    filename: example:Containers/LightWoodenBox.blend

When specifying a volume, you must use a key, value pair where the key is a unique name used locally for the volume and the value is the Volume ID on the platform. Volume ID’s are generated when the volume is created via anatools' create_managed_volume(name, organizationId) SDK call or through the web interface. See the anatools SDK documentation or for more details on creating and volumes.

Files are referenced from the volume using the get_volume_path(package, rel_path) function where package parameter is the name of the package, i.e. “example”, and the rel_path is the volume:pathinvolume. To get the file path for the blender file containing the Yoyo object this call would be get_volume_path('example', 'example:LowPoly.blend'). Anatools has a helper functions for creating object generators from blender files, this is an example of loading the YoYo object from the blender file and wrapping it in a YoYoObject class: get_blendfile_generator("example", YoyoObject, "YoYo").

Volumes can be mounted during local development using the anamount command. Calling anamount from the workspace directory of the development container will mount the package volumes in the workspace directory at “data/volumes/<volume-id>”, but only if the user has read or write permissions to the volume. For an example of how to mount and develop with a volume locally, review the Add a Generator Node tutorial where we create a new volume then add a Blender file to it.