Previous topic

stalker.core.models.Sequence

Next topic

stalker.core.models.SimpleEntity

This Page

stalker.core.models.Shot

Inheritance diagram of stalker.core.models.Shot

class stalker.core.models.Shot(sequence=None, cut_in=1, cut_out=None, cut_duration=None, assets=None, **kwargs)[source]

Bases: stalker.core.models.TaskableEntity, stalker.core.models.ReferenceMixin, stalker.core.models.StatusMixin

Manages Shot related data.

Deprecated since version 0.1.2.

New in version 0.1.2.

Two shots with the same code can not be assigned to the same Sequence.

The cut_out and cut_duration attributes effects each other. Setting the cut_out will change the cut_duration and setting the cut_duration will change the cut_out value. The default value of the cut_out attribute is calculated from the cut_in and cut_duration attributes. If both cut_out and cut_duration arguments are set to None, the cut_duration defaults to 100 and cut_out will be set to cut_in + cut_duration. So the priority of the attributes are as follows:

For still images (which can be also managed by shots) the cut_in and cut_out can be set to the same value so the cut_duration can be set to zero.

Because Shot is getting its relation to a Project from the passed Sequence, you can skip the project argument, and if you not the value of the project argument is not going to be used.

Parameters:
  • sequence (Sequence) – The Sequence that this shot blengs to. A shot can only be created with a Sequence instance, so it can not be None. The shot itself will be added to the shots list of the given sequence. Also the project of the Sequence will be used to set the project of the current Shot.
  • cut_in (integer) – The in frame number that this shot starts. The default value is 1. When the cut_in is bigger then cut_out, the cut_out attribute is set to cut_in + 1.
  • cut_duration (integer) – The duration of this shot in frames. It should be zero or a positive integer value (natural number?) or . The default value is None.
  • cut_out (integer) – The out frame number that this shot ends. If it is given as a value lower then the cut_in parameter, then the cut_out will be set to the same value with cut_in and the cut_duration attribute will be set to 1. Can be skipped. The default value is None.
__init__(sequence=None, cut_in=1, cut_out=None, cut_duration=None, assets=None, **kwargs)[source]

Methods

__init__(**kwargs[, sequence, cut_in, ...])
create_secondary_tables_for_references() creates any secondary table

Attributes

assets The Asset instances used in this Shot.
code The code name of this object.
created_by The User who has created this object.
created_by_id
cut_duration The duration of this shot in frames.
cut_in The in frame number taht this shot starts.
cut_out The out frame number that this shot ends.
date_created A datetime.datetime instance showing the creation date and time of this object.
date_updated A datetime.datetime instance showing the update date and time of this object.
description Description of this object.
entity_id
entity_type
id
name Name of this object
nice_name Nice name of this object.
notes All the Notess attached to this entity.
project The Project instance that this object belongs to.
project_id
references
reviews All the Reviews about this Entity.
sequence The Sequence instance that this Shot instance belongs to.
sequence_id
shot_id
status
status_list
status_list_id
tags A list of tags attached to this object.
taskableEntity_id
tasks
type The type of the object.
type_id
updated_by The User who has updated this object.
updated_by_id
code

The code name of this object.

It accepts string or unicode values and any other kind of objects will be converted to string. In any update to the name attribute the code also will be updated. If the code is not initialized or given as None, it will be set to the uppercase version of the nice_name attribute. Setting the code attribute to None will reset it to the default value. The default value is the upper case form of the nice_name.

classmethod create_secondary_tables_for_references()

creates any secondary table

created_by

The User who has created this object.

date_created

A datetime.datetime instance showing the creation date and time of this object.

date_updated

A datetime.datetime instance showing the update date and time of this object.

description

Description of this object.

name

Name of this object

nice_name

Nice name of this object.

It has the same value with the name (contextually) but with a different format like, all the white spaces replaced by underscores (“_”), all the CamelCase form will be expanded by underscore (_) characters and it is always lower case.

There is also the code attribute which is simply the upper case form of nice_name if it is not defined differently (i.e set to another value).

notes

All the Notess attached to this entity.

It is a list of Note instances or an empty list, setting it None will raise a TypeError.

project

The Project instance that this object belongs to.

reviews

All the Reviews about this Entity.

It is a list of Review instances or an empty list, setting it None will raise a TypeError.

tags

A list of tags attached to this object.

It is a list of Tag instances which shows the tags of this object

type

The type of the object.

It is an instance of Type with a proper target_entity_type.

updated_by

The User who has updated this object.

assets

The Asset instances used in this Shot.

Holds the relation of a Shot with a list of Assets, which are used in this Shot.

sequence

The Sequence instance that this Shot instance belongs to.

cut_duration

The duration of this shot in frames.

It should be a positive integer value. If updated also updates the cut_duration attribute. The default value is 100.

cut_in

The in frame number taht this shot starts.

The default value is 1. When the cut_in is bigger then cut_out, the cut_out value is update to cut_in + 1.

cut_out

The out frame number that this shot ends.

When the cut_out is set to a value lower than cut_in, cut_out will be updated to cut_in + 1. The default value is cut_in + cut_duration.