0

Nuke submit still image to Screening Room

Hi support team!

 

In our studio we work with still images as much as we do with small animations. We have been using the screening room to review our animation shots, and we would like to use it to review still images too.

Currently it seems that only Photoshop does that (as a primary publish), but since we use Nuke much more often then Photoshop it would be really useful to have this ability.

I have started to change the shot_step.yml the have this feature as a secondary secondary_output (as you can see attached image), but besides the addition in the UI i am not sure what do do next. 

Any help will be very welcome

All the best

Bruno

 




Still_Image.jpg

6 comments

  • 0
    Avatar
    Bruno Guerreiro

    Forgot the add that i have have in nuke a specific toolkit write node for jpeg (small size, easy to upload). And i also took a deep look (actually put it to work) on David van Heeswijk questions on how to add a secondary publish in nuke for the alexa footage (here: https://support.shotgunsoftware.com/entries/95443457 but i am still not able to understand how to upload an image instead of the QuickTime.

  • 0
    Avatar
    Manne Öhrström

    Hello Bruno!

    That looks really cool! 

    I think you can cut and paste some of the photoshop code that does this - it is a bit of a reshuffle but hopefully not crazy complicated!

    Here's the code in photoshop that creates a version and uploads a single frame: https://github.com/shotgunsoftware/tk-multi-publish/blob/master/hooks/primary_publish.py#L671

    For the shotgun write node, you can get a list of associated files by running this api method on the write node app instance object: https://github.com/shotgunsoftware/tk-nuke-writenode/blob/master/app.py#L120

    And you can get the shotgun write node app instance by running self.parent.engine.apps["tk-multi-writenode"] from within the multi publish hook!

    Do you think that gives you enough pieces to get going? If you need more detailed help, let us know and we'll be happy to set up a small example!! 

     

  • 0
    Avatar
    Bruno Guerreiro

    Hi Manne,

    What you described seems to be exactly what i am trying to do! Use the secondary publish to upload an image (jpg) already generated trough the shotgun write node. Unfortunately i could not figure out how put the pieces that you referenced together.

     

    A small example or step-by-step explanation will be very welcomed!

     

  • 0
    Avatar
    Bruno Guerreiro

    Hi Manne,

    I have been trying to figure this out for a while with no success! Is there any change that you could elaborate on how you think this could be done?

    Thank you

  • 0
    Avatar
    Manne Öhrström

    Hello!

    I am following up on older forum posts and I realised I hadn't replied to this one. So very sorry!

    I thought however this may be a good time to follow up - we just released Shotgun 5.4 which contains much improved workflows for still images in review.

    Here's a step by step guide of what you need to add in order to get multi publish in nuke to be able to upload jpeg images to Shotgun for review:

    1. Add a jpeg write node to your configuration

    In the environment configuration for your tk-nuke-writenode, add a new output profile. Set up new templates to define where the files should go on disk. I created the following:

         write_nodes:
            - file_type: jpeg
              name: Jpeg Output
              proxy_publish_template: null
              proxy_render_template: null
              publish_template: nuke_shot_render_pub_jpeg
              render_template: nuke_shot_render_jpeg
              settings: {}
              tank_type: Rendered Image
              tile_color: []        

     2. Add a multi publish output for the single image

    Now find the nuke multi publish entry in the shot environment and add a new secondary output to the config:

            secondary_outputs:
            - {description: Copy renders from work area to publish area., display_group: Shotgun
                Write Nodes, display_name: Publish Renders, icon: icons/publish_nuke_writenode.png,
              name: render, publish_template: null, required: false, scene_item_type: write_node,
              selected: true, tank_type: Rendered Image}
            - {description: Create quicktime and send to Screening Room, display_group: Shotgun
                Write Nodes, display_name: Send to Screening Room, icon: icons/publish_nuke_review.png,
              name: quicktime, publish_template: null, required: false, scene_item_type: write_node,
              selected: true, tank_type: Quicktime}
            - {description: Upload single image to Shotgun., display_group: Shotgun
                Write Nodes, display_name: Upload image to screening room, icon: icons/publish_nuke_review.png,
              name: single_image, publish_template: null, required: false, scene_item_type: write_node,
              selected: true, tank_type: unused }
    
    

    3. Customize the secondary pre publish hook

    Customize the secondary pre publish hook and add your new single_image output to the validation:

                elif output["name"] == "quicktime" or output["name"] == "single_image":
                    # Make sure a 'Publish Renders' task is checked.
                    if not self._get_render_task_for_task(tasks, task):
                        raise TankError("If you have the 'Send to Screening Room' box ticked, you "
                                        "must also have the 'Publish Renders' box ticked!")
                
    
    

    4. Add logic in the secondary publish hook to do the actual work

    Now add the code to handle our new single_image output.  

                    if output_name == "render":
                        # Publish the rendered output for a Shotgun Write Node
    
                        # each publish task is connected to a nuke write node
                        # this value was populated via the scan scene hook
                        write_node = task["item"].get("other_params", dict()).get("node")
                        if not write_node:
                            raise TankError("Could not determine nuke write node for item '%s'!" % str(task))
            
                        # publish write-node rendered sequence                
                        try:
                            (sg_publish, thumbnail_path) = self._publish_write_node_render(task, 
                                                                                           write_node, 
                                                                                           primary_publish_path, 
                                                                                           sg_task, 
                                                                                           comment, 
                                                                                           progress_cb)
                            
                            # keep track of our publish data so that we can pick it up later in review
                            render_publishes[ write_node.name() ] = (sg_publish, thumbnail_path)
                        except Exception, e:
                            errors.append("Publish failed - %s" % e)
        
                    elif output_name == "single_image":
                        # Publish the reviewable still image for a Shotgun Write Node
        
                        # each publish task is connected to a nuke write node
                        # this value was populated via the scan scene hook
                        write_node = task["item"].get("other_params", dict()).get("node")
                        if not write_node:
                            raise TankError("Could not determine nuke write node for item '%s'!" % str(task))
        
                        (sg_publish, thumbnail_path) = render_publishes[ write_node.name() ]
                        
                        # get the fields from the work file
                        render_path = self.__write_node_app.get_node_render_path(write_node)
                        render_template = self.__write_node_app.get_node_render_template(write_node)
                        render_path_fields = render_template.get_fields(render_path)
                                        
                        # get all paths for all frames and all eyes
                        paths = self.parent.sgtk.paths_from_template(render_template, 
                                                                     render_path_fields, 
                                                                     skip_keys = ["SEQ", "eye"])
                        
                        # look for the first frame we find
                        if len(paths) < 1:
                            raise TankError("Could not find any renders!")
                        
                        first_frame = paths[0]
                        
                        # now upload the version
                        
                        # get current shotgun user
                        current_user = sgtk.util.get_current_user(self.parent.sgtk)
                        
                        # create a name for the version based on the file name
                        # grab the file name, strip off extension
                        name = os.path.splitext(os.path.basename(first_frame))[0]
                        # do some replacements
                        name = name.replace("_", " ")
                        # and capitalize
                        name = name.capitalize()
                        
                        # Create the version in Shotgun
                        ctx = self.parent.context
                        data = {
                            "code": name,
                            "entity": ctx.entity,
                            "sg_task": ctx.task,
                            "sg_first_frame": 1,
                            "sg_last_frame": 1,
                            "frame_count": 1,
                            "frame_range": "1-1",
                            "sg_frames_have_slate": False,
                            "created_by": current_user,
                            "user": current_user,
                            "description": comment,
                            "sg_movie_has_slate": False,
                            "project": ctx.project,
                            "published_files": [sg_publish]
                        }
                
                        sg_version = self.parent.sgtk.shotgun.create("Version", data)
                        # and upload the actual image
                        self.parent.sgtk.shotgun.upload("Version", 
                                                        sg_version["id"], 
                                                        first_frame, 
                                                        "sg_uploaded_movie")                

    That's it!

    Now you should see a new option:

    Screen_Shot_2014-12-16_at_23.44.44.png

     

    And once the review version goes into Shotgun, you can see it in full resolution as a single image:

    Screen_Shot_2014-12-16_at_23.46.18.png

     

    Hopefully this covers most of the workflow - any questions, let us know!

    Thanks!
    Manne

     

     

  • 0
    Avatar
    Bruno Guerreiro

    Hi Manne,

     

    Thanks for the feed back, unfortunately that didn't completely do the trick.

    I got the following error while publishing the single image to the screen room:

     

    global name 'sgtk' is not defined

    The current environment is shot_step.

     

    Code Traceback:

    File "Q:\software_shotgun\studio\install\apps\app_store\tk-multi-publish\v0.6.6\python\tk_multi_publish\publish.py", line 246, in _on_publish

    comment, progress.report)

    File "Q:\software_shotgun\studio\install\apps\app_store\tk-multi-publish\v0.6.6\python\tk_multi_publish\publish.py", line 413, in _do_secondary_publish

    progress_cb=progress_cb)

    File "Q:\software_shotgun\studio\install\core\python\tank\platform\bundle.py", line 317, in execute_hook

    return self.__execute_hook_internal(key, hook_name, None, **kwargs)

    File "Q:\software_shotgun\studio\install\core\python\tank\platform\bundle.py", line 641, in __execute_hook_internal

    ret_value = hook.execute_hook_method(resolved_hook_paths, self, method_name, **kwargs)

    File "Q:\software_shotgun\studio\install\core\python\tank\hook.py", line 283, in execute_hook_method

    ret_val = hook_method(**kwargs)

    File "Q:\software_shotgun\studio\install\apps\app_store\tk-multi-publish\v0.6.6\hooks\secondary_publish_tk-nuke.py", line 199, in execute

    current_user = sgtk.util.get_current_user(self.parent.sgtk)

     

     

    No still image shows up in the media or the screening room, nevertheless there is a entry in the shotgun website that a rendered image file type was published, its something like: "Toolkit 1.0 created Published File shot_name_a_NukeFileName_v009.%04d.jpeg on Shot shot_name_a" this entry is not in any way the render, its not even clickable.

    Any further help will be deeply appreciated.

    Thank you

Please sign in to leave a comment.