custom_attributes
default_custom_attributes_definition()
Default custom attribute definitions created in ftracl.
Todos
Convert to list of dictionaries to be able determine order. Check if ftrack api support to define order first!
Returns:
Type | Description |
---|---|
dict[str, Any]: Custom attribute configurations per entity type that can be used to create/update custom attributes. |
Source code in client/ayon_ftrack/common/custom_attributes.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 |
|
ensure_custom_attribute_group_exists(session, group, groups=None)
Ensure custom attribute group in ftrack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session | Session | Connected ftrack session. | required |
group | str | Name of group. | required |
groups | Optional[List[Entity]] | Pre-fetched custom attribute groups. | None |
Returns:
Name | Type | Description |
---|---|---|
FtrackEntity | Entity | Created custom attribute group. |
Source code in client/ayon_ftrack/common/custom_attributes.py
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
|
ensure_mandatory_custom_attributes_exists(session, addon_settings, attr_confs=None, custom_attribute_types=None, groups=None, security_roles=None)
Make sure that mandatory custom attributes exists in ftrack.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session | Session | Connected ftrack session. | required |
addon_settings | Dict[str, Any] | Addon settings. | required |
attr_confs | Optional[List[Entity]] | Pre-fetched all existing custom attribute configurations in ftrack. | None |
custom_attribute_types | Optional[List[Entity]] | Pre-fetched custom attribute types. | None |
groups | Optional[List[Entity]] | Pre-fetched custom attribute groups. | None |
security_roles | Optional[List[Entity]] | Pre-fetched security roles. | None |
Source code in client/ayon_ftrack/common/custom_attributes.py
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
|
get_all_attr_configs(session, fields=None)
Query custom attribute configurations from ftrack server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session | Session | Connected ftrack session. | required |
fields | Optional[Iterable[str]] | Field to query for attribute configurations. | None |
Returns:
Type | Description |
---|---|
List[Entity] | List[FtrackEntity]: ftrack custom attributes. |
Source code in client/ayon_ftrack/common/custom_attributes.py
112 113 114 115 116 117 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 145 146 147 |
|
get_custom_attributes_by_entity_id(session, entity_ids, attr_configs, skip_none_values=True, store_by_key=True)
Query custom attribute values and store their value by entity and attr.
There is option to return values by attribute key or attribute id. In case the output should be stored by key and there is hierarchical attribute with same key as non-hierarchical it's then hierarchical value has priority of usage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session | Session | Connected ftrack session. | required |
entity_ids | Iterable[str] | Entity ids for which custom attribute values should be returned. | required |
attr_configs | Custom attribute configurations. | required | |
skip_none_values | bool | Custom attribute with value set to 'None' won't be in output. | True |
store_by_key | bool | Output will be stored by attribute keys if true otherwise is value stored by attribute id. | True |
Returns:
Type | Description |
---|---|
Dict[str, Dict[str, Any]]: Custom attribute values by entity id. |
Source code in client/ayon_ftrack/common/custom_attributes.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
|
get_custom_attributes_mapping(session, addon_settings, attr_confs=None, ayon_attributes=None)
Query custom attribute configurations from ftrack server.
Returns:
Type | Description |
---|---|
CustomAttributesMapping | Dict[str, List[object]]: ftrack custom attributes. |
Source code in client/ayon_ftrack/common/custom_attributes.py
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 197 198 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 240 241 242 |
|
query_custom_attribute_values(session, attr_ids, entity_ids)
Query custom attribute values from ftrack database.
Using ftrack call method result may differ based on used table name and version of ftrack server.
For hierarchical attributes you shou always use only_set_values=True
otherwise result will be default value of custom attribute and it would not be possible to differentiate if value is set on entity or default value is used.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session | Session | Connected ftrack session. | required |
attr_ids | Iterable[str] | Attribute configuration ids. | required |
entity_ids | Iterable[str] | Entity ids for which are values queried. | required |
Returns:
Type | Description |
---|---|
List[Dict[str, Any]]: Results from server. |
Source code in client/ayon_ftrack/common/custom_attributes.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
|