tik_manager4.objects.version

Work and Publish objects.

Attributes

LOG

Classes

LiveVersion

Customized PublishVersion object class.

PromotedVersion

Customized PublishVersion object class.

PublishVersion

PublishVersion object class.

WorkVersion

WorkVersion object class.

Module Contents

class LiveVersion(absolute_path, name=None, path=None, live_object=None, promoted_object=None)

Bases: PublishVersion

Customized PublishVersion object class.

get_display_color()

Return the display color of the version.

Returns:

str: The display color of the publish version.

get_resolved_path(*args)

Override the get_resolved_path method to return the path.

is_live()

Override the is_live method to always return True.

is_promoted()

Override the is_promoted method to always return False.

This is to prevent doubling the promoted publish version.

property nice_name
Override the nice_name property to return the name of the publish version.
object_type
property version
Override the version property to return 0.
class PromotedVersion(absolute_path, name=None, path=None, live_object=None, promoted_object=None)

Bases: PublishVersion

Customized PublishVersion object class.

can_promote()

Override the can_promote method to always return False.

get_display_color()

Return the display color of the version.

Returns:

str: The display color of the publish version.

get_resolved_path(*args)

Override the get_resolved_path method to return the path.

is_live()

Override the is_live method to always return False.

is_promoted()

Override the is_promoted method to always return False.

This is to prevent doubling the promoted publish version.

promote()

Override the promote method to do nothing.

property nice_name
Override the nice_name property to return the name of the publish version.
object_type
property version
Override the version property to return 0.
class PublishVersion(absolute_path, name=None, path=None, live_object=None, promoted_object=None)

Bases: tik_manager4.core.settings.Settings, tik_manager4.mixins.localize.LocalizeMixin

PublishVersion object class.

This class handles the publish version objects. Unlike work versions, publish versions are directly represented by files. name and path properties are required during first creation. When read from the file, these properties are initialized from the file.

can_promote()

Check if the publish version can be promoted.

get_display_color()

Return the display color of the version.

Returns:

str: The display color of the publish version.

get_element_by_type(element_type)

Return the element by the given type.

Args:

element_type (str): The type of the element.

Returns:

dict: The element or None if not found.

get_element_path(element_type, relative=True)

Return the element path of the given element type.

Args:

element_type (str): The type of the element. relative (bool, optional): If True, returns the relative path.

If False, returns the absolute path. Default is True.

Returns:

str: The path of the element or None if not found.

get_element_suffix(element_type)

Return the element suffix of the given element type.

Args:

element_type (str): The type of the element.

Returns:

str: The suffix of the element or None if not found.

init_properties()

Initialize the properties of the publish.

is_deleted()

Convenience method to check if the publish version is deleted.

is_element_bundled(element_type)

Return if the element is bundled or not.

Args:

element_type (str): The type of the element.

Returns:

bool: True if the element is bundled, False otherwise.

is_live()

Check if the publish version is a live version.

is_promoted()

Return if the publish is promoted or not.

This method checks the ‘promoted’ file in the publish folder. If the content is matching with the publish id, return True

make_live()

“Make the publish version a live version.

move_to_purgatory()

Move the publish version to the purgatory folder.

promote()

Promote the publish editing the promoted.json.

resurrect()

Bring back the publish version from purgatory.

to_dict()

Convert the WorkVersion object to a dictionary.

property category
The category of the publish version.
property creator
The creator of the publish version.
property dcc
The dcc of the publish version.
property dcc_handler
DCC handler object.
property dcc_version
Dcc version used while publishing the version.
property deleted
The deleted status of the publish version.
property element_mapping
The element mapping of the publish version.

Element mapping is a dictionary where each key is the element name and the value is the element type.

property element_types
The element types of the publish version.
property elements
The elements of the publish version.
property nice_name
Return the nice name of the publish version.
property notes
Notes of the publish version.
object_type
property previews
The previews of the publish version.
property publish_id
Unique id of the publish version.
property relative_path
Relative path of the publish version.
property software_version
Dcc version used while publishing the version.

Identical to dcc_version property.

property task_id
Task id of the publish version.
property task_name
Task name of the publish version.
property thumbnail
Thumbnail of the publish version.
property user
The user of the publish version. Alias for creator.
property version
Number of the publish version.
class WorkVersion(parent_path, data_dictionary, parent_work)

Bases: tik_manager4.mixins.localize.LocalizeMixin

WorkVersion object class.

Work versions are not directly represented by files. They are stored in the main work database.

from_dict(dictionary)

Apply the values from given dictionary.

get_display_color()

Return the display color of the version.

Returns:

str: The display color of the publish version.

move_to_purgatory()

Move the work version to the purgatory folder.

resurrect()

Bring back the work version from purgatory.

to_dict()

Convert the WorkVersion object to a dictionary.

property dcc_version
The dcc version of the work version.
property deleted
The deleted status of the work version.
property file_format
The file format of the work version.
property nice_name
Return the nice name of the work version.
property notes
The notes of the work version.
object_type
property path
The relative path of the work version.
property previews
The previews of the work version.
property scene_path
The scene path of the work version.
property thumbnail
The thumbnail path of the work version.
property user
The user of the work version.
property version
The version number of the work version.
property workstation
The workstation of the work version.
LOG