0

How to get publish to pick up renders from 3dsmax?

Heya Folks!

I'm just getting shotgun and tank set up in our studio and it's been pretty okay so far in terms of getting file names and directories correct but I don't seem to get the option to publish my renders from 3dsmax. In my previous studio publish had secondary options to take render passes out of maya when you were publishing your scene file which would in turn notify compositors - is this default functionality that's just missing in the 3dsmax publish or was it something that the previous company had to add themselves?

 

Cheers!

 

John

4 comments

  • 0
    Avatar
    KP

    Hey John,

    The Multi-Publish app ships with a single default primary publish hook for 3dsmax which saves the scene file, publishes it to Shotgun, and then versions up the scene (making a copy of it as well). In order to do any secondary tasks, you can modify the default secondary publish hooks to do what you want to do. Check out the docs for Multi-Publish which give you an overview of how the app incorporates hooks for pre-publish, publish, and post-publish tasks for both primary and secondary publishes. 

    Then take a look at our example for publishing Alembic files from Maya which walks you through the process of adding secondary publish outputs. 

    Hopefully this will put you on the path to what you want. 

    Because each studio's pipeline is so unique, we haven't included this by default in the app or default config as it probably wouldn't work "out of the box" for anyone and that's what we aim for with our default stuff. Do you think some sort of simplistic version of it should be included? Perhaps we should at the very least add another basic example for how to do this in our example sections like we have for the Alembic files? 

  • 0
    Avatar
    John O'Connell

    Hmm - I reckon there could be a few defaults as a minimum alright. 3d applications are either going to publish scene files, export geometry, export caches or send on rendered images to comp. Pretty much any studio is going to deal with animation or rendering so they'd be nice out of the box additions!

    Thanks for the leads, I'm still getting my head around tank at the minute in terms of how the various apps install into a project. At the minute I'm only using the 3dsmax and nuke engines so I've a bit to learn about how they make copies of the various files to allow customization - is it a case of them loading them from the main shotgun config folders if there isn't a local version of them in your project specific config folders?

  • 0
    Avatar
    John O'Connell

    Right!

    So I've followed the alembic template and I'm getting a few weird things happening which hopefully you can clear up.

    Here's my amended scan scene hook file called "render_scan_scene_tk_3dsmax.py":

    ===========================================================

     

    items = []

    # get the main scene:
    if not mxs.maxFileName:
    raise TankError("Please Save your file before Publishing")

    # create the primary item - 'type' should match the 'primary_scene_item_type':
    items.append({"type": "work_file", "name": mxs.maxFileName})

    # Junk to get the render files too
    items.append({"type":"render_file", "name":mxs.rendoutputfilename})

    # Get access to render elements
    re = mxs.maxOps.GetCurRenderElementMgr()

    # Get the Count of elements
    elementCount = re.NumRenderElements()
    # print elementCount
    # print mxs.re.GetRenderElementFilename(1)

    # Get the name of the output files in the render outputs
    for e in range(0, elementCount):
    print mxs.re.GetRenderElementFilename(e)
    items.append({"type":"render_file", "name":mxs.re.GetRenderElementFilename(e)})
    # print items

    return items

    ===========================================================

    And my new entry for this in shot_step.yml:

    ===========================================================

     

    tk-multi-publish-Render-Sequences:
    allow_taskless_publishes: true
    display_name: Publish with render files
    expand_single_items: false
    hook_copy_file: default
    hook_post_publish: default
    hook_primary_pre_publish: default
    hook_primary_publish: default
    hook_scan_scene: render_scan_scene_tk-3dsmax
    hook_secondary_pre_publish: default
    hook_secondary_publish: default
    hook_thumbnail: default
    location: {name: tk-multi-publish, type: app_store, version: v0.4.3}
    primary_description: Publish and version up the current 3ds Max scene
    primary_display_name: 3ds Max Publish
    primary_icon: icons/publish_3dsmax_main.png
    primary_publish_template: max_shot_publish
    primary_scene_item_type: work_file
    primary_tank_type: 3dsmax Scene
    secondary_outputs:
    description: 'Publish render sequences from 3dsmax'
    display_group: Renders
    display_name: 3dsmax Render
    icon: 'icons/alembic_output.png'
    name: 3dsmax_render
    publish_template: 3dsmax_shot_render_sequences
    required: false
    scene_item_type: render_file
    selected: false
    tank_type: 3dsmax Render
    template_work: max_shot_work

    ===========================================================

     

    So what's happening is if I use the above with the secondary outputs defined, I won't get my new publish with render files option in current apps in 3dsmax. When I initially copied it from the alembic publish tutorial, I left in the "- " at the line just under secondary outputs but what I got was a launch error from the "launch 3dsmax" command in the shotgun web ui - it was erroring about expecting a code block and getting "-" instead. I presume that this means either the secondary output code that I've used is invalid so shotgun is simply removing it from 3dsmax so we can get on with things, either that or It's working fine but one of the entries or types that I've defined in there is missing from another configuration file and again shotgun doesn't know how to deal with it?

     

    In my templates.yml I've used:

    =======================================================================

    render_file:
        type: str

    and 

    3dsmax_shot_render_sequences: '@shot_root/work/3dsmax/{Shot}_{Step}_{name}_v{version}/{Shot}_{Step}_{name}_v{version}.exr'

    =======================================================================

    The output path in the templates.yml is a bit arbitrary at the minute but hopefully that isn't throwing too many spanners in the works. Any pointers as to what it is that's causing my new multi publish entry to drop out when the secondary output is being added?

    Cheers!

  • 0
    Avatar
    KP

    Hey John,

    It looks like the secondary_outputs key is still missing a value. This variable is required to be a list so if you want it to be empty, you should define it with an empty list like so:

    secondary_outputs: [] 

    If you look closely at the python output in Max you would probably see an error saying something like:

    Error: Shotgun: App configuration Error for tk-multi-publish. It will not be loaded: Invalid type for value in setting 'secondary_outputs' for 'tk-multi-publish' - found 'NoneType', expected 'list'

    But sometimes this can get buried in the log output especially if you have debug logging on.

    Let me know if that helps! 

Please sign in to leave a comment.