Adding Asset Folders#
This example plugin creates additional folders in the asset folder, when an asset gets created.
These folders are created by default: “Export”, “Playblasts”, “Renders” and “Scenefiles” and with this plugin additional folders for “Audio” and “Reference” are added.
See the section for Single File Plugins on how to load this example.
# AddAssetFolders.py name = "AddAssetFolders" classname = "AddAssetFolders" import os from qtpy.QtWidgets import * class AddAssetFolders: def __init__(self, core): self.core = core self.version = "v1.0.0" # register onAssetCreated callback self.core.registerCallback("onAssetCreated", self.onAssetCreated, plugin=self) def onAssetCreated(self, origin, entity, dlg): # get folderpath from created asset asset_path = self.core.getEntityPath(entity=entity) # define additional folder names additional_folders = ["Audio", "References"] # create folders for folder in additional_folders: path = os.path.join(asset_path, folder) if not os.path.exists(path): os.makedirs(path)