SG default entities¶
This module collects all default pyshotgrid custom entities.
- class pyshotgrid.sg_default_entities.SGProject(sg, entity_id, entity_type=None)[source]¶
Bases:
SGEntity
An instance of this class represents a single Project entity in ShotGrid.
Note
Try to avoid creating instances of this class in production code and use the
pyshotgrid.new_entity
method instead. This will make sure that you always get the correct entity class to work with.-
DEFAULT_SG_ENTITY_TYPE:
Optional
[str
] = 'Project'¶ The SG entity type that will be used when you do not specify it in the init arguments. For the base SGEntity this should always be None, but for sub classes this should be set to the SG entity type that the class should represent.
- publishes(pub_types=None, latest=False)[source]¶
- Parameters:
pub_types (
Union
[str
,list
[str
],None
]) – The names of the Publish File Types to return.latest (
bool
) –Whether to get the “latest” publishes or not. This uses the same logic as the tk-multi-loader2 app which is as follows:
group all publishes with the same “name” field together
from these get the publishes with the highest “version_number” field
if there are publishes with the same “name” and “version_number” the newest one wins.
- Return type:
- Returns:
All published files from this project.
-
DEFAULT_SG_ENTITY_TYPE:
- class pyshotgrid.sg_default_entities.SGShot(sg, entity_id, entity_type=None)[source]¶
Bases:
SGEntity
An instance of this class represents a single Shot entity in ShotGrid.
Note
Try to avoid creating instances of this class in production code and use the
pyshotgrid.new_entity
method instead. This will make sure that you always get the correct entity class to work with.-
DEFAULT_SG_ENTITY_TYPE:
Optional
[str
] = 'Shot'¶ The SG entity type that will be used when you do not specify it in the init arguments. For the base SGEntity this should always be None, but for sub classes this should be set to the SG entity type that the class should represent.
- publishes(pub_types=None, latest=False)[source]¶
- Parameters:
pub_types (
Union
[str
,list
[str
],None
]) – The names of the Publish File Types to return.latest (
bool
) –Whether to get the “latest” publishes or not. This uses the same logic as the tk-multi-loader2 app which is as follows:
group all publishes with the same “name” field together
from these get the publishes with the highest “version_number” field
if there are publishes with the same “name” and “version_number” the newest one wins.
- Return type:
- Returns:
All published files from this shot.
- tasks(names=None, assignee=None, pipeline_step=None)[source]¶
- Parameters:
- Return type:
- Returns:
A list of Tasks.
-
DEFAULT_SG_ENTITY_TYPE:
- class pyshotgrid.sg_default_entities.SGAsset(sg, entity_id, entity_type=None)[source]¶
Bases:
SGEntity
An instance of this class represents a single Asset entity in ShotGrid.
Note
Try to avoid creating instances of this class in production code and use the
pyshotgrid.new_entity
method instead. This will make sure that you always get the correct entity class to work with.-
DEFAULT_SG_ENTITY_TYPE:
Optional
[str
] = 'Asset'¶ The SG entity type that will be used when you do not specify it in the init arguments. For the base SGEntity this should always be None, but for sub classes this should be set to the SG entity type that the class should represent.
- publishes(pub_types=None, latest=False)[source]¶
- Parameters:
pub_types (
Union
[str
,list
[str
],None
]) – The names of the Publish File Types to return.latest (
bool
) –Whether to get the “latest” publishes or not. This uses the same logic as the tk-multi-loader2 app which is as follows:
group all publishes with the same “name” field together
from these get the publishes with the highest “version_number” field
if there are publishes with the same “name” and “version_number” the newest one wins.
- Return type:
- Returns:
All published files from this asset.
- tasks(names=None, assignee=None, pipeline_step=None)[source]¶
- Parameters:
- Return type:
- Returns:
A list of Tasks.
-
DEFAULT_SG_ENTITY_TYPE:
- class pyshotgrid.sg_default_entities.SGTask(sg, entity_id, entity_type=None)[source]¶
Bases:
SGEntity
An instance of this class represents a single Task entity in ShotGrid.
Note
Try to avoid creating instances of this class in production code and use the
pyshotgrid.new_entity
method instead. This will make sure that you always get the correct entity class to work with.-
DEFAULT_SG_ENTITY_TYPE:
Optional
[str
] = 'Task'¶ The SG entity type that will be used when you do not specify it in the init arguments. For the base SGEntity this should always be None, but for sub classes this should be set to the SG entity type that the class should represent.
- publishes(pub_types=None, latest=False)[source]¶
- Parameters:
pub_types (
Union
[str
,list
[str
],None
]) – The names of the Publish File Types to return.latest (
bool
) –Whether to get the “latest” publishes or not. This uses the same logic as the tk-multi-loader2 app which is as follows:
group all publishes with the same “name” field together
from these get the publishes with the highest “version_number” field
if there are publishes with the same “name” and “version_number” the newest one wins.
- Return type:
- Returns:
All published files from this shot.
-
DEFAULT_SG_ENTITY_TYPE:
- class pyshotgrid.sg_default_entities.SGPublishedFile(sg, entity_id, entity_type=None)[source]¶
Bases:
SGEntity
An instance of this class represents a single PublishedFile entity in ShotGrid.
Note
Try to avoid creating instances of this class in production code and use the
pyshotgrid.new_entity
method instead. This will make sure that you always get the correct entity class to work with.-
DEFAULT_SG_ENTITY_TYPE:
Optional
[str
] = 'PublishedFile'¶ The SG entity type that will be used when you do not specify it in the init arguments. For the base SGEntity this should always be None, but for sub classes this should be set to the SG entity type that the class should represent.
- get_latest()[source]¶
- Return type:
- Returns:
The latest published file of its kind (which might be this same entity).
-
DEFAULT_SG_ENTITY_TYPE:
- class pyshotgrid.sg_default_entities.SGVersion(sg, entity_id, entity_type=None)[source]¶
Bases:
SGEntity
An instance of this class represents a single Version entity in ShotGrid.
Note
Try to avoid creating instances of this class in production code and use the
pyshotgrid.new_entity
method instead. This will make sure that you always get the correct entity class to work with.
- class pyshotgrid.sg_default_entities.SGPlaylist(sg, entity_id, entity_type=None)[source]¶
Bases:
SGEntity
An instance of this class represents a single Playlist entity in ShotGrid.
Note
Try to avoid creating instances of this class in production code and use the
pyshotgrid.new_entity
method instead. This will make sure that you always get the correct entity class to work with.
- class pyshotgrid.sg_default_entities.SGHumanUser(sg, entity_id, entity_type=None)[source]¶
Bases:
SGEntity
An instance of this class represents a single HumanUser entity in ShotGrid.
Note
Try to avoid creating instances of this class in production code and use the
pyshotgrid.new_entity
method instead. This will make sure that you always get the correct entity class to work with.-
DEFAULT_SG_ENTITY_TYPE:
Optional
[str
] = 'HumanUser'¶ The SG entity type that will be used when you do not specify it in the init arguments. For the base SGEntity this should always be None, but for sub classes this should be set to the SG entity type that the class should represent.
- versions(entity=None, pipeline_step=None, latest=False)[source]¶
- Parameters:
entity (
Union
[dict
[str
,Any
],SGEntity
,None
]) – entity to filter by eg. (Shot, Asset, Project, Task…).pipeline_step (
Union
[str
,dict
[str
,Any
],SGEntity
,None
]) – Name, short name or entity object or the Pipeline Step to filter by.latest (
bool
) – Whether to return only the latest Version per link/entity.
- Return type:
- Returns:
A list of Versions
- tasks(names=None, entity=None, pipeline_step=None)[source]¶
- Parameters:
- Return type:
- Returns:
A list of Tasks
- publishes(pub_types=None, latest=False)[source]¶
- Parameters:
pub_types (
Union
[str
,list
[str
],None
]) – The names of the Publish File Types to return.latest (
bool
) –Whether to get the “latest” publishes or not. This uses the same logic as the tk-multi-loader2 app which is as follows:
group all publishes with the same “name” field together
from these get the publishes with the highest “version_number” field
if there are publishes with the same “name” and “version_number” the newest one wins.
- Return type:
- Returns:
All published files from this shot.
-
DEFAULT_SG_ENTITY_TYPE: