1

How to set up loader to load secondary publish files in Maya

Hi guys,

Am trying to work out the best way to display and load secondary publishes in the loader. I've followed the Alembic example and successfully used this to set up some secondary publishes namely: clean maya scene, Alembic and V-Ray Proxy. A simple step-by-step would be great as I've been pouring over the relevant docs and still am completely lost. I need to know:

How to see secondaries in the loader
Where to add the code to load each file type
Any Yaml config files that need to be modified to make the above work

Thanks
Dylan

4 comments

  • 1
    Avatar
    Ryan Mayeda

    Hi Dylan.

    Thanks for pointing this out, we should really update our Alembic example doc to also cover the Loader!  I'll do a quick reply here so you're not held up and then polish it up for docs purposes.  Let's go through your questions...

    How to see secondaries in the Loader?

    The Loader configuration uses the Published File Type in Shotgun to determine what kinds of things it should display.  You can customize this by opening up your environment configuration (ex. config/eng/shot_step.yml).  The part to update is the 'action_mappings' section.  Below is the default Maya Loader configuration with two extra lines (in bold) as an example of how you might do it (your actual Published File Type names may vary):

    tk-multi-loader2:
      action_mappings:
        Alembic Cache [reference, alembic_import]
        Maya Scene: [reference, import]
        Photoshop Image: [texture_node]
        Rendered Image: [texture_node]
        Vray Proxy: [reference]
      actions_hook: '{self}/tk-maya_actions.py'
      download_thumbnails: true
      entities:
      - caption: Assets
        entity_type: Asset
        filters:
        - [project, is, '{context.project}']
        hierarchy: [sg_asset_type, code]
      - caption: Shots
        entity_type: Shot
        filters:
        - [project, is, '{context.project}']
        hierarchy: [sg_sequence, code]
      - caption: My Tasks
        entity_type: Task
        filters:
        - [task_assignees, is, '{context.user}']
        - [project, is, '{context.project}']
        hierarchy: [entity, content]
      filter_publishes_hook: '{self}/filter_publishes.py'
      location: {name: tk-multi-loader2, type: app_store, version: v1.1.1}
      menu_name: Load
      publish_filters: []
      title_name: Loader

    Where to add the code to load each file type?

    If you just want to use regular Maya referencing, the 'reference' action in our hook might be ok (it's been a while since I've had to deal with Vray Proxies so I can't remember if they work with Maya referencing).  But, in the example, I also included an extra action for Alembic cache called 'alembic_import' rather than reference.  To customize the load behavior, you'll want to override the tk-maya_actions.py hook.

    To add another action, like say 'alembic_import', you can add it in a corresponding way to the default ones here (hopefully it's pretty self-explanatory):

    https://github.com/shotgunsoftware/tk-multi-loader2/blob/master/hooks/tk-maya_actions.py

    Note that the action you define in the hook should define the action that you specify on a per-Published-File-Type basis in your environment configuration (see above).

    From there, follow these directions to override the hook:

    https://support.shotgunsoftware.com/entries/95442818

    Any Yaml config files that need to be modified to make the above work?

    Yes, any environment that you want the Loader to appear in with these load options (ex. config/env/shot_step.yml above) will need to be modified.  Those are the only yml files that need to be modified.  If you want to add to or change the default load actions, you will also need to override the hook (a Python script) as well.

    Hope this helps!

    Ryan.

  • 0
    Avatar
    Dylan Neill

    That's great info. Thanks Ryan. Have got it all working now.

  • 0
    Avatar
    Ryan Mayeda

    Glad to hear it!

  • 0
    Avatar
    Marius

    Hi guys,

    Dylan wrote: 

    I've followed the Alembic example and successfully used this to set up some secondary publishes namely: clean maya scene, Alembic and V-Ray Proxy

    Could you write step by step tutorial how to set working secondary publishes for V-Ray Proxy using toolkit in Maya?

    Thanks

    Marius

Please sign in to leave a comment.