shotgun.publish#

The publishing widget used by Bookmarks to create new PublishedFiles and Version entities on ShotGrid.

Our publishing logic creates Version and PublishFile entities linked against the current active project and asset and uploads any custom thumbnails set.

Classes:

PublishWidget([parent])

Data:

MOV_FORMATS

Valid movie formats

SECTIONS

UI layout definition

SEQ_FORMATS

Valid sequence formats

class bookmarks.shotgun.publish.PublishWidget(parent=None)[source]#

Bases: BasePropertyEditor

Methods:

db_source()

A file path to use as the source of database values.

find_movie()

Try to find a movie file associated with selected publish file.

find_sequence()

Find an image sequence associated with the current publish file.

get_publish_args()

Get all necessary arguments for publishing.

init_data()

Initializes data.

init_file_from_selection()

If the files tab has any valid selection, we'll use it to set the file path.

is_scene_file()

Checks if the selected file is a scene.

save_changes()

Saves changes.

set_path(v)

Sets the path of the file to publish.

Attributes:

task

The model's associated task.

db_source()[source]#

A file path to use as the source of database values.

Returns:

The database source file.

Return type:

str

find_movie()[source]#

Try to find a movie file associated with selected publish file.

find_sequence()[source]#

Find an image sequence associated with the current publish file.

get_publish_args()[source]#

Get all necessary arguments for publishing.

init_data()[source]#

Initializes data.

init_file_from_selection()[source]#

If the files tab has any valid selection, we’ll use it to set the file path.

is_scene_file()[source]#

Checks if the selected file is a scene.

This is used to check if we should publish the scene file in addition to a version.

save_changes()[source]#

Saves changes.

set_path(v)[source]#

Sets the path of the file to publish.

Parameters:

v (str) – Path to a file.

property task#

The model’s associated task.

bookmarks.shotgun.publish.MOV_FORMATS = ('mp4', 'mov')#

Valid movie formats

bookmarks.shotgun.publish.SECTIONS = {0: {'color': PySide2.QtGui.QColor.fromRgbF(0.254902, 0.254902, 0.254902, 1.000000), 'groups': {0: {0: {'button': 'Visit', 'description': "The current bookmark's linked ShotGrid Project.", 'key': 'project_entity', 'name': 'ShotGrid Project', 'placeholder': '', 'validator': None, 'widget': <class 'bookmarks.shotgun.publish_widgets.ProjectEntityEditor'>}, 1: {'button': 'Visit', 'description': "The current bookmark's linked ShotGrid Project.", 'key': 'asset_entity', 'name': 'ShotGrid Asset', 'placeholder': '', 'validator': None, 'widget': <class 'bookmarks.shotgun.publish_widgets.AssetEntityEditor'>}}, 1: {0: {'button': 'Visit', 'description': 'Select a ShotGrid Task.', 'key': 'task_entity', 'name': 'My Task', 'placeholder': '', 'validator': None, 'widget': <class 'bookmarks.shotgun.publish_widgets.TaskEditor'>}, 1: {'description': 'Select a ShotGrid Status.', 'key': 'status', 'name': 'Publish Status', 'placeholder': '', 'validator': None, 'widget': <class 'bookmarks.shotgun.publish_widgets.StatusEditor'>}}, 2: {0: {'description': 'Select a ShotGrid Storage.', 'key': 'storage', 'name': 'ShotGrid Storage', 'placeholder': '', 'validator': None, 'widget': <class 'bookmarks.shotgun.publish_widgets.LocalStorageEditor'>}, 1: {'description': 'Select a ShotGrid Published File Type.', 'key': 'file_type', 'name': 'ShotGrid File Type', 'placeholder': '', 'validator': None, 'widget': <class 'bookmarks.shotgun.publish_widgets.PublishedFileTypeEditor'>}}, 3: {0: {'description': "The item's description.", 'key': 'description', 'name': 'Description', 'placeholder': 'Enter a description...', 'validator': None, 'widget': <class 'bookmarks.ui.LineEdit'>}}, 4: {0: {'description': 'Drag-and-drop, or click, to add a file to publish to ShotGrid.', 'key': 'file', 'name': None, 'no_group': True, 'placeholder': 'Drop a file here, or click to select...', 'validator': None, 'widget': <class 'bookmarks.shotgun.publish_widgets.DropWidget'>}, 1: {'button': 'Pick', 'description': 'Enter the path to the first image of an image sequence.', 'key': 'version_sequence', 'name': 'Image Sequence', 'placeholder': 'Enter a path to your image sequence', 'validator': None, 'widget': <class 'bookmarks.ui.LineEdit'>}, 2: {'button': 'Pick', 'description': 'Path to an *.mp4 movie file to upload as a reviewable version.', 'key': 'version_movie', 'name': 'Movie File', 'placeholder': 'Enter a path to your movie', 'validator': None, 'widget': <class 'bookmarks.ui.LineEdit'>}, 3: {'button': 'Pick', 'description': 'Path to a File Cache to publish.', 'key': 'version_cache', 'name': 'Cache File', 'placeholder': 'Enter a path to your geometry cache', 'validator': None, 'widget': <class 'bookmarks.ui.LineEdit'>}}}, 'icon': '', 'name': 'Publish File'}}#

UI layout definition

bookmarks.shotgun.publish.SEQ_FORMATS = ('jpg', 'png')#

Valid sequence formats