nukescripts.cattery

This module is in charge of discovery and populating the cattery toolbar.

Although it might seem a simple problem at first sight, there are wrinkles regarding model compatibility to take into account.

When authoring a cat-file/ML-model within Nuke, we guarantee it to be forward compatible, this is to say it will work on future versions of nuke.

It doesn’t work the other way around though! There might be specific features that the model depends on that are not present on older versions of Nuke, making it non-backward compatible.

This module provides a simple mechanism to discover models in the Cattery that are compatible with the current version of nuke by describing the model on a cat.json file describing all the metadata necessary.

i.e.

``` . └── Cattery

├── modelA │ ├── cat.json # minimum_nuke_version_required = 13.1 │ ├── modelA.cat │ └── modelA.gizmo ├── modelB │ ├── cat.json # minimum_nuke_version_required = 14.0 │ ├── modelB.cat │ └── modelB.gizmo └─── modelD

├── cat.json # minimum_nuke_version_required = 15.0 ├── modelC.cat └── modelC.gizmo

```

Here an example of what is the expected result of filtering the models at runtime on the many versions of Nuke.

  • Nuke 13.1 sees modelA

  • Nuke 13.2 sees modelA

  • Nuke 14 sees modelA and modelB

  • Nuke 14.1 sees modelA and modelB

  • Nuke 15 sees modelA, modelB and modelC

Functions

create_menu

discover_packages

find_repositories

normalise_path_for_nuke

Nuke uses forward slash on all platforms, including Windows (which is odd and unconventional), this method encapsulates that.

populate_menu

register_cats

Classes

CatInfo

PackageInfo