Jump to content

Nuke Publish/Render


Julian Martinz

Recommended Posts

Posted

Hey there,

I am in the process of evaluating ftrack and have some questions regarding publishing. Quite possible that I am missing anything as I am having some trouble understanding the basic principles in ftrack (coming from shotgun). I am gonna first outline what I think is the default render/publishing workflow. Gone through that in afx and nuke but I guess the workflow is similar in maya. Here the procedure in nuke:

  1. Open nuke via ftrack-connect (correct context). Nuke script is saved in an (more or less) arbitrary location. 
  2. Do your work
  3. Render to another arbitrary location
  4. Attach a ftrackpublish node to the write node and publish (or is the intended way to use the publisher via the ftrack menu and the ftrackpublish-node is legacy?). During the publish the nuke-script as well as the rendered-sequence will be copied to the fileserver.
    - Script and image-sequence will be placed side by side into the following structure (given that the task was tied to a shot): project/sequence/shot/scriptname/version/
    - The name of the script will be generic (nuke-script.nk or something like that) and thereby the version/shot/sequence will be not saved explicitly to the files but implicit in the ftrack database as well as the file structure.

If theses assumptions are correct, here are some questions:

  • is there any way to access/parse the ftrack-context in nuke? I'd rather like to use a custom write node which is automatically populated with the correct render-path (built from the task/shot/sequence etc.) on our fileserver. This is especially true for renderings running on the farm. I don't want the artists to manually navigate to the appropriate location and enter the correct filename as this is one task which should be handled by ftrack imo. 
  • the same applies to the script itself. I'd like to force the artist to save the script on our file-server (in the correct location and name) which is - as opposed to local files - backed regularly
  • is the publish-action itself customizable? As the components (rendered sequence and script) already are in their appropriate locations on the fileserver there would be no need for any copying. Instead I'd like to only register the components and create the versions on the ftrack-server.  Guess that this could be done with a custom publisher but I'd really like to let the built-in do the heavy lifting and just modify it

I am quite sure that everything is possible. Just trying to figure out how much effort it takes. 

Best,
Julian

Posted

Hi Julian,

You are describing the current workflow our standard integrations correctly, it is however possible to extend these tools to fit other workflows.  Below we create a new asset version, use it to generate a path through the locations structure, allow nuke to create the files and then add the generated files to the final location. Since we have set the location as unmanaged the data will not be touched but instead assumed to already be in the correct place.

 

import ftrack_api

session = ftrack_api.Session()

# Get the current context
current_context = session.get(
    'TypedContext', os.getenv('FTRACK_TASKID')
)


# Ensure that there is a asset called test
asset = session.create(
    'Asset', {'name':'test', 'parent':current_context.get('parent')}
)

# Create a asset version attaching it to the current
# context.
asset_version = session.create(
    'AssetVersion', {'task':current_context, 'asset':asset, 'is_published':True}
)

# Here we must call commit, creating the asset version.
session.commit()

# We create a component for the nuke script
script_component = asset_version.create_component(
    'test-nuke.nk'
)

# and one for a image sequence
sequence_component = asset_version.create_component(
    'image.%04d.exr [1-100]'
)

# We pick the default location
location = session.pick_location()

# get the location for the nuke script
nuke_script_path = location.structure.get_resource_identifier(
    script_component
)

# get the location for the image sequence
image_sequence_path = location.structure.get_resource_identifier(
    sequence_component
)


#
# Write your file to disk and then add your output files to the
# components.


# setup the location to be unmanaged, meaning that it will not try 
# to manage any files

ftrack_api.mixin(
    location, ftrack_api.entity.location.UnmanagedLocationMixin
)


# Add the components to the location
location.add_component(
    script_component, None
)

location.add_component(
    sequence_component, None
)

asset_version['is_published'] = True

session.commit()


As you can see in the above example, we first create a AssetVersion in order to generate our expected filepath, this is a limitation of the base Structure plugin, but could be solved by implementing a custom Structure. To allow for this functionality in the current tools you would have to configure your preffered "location" with the UnmanagedLocationMixin, you can read more about that in the documentation found here : http://ftrack-python-api.rtd.ftrack.com/en/stable/locations/configuring.html and more about the general concepts of locations here : http://ftrack-python-api.rtd.ftrack.com/en/stable/locations/index.html


cheers
Eric

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...