Previous topic

oyProjectManager.core.models

Next topic

oyProjectManager.core.models.Client

This Page

oyProjectManager.core.models.Asset

Inheritance diagram of oyProjectManager.core.models.Asset

class oyProjectManager.core.models.Asset(project, name, code=None, type=None)[source]

Bases: oyProjectManager.core.models.VersionableBase

Manages Assets in a given Project

Assets are the data created to finish a Project. It can be a Character or a Vehicle or anything that participate in to a Shot.

Assets have Versionss to hold every change made to that asset file.

The name attribute will be copied to the code attribute if the code argument is None or an empty string.

Parameters:
  • project – The Project instance that this Asset belongs to. It is not possible to initialize an Asset without defining its Project.
  • name

    The name of this asset. It can not be None or an empty string. Anything is possible to be used as a name but it is recommended to keep it brief. The name attribute will be formatted and the result will be copied to the code attribute. The name should be unique among all the asset in the current Project.

    The following rules will apply for the formatting of the name:

    • Spaces are allowed.
    • It should start with an upper case letter (A-Z)
    • Only the following characters are allowed (-_ a-zA-Z0-9)
  • code

    The code of this asset. If it is given as None or empty string the value will be get from the name attribute.

    The following rules will apply for the formatting of the code:

    • No spaces are allowed, all the spaces will be replaced with “_” (underscore) characters
    • It should start with upper case letter (A-Z)
    • Only the following characters are allowed (a-zA-Z0-9_)
    • All the “-” (minus) signs are converted to “_” (under score)

    If the code becomes an empty string after formatting a ValueError will be raised. The code should be unique among all the Assets in the current Project.

  • type – The type of this asset. Can be used to distinguish different types of assets like ‘Prop’, ‘Character’, ‘Vehicle’ etc. If given as None the default value (default_asset_type_name) from the config will be used.
__init__(project, name, code=None, type=None)[source]

Methods

__init__(project, name[, code, type])
query()
save() saves the asset to the related projects database

Attributes

asset_id
code The nicely formatted version of the
description
id
metadata A collection of Table objects and their associated schema constructs.
name The name of this Asset instance, try to be brief.
project the Project instance which this object is related to
project_id
thumbnail_full_path returns the thumbnail full path for this versionable
type
versionable_type
versions the Version instances attached to this object
code

The nicely formatted version of the name attribute

name

The name of this Asset instance, try to be brief.

save()[source]

saves the asset to the related projects database

project

the Project instance which this object is related to

It is a read-only attribute

thumbnail_full_path

returns the thumbnail full path for this versionable

versions

the Version instances attached to this object

It is a read-only attribute