Asset Reference
AssetReference
Bases: BaseModel
Represents an asset used in a scene.
asset_params
class-attribute
instance-attribute
asset_params: AssetParams | None = None
The asset reference params.
start_time
class-attribute
instance-attribute
start_time: NonNegativeFloat = 0
The start time of the asset in seconds.
end_time
class-attribute
instance-attribute
end_time: NonNegativeFloat = 0
The end time of the asset in seconds.
effects
class-attribute
instance-attribute
effects: list[VideoEffect] = Field(default_factory=list)
The effects to apply to the asset.
from_asset
classmethod
from_asset(
asset: Asset,
*,
asset_params: AssetParams | None = None,
start_time: float | None = None,
end_time: float | None = None,
effects: Sequence[VideoEffect] | None = None
) -> AssetReference
Create an asset reference from an asset.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
asset |
Asset
|
The asset to reference. |
required |
asset_params |
AssetParams | None
|
The asset params. |
None
|
start_time |
float | None
|
The start time of the asset in seconds. |
None
|
end_time |
float | None
|
The end time of the asset in seconds. |
None
|
Returns:
Type | Description |
---|---|
AssetReference
|
The asset reference. |
Source code in src/mosaico/assets/reference.py
from_dict
classmethod
from_dict(data: Mapping[str, Any]) -> AssetReference
Create an asset reference from a dictionary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Mapping[str, Any]
|
The dictionary data. |
required |
Returns:
Type | Description |
---|---|
AssetReference
|
The asset reference. |
Source code in src/mosaico/assets/reference.py
with_params
with_params(params: AssetParams) -> AssetReference
Add scene params to the asset reference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params |
AssetParams
|
The scene params to add. |
required |
Returns:
Type | Description |
---|---|
AssetReference
|
The asset reference. |
Source code in src/mosaico/assets/reference.py
with_start_time
with_start_time(start_time: float) -> AssetReference
Add a start time to the asset reference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_time |
float
|
The start time to add. |
required |
Returns:
Type | Description |
---|---|
AssetReference
|
The asset reference. |
Source code in src/mosaico/assets/reference.py
with_end_time
with_end_time(end_time: float) -> AssetReference
Add an end time to the asset reference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
end_time |
float
|
The end time to add. |
required |
Returns:
Type | Description |
---|---|
AssetReference
|
The asset reference. |
with_effects
with_effects(effects: Sequence[Effect]) -> AssetReference
Add effects to the asset reference.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
effects |
Sequence[Effect]
|
The effects to add. |
required |
Returns:
Type | Description |
---|---|
AssetReference
|
The asset reference. |