template_data
get_folder_template_data(folder_entity, project_name)
Extract data from folder entity that are used in templates.
Output dictionary contains keys: - 'folder' - dictionary with 'name' key filled with folder name - 'asset' - folder name - 'hierarchy' - parent folder names joined with '/' - 'parent' - direct parent name, project name used if is under project
Required entity fields
Folder: 'path', 'folderType'
Parameters:
Name | Type | Description | Default |
---|---|---|---|
folder_entity | Dict[str, Any] | Folder entity. | required |
project_name | str | Is used for 'parent' key if folder entity does not have any. | required |
Returns:
Type | Description |
---|---|
Dict[str, str]: Data that are based on folder entity and can be used in templates. |
Source code in client/ayon_core/pipeline/template_data.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
get_general_template_data(settings=None, username=None)
General template data based on system settings or machine.
Output contains formatting keys: - 'studio[name]' - Studio name filled from system settings - 'studio[code]' - Studio code filled from system settings - 'user' - User's name using 'get_ayon_username'
Parameters:
Name | Type | Description | Default |
---|---|---|---|
settings | Dict[str, Any] | Studio or project settings. | None |
username | Optional[str] | AYON Username. | None |
Source code in client/ayon_core/pipeline/template_data.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
get_project_template_data(project_entity=None, project_name=None)
Extract data from project document that are used in templates.
Project document must have 'name' and 'code'.
One of 'project_name' or 'project_entity' must be passed. With prepared project document is function much faster because don't have to query.
Output contains formatting keys: - 'project[name]' - Project name - 'project[code]' - Project code
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_entity | Dict[str, Any] | Queried project entity. | None |
project_name | str | Name of project. | None |
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, str]]: Template data based on project document. |
Source code in client/ayon_core/pipeline/template_data.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
get_task_template_data(project_entity, task_entity)
Prepare task template data.
Required document fields
Project: 'tasksTypes' Task: 'type'
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_entity | Dict[str, Any] | Project entity. | required |
task_entity | Dict[str, Any] | Task entity. | required |
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, str]]: Template data |
Source code in client/ayon_core/pipeline/template_data.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
get_template_data(project_entity, folder_entity=None, task_entity=None, host_name=None, settings=None, username=None)
Prepare data for templates filling from entered documents and info.
This function does not "auto fill" any values except system settings and it's on purpose.
Universal function to receive template data from passed arguments. Only required argument is project document all other arguments are optional and their values won't be added to template data if are not passed.
Required document fields
Project: 'name', 'code', 'taskTypes.name' Folder: 'name', 'path' Task: 'type'
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_entity | Dict[str, Any] | Project entity. | required |
folder_entity | Optional[Dict[str, Any]] | Folder entity. | None |
task_entity | Optional[Dict[str, Any] | Task entity. | None |
host_name | Optional[str] | Used to fill '{app}' key. | None |
settings | Union[Dict, None] | Prepared studio or project settings. They're queried if not passed (may be slower). | None |
username | Optional[str] | AYON Username. | None |
Returns:
Type | Description |
---|---|
Dict[str, Any]: Data prepared for filling workdir template. |
Source code in client/ayon_core/pipeline/template_data.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 |
|
get_template_data_with_names(project_name, folder_path=None, task_name=None, host_name=None, settings=None)
Prepare data for templates filling from entered entity names and info.
Copy of 'get_template_data' but based on entity names instead of documents. Only difference is that documents are queried.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project_name | str | Project name. | required |
folder_path | Optional[str] | Folder path. | None |
task_name | Optional[str] | Task name. | None |
host_name | Optional[str] | Used to fill '{app}' key. because workdir template may contain | None |
settings | Optional[Dict] | Prepared studio or project settings. They're queried if not passed. | None |
Returns:
Type | Description |
---|---|
Dict[str, Any]: Data prepared for filling workdir template. |
Source code in client/ayon_core/pipeline/template_data.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
|