stalker.core.models.Shot — Stalker v0.1.1.a9 documentation

### Navigation

- index
- next |
- previous |
- Stalker v0.1.1.a9 documentation »

# stalker.core.models.Shot

class `stalker.core.models.` `Shot`(code=None, sequence=None, cut_in=1, cut_out=None, cut_duration=None, **kwargs)

  Bases: `stalker.core.models.Entity`, `stalker.core.mixins.ReferenceMixin`, `stalker.core.mixins.StatusMixin`, `stalker.core.mixins.TaskMixin`

  Manages Shot related data.

  Because most of the shots in different projects are going to have the same name, which is a kind of a code like SH001, SH012A etc., and in Stalker you can not have two entities with the same name if their types are also matching, to guarantee all the shots are going to have different names the `name` attribute of the Shot instances are automatically set to a randomly generated uuid4 sequence.

  But there is no such rule for the `code` attribute, which should be used to give shot codes to individual shots.

  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:

  > `cut_in` > `cut_duration` > `cut_out`

  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.

  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. 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__`(code=None, sequence=None, cut_in=1, cut_out=None, cut_duration=None, **kwargs)

  Methods

  `__init__`(**kwargs[, code, sequence, cut_in, ...]) |

  Attributes

  `code` | The code of this `Shot`.
  `created_by` | The `User` who has created this object.
  `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.
  `name` | Name of this Shot.
  `nice_name` | Nice name of this object.
  `notes` | All the notes about this entity.
  `references` | References are lists containing `Entity` instances.
  `sequence` | The `Sequence` instance that this `Shot` instance belongs to.
  `status` | The current status index of the object.
  `status_list` | The list of statuses that this object can have.
  `tags` | A list of tags attached to this object.
  `tasks` | The list of `Task` instances.
  `type` | The type of the object.
  `updated_by` | The `User` who has updated this object.

  `code`

    The code of this `Shot`.

    Contrary to the original attribute from the inherited parent (`code`), the code attribute can not be set to None or empty string.

  `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`.

  `name`

    Name of this Shot.

    Different than other `SimpleEntity` derivatives, the `Shot` classes `name` attribute is read-only. And the stored value is a uuid4 sequence.

  `sequence`

    The `Sequence` instance that this `Shot` instance belongs to.

    It is a read-only attribute.

  `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.

  `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 notes about this entity.

    It is a list of `Note` objects or an empty list, None will be converted to an empty list.

  `references`

    References are lists containing `Entity` instances.

  `status`

    The current status index of the object.

    This is an integer value and shows the index of the `Status` object in the `StatusList` of this object.

  `status_list`

    The list of statuses that this object can have.

  `tags`

    A list of tags attached to this object.

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

  `tasks`

    The list of `Task` instances.

  `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.

### Navigation

- index
- next |
- previous |
- Stalker v0.1.1.a9 documentation »