stalker.models.version.Version¶
-
class
stalker.models.version.Version(task=None, take_name=’Main’, inputs=None, outputs=None, parent=None, full_path=None, created_with=None, **kwargs)[source]¶ Bases:
stalker.models.link.Link,stalker.models.mixins.DAGMixinHolds information about the created versions (files) for a class:.Task
A
Versionholds information about the created files related to a class:.Task. So if one creates a new version for a file or a sequences of file for aTaskthen the information is hold in theVersioninstance.Parameters: - take_name (str) – A short string holding the current take name. Takes
in Stalker are used solely for grouping individual versions together.
Versions with the same
take_name(of the same Task) are numbered together. It can be any alphanumeric value (a-zA-Z0-9_). The default is the string “Main”. When skipped it will use the default value. It can not start with a number. It can not have white spaces. - inputs (list of
Link) – A list oLinkinstances, holding the inputs of the current version. It could be a texture for a Maya file or an image sequence for Nuke, or anything those you can think as the input for the current Version. - outputs (list of
Linkinstances) – A list ofLinkinstances, holding the outputs of the current version. It could be the rendered image sequences out of Maya or Nuke, or it can be a Targa file which is the output of a Photoshop file (*.psd), or anything that you can think as the output which is created out of this Version. - task (
Task) – ATaskinstance showing the owner of this Version. - parent (
Version) – AVersioninstance which is the parent of this Version. It is mainly used to see which Version is derived from which in the Version history of aTask.
-
__init__(task=None, take_name=’Main’, inputs=None, outputs=None, parent=None, full_path=None, created_with=None, **kwargs)¶
Methods
__init__([task, take_name, inputs, outputs, …])is_latest_published_version()returns True if this is the latest published Version False otherwise update_paths()updates the path variables walk_hierarchy([method])Walks the hierarchy of this task. walk_inputs([method])Walks the inputs of this version Attributes
absolute_full_pathReturns the absolute full path of this version including the absolute_pathReturns the absolute path. childrenOther Budgetinstances which are the children of this one.created_byThe Userwho has created this object.created_by_idThe id of the Userwho has created this entity.created_withdate_createdA datetime.datetimeinstance showing the creation date and time of this object.date_updatedA datetime.datetimeinstance showing the update date and time of this object.descriptionDescription of this object. entity_groupsentity_identity_typeextensionthe extension property filenamethe filename property full_pathThe full path of the url to the link. generic_dataThis attribute can hold any kind of data which exists in SOM. generic_textThis attribute can hold any text. html_classhtml_styleidinputsThe inputs of the current version. is_containerReturns True if the Task has children Tasks is_leafReturns True if the Task has no children Tasks is_publishedis_rootReturns True if the Task has no parent latest_published_versionReturns the last published version. latest_versionreturns the Version instance with the highest version number in this link_idmax_version_numberreturns the maximum version number for this Version metadatanameName of this object naming_parentsreturns a list of parents which start from the nearest Asset, Shot nice_namethe overridden nice name for Version class notesAll the Notess attached to this entity.original_filenameoutputsThe outputs of the current version. parentA Versioninstance which is the parent of this Version.parent_idparentsReturns all of the parents of this mixed in class starting from the paththe path property plural_class_namethe plural name of this class querytagsA list of tags attached to this object. take_nameTakes in Versions are used solely for grouping individual versions together. taskThe Taskinstance that this Version is created for.task_idthumbnailthumbnail_idtjp_idreturns TaskJuggler compatible id to_tjprenders a TaskJuggler compliant string used for TaskJuggler typeThe type of the object. type_idThe id of the Typeof this entity.updated_byThe Userwho has updated this object.updated_by_idThe id of the Userwho has updated this entity.version_idversion_numberThe version_numberattribute is read-only.-
take_name¶ Takes in Versions are used solely for grouping individual versions together.
-
version_number¶ The
version_numberattribute is read-only. Trying to change it will produce an AttributeError.
-
latest_version¶ returns the Version instance with the highest version number in this series.
Returns: Versioninstance
-
max_version_number¶ returns the maximum version number for this Version :return: int
-
absolute_full_path¶ Returns the absolute full path of this version including the repository path of the related project
Returns: str
-
absolute_path¶ Returns the absolute path.
Due to the changes in the project.repository
Returns: str
-
is_latest_published_version()[source]¶ returns True if this is the latest published Version False otherwise
-
children¶ Other
Budgetinstances which are the children of this one. This attribute along with theparentattribute is used in creating a DAG hierarchy of tasks.
-
date_created¶ A
datetime.datetimeinstance showing the creation date and time of this object.
-
date_updated¶ A
datetime.datetimeinstance showing the update date and time of this object.
-
description¶ Description of this object.
-
extension¶ the extension property
-
filename¶ the filename property
-
full_path¶ The full path of the url to the link.
-
generic_data¶ This attribute can hold any kind of data which exists in SOM.
-
generic_text¶ This attribute can hold any text.
-
is_container¶ Returns True if the Task has children Tasks
-
is_leaf¶ Returns True if the Task has no children Tasks
-
is_root¶ Returns True if the Task has no parent
-
name¶ Name of this object
-
notes¶ All the
Notess attached to this entity.It is a list of
Noteinstances or an empty list, setting it to None will raise a TypeError.
-
parent¶ A
Versioninstance which is the parent of this Version. In Stalker it is possible to create a hierarchy of Version.
-
parents¶ Returns all of the parents of this mixed in class starting from the root
-
path¶ the path property
-
plural_class_name¶ the plural name of this class
A list of tags attached to this object.
It is a list of
Taginstances which shows the tags of this object
-
tjp_id¶ returns TaskJuggler compatible id
-
to_tjp¶ renders a TaskJuggler compliant string used for TaskJuggler integration. Needs to be overridden in inherited classes.
-
type¶ The type of the object.
It is a
Typeinstance with a properType.target_entity_type.
-
type_id¶ The id of the
Typeof this entity. Mainly used by SQLAlchemy to create a Many-to-One relates between SimpleEntities and Types.
-
walk_hierarchy(method=0)¶ Walks the hierarchy of this task.
Parameters: method – The walk method, 0: Depth First, 1: Breadth First
-
naming_parents¶ returns a list of parents which start from the nearest Asset, Shot or Sequence
-
nice_name¶ the overridden nice name for Version class
- take_name (str) – A short string holding the current take name. Takes
in Stalker are used solely for grouping individual versions together.
Versions with the same