Using the loader to import multiple items at once

Hi,

I’d like to provide an easy way for Nuke artists to load all the plates related to a particular shot in Nuke. I haven’t tried yet, but I’m sure I could make a tab in the loader filtering only the published ‘plates’.

I’m however wondering if it would be possible to have a single item representing all the published plates (published from Hiero). Can multiple items be combined in a single item with an single action ?

Regards

Donat

I don’t really know, it is probably possible, but I found the loader to not be easily customizable, you might be better off building a separate thing.

2 Likes

Yes, you can definitely achieve this and we’ve done something similar in our Studio.

The idea behind the Loader is simply to link a publish file type to a action:

For example, in Nuke:
for an image sequence previously published as a plate with publish file type: Plate

In tk-multi-loader2.yml, you should have a block that set the behaviour of the Loader in Nuke engine and define what python methods will be called depending on the the published file type:

# nuke
settings.tk-multi-loader2.nuke:
  actions_hook: "{self}/tk-nuke_actions.py:{config}/tk-multi-loader2/tk-nuke_custom_actions.py"
  action_mappings:
    Plate: [read_node]
    Nuke Script: [script_import]

read_node is the default action in Nuke.

You can link multiple actions for a single Published file type. Those actions should be defined in the specified hook: {config}/tk-multi-loader2/tk-nuke_custom_actions.py.
When multiple actions are defined, they will appear in a little dropdown menu.

# nuke
settings.tk-multi-loader2.nuke:
  actions_hook: "{self}/tk-nuke_actions.py:{config}/tk-multi-loader2/tk-nuke_custom_actions.py"
  action_mappings:
    Plate: [read_node, load_all_plates_for_shot]
    Nuke Script: [script_import]

And as long as your are in this python function, you can actually achieve anything you want: in this case, query all plates for the current shot and create the custom reads you want.

Hope this helps.
Cheers

Hi @Kevin_Lmr

Thanks for the explanation. I have being programming custom actions for the loader and it works. My question was about having multiple items being sort of ‘merged’ into a single item.

Imagine three plates have been published from Hiero for a shot (e.g. main, reference, cleanplate), I would like to have a single element being shown in the loader, e.g. “All plates”.

This would make it a bit easier for the artist, they would have just to find this single merged element and click only once on a action button

Yes, I understood your question.

If you are already using a custom action for the main item, you could just simply extend it:
In your custom action hooks, query SG for the published files and create the required Read nodes.

So your plate item will have multiple actions:

  • single read import
  • import all plates
1 Like

Another approach would be to to group publishes together and execute the action on that. The idea would be to add an extra field to the published files called “child publishes” (or something similar). In there you collect all the published files you want to group together. So for example on ingest you would create 3 published files for the plates, plus another one called “plates” which has all the plates linked in the child publishes and has a publish file type of “ingest plates” (or something else, take whatever name you prefer) .
What you can do than, is only showing the “ingest plates” in the Loader and add a custom action to it, that loads all the plates at once. It requires a bit of work to get going, but could be worth it.
Hope I could get the idea across. :slight_smile:

Cheers, Fabian

2 Likes

There are already fields for “upstream publishes” and “downstream publishes”, which can be used.
Importing multiple things with the loader is easy. My gripe is mainly that the interface cannot be customized easily, and you can only load the latest version, you cannot specify a version to load.

1 Like

You can specify a version though? If the Published files are in the same namespace and have a version number attached?

@mmoshev I opted for a new field, because “upstream/downstream publishes” can mean different things in different circumstances, but yes you can use that aswell :slight_smile: . Also you can load older versions in the Loader. You have to open the details pane on the right and get the older versions:


:slight_smile:

Oh yeah, you are right. I meant the breakdown app, which allows you to update previously imported assets - it can only update to the latest version. But I guess using the loader for that is fine :person_shrugging:

1 Like

@mmoshev we switched to the relatively new tk-multi-breakdown2 app. It allows you to update to any version.

Oh nice, we should give it another try I guess, though we went down a very different path with Houdini already, with everything (including search parameters) captured in the node graph.