Added keyframes and tracks
This commit is contained in:
parent
393730a2b2
commit
539e54902a
1 changed files with 39 additions and 5 deletions
|
@ -1,25 +1,29 @@
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
from decimal import Decimal
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class SpaceVector:
|
class SpaceVector:
|
||||||
"""A 3-dimensional coordinate structure with clear orientation."""
|
"""A 3-dimensional coordinate structure with clear orientation."""
|
||||||
|
|
||||||
lr: float
|
lr: float
|
||||||
"""Left-to-Right."""
|
"""Left-to-Right."""
|
||||||
|
|
||||||
tb: float
|
tb: float
|
||||||
"""Top-to-Bottom."""
|
"""Top-to-Bottom."""
|
||||||
|
|
||||||
fb: float
|
fb: float
|
||||||
"""Front-to-Behind."""
|
"""Front-to-Behind."""
|
||||||
|
|
||||||
|
|
||||||
class Capabilities(Enum):
|
class Capabilities(Enum):
|
||||||
SWITCH = "switch"
|
SWITCH = "switch"
|
||||||
BRIGHTNESS = "brightness"
|
BRIGHTNESS = "brightness"
|
||||||
TEMPERATURE = "temperature"
|
TEMPERATURE = "temperature"
|
||||||
COLOR = "color"
|
COLOR = "color"
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Fixture:
|
class Fixture:
|
||||||
"""Definition of a fixture that generates light, its capabilities and positioning."""
|
"""Definition of a fixture that generates light, its capabilities and positioning."""
|
||||||
|
@ -45,6 +49,7 @@ class Fixture:
|
||||||
exposure: float
|
exposure: float
|
||||||
"""In range [0,1], how exposed is the light source of the fixture. 0: no exposure. 1: full exposure."""
|
"""In range [0,1], how exposed is the light source of the fixture. 0: no exposure. 1: full exposure."""
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Space:
|
class Space:
|
||||||
"""A space containing fixtures."""
|
"""A space containing fixtures."""
|
||||||
|
@ -62,6 +67,37 @@ class Space:
|
||||||
"""A reference point in the space from which the audience perspective might be assumed."""
|
"""A reference point in the space from which the audience perspective might be assumed."""
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Keyframe:
|
||||||
|
"""State description for a specified point in time."""
|
||||||
|
|
||||||
|
time: Decimal
|
||||||
|
"""Point of time of the keyframe. Stored as decimal for high precision."""
|
||||||
|
|
||||||
|
parameter: str
|
||||||
|
"""Parameter targeted by frame value."""
|
||||||
|
|
||||||
|
value: None | bool | float | int | str = None
|
||||||
|
"""Targeted state value reached by reaching the keyframe."""
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Track:
|
||||||
|
"""Contains a sequence of keyframes for specified fixtures."""
|
||||||
|
|
||||||
|
id: str
|
||||||
|
"""Unique identifier for track."""
|
||||||
|
|
||||||
|
name: str
|
||||||
|
"""Human readable name."""
|
||||||
|
|
||||||
|
fixture_ids: list[str]
|
||||||
|
"""Fixtures by ids targeted by track."""
|
||||||
|
|
||||||
|
keyframes: list[Keyframe]
|
||||||
|
"""Sequence of keyframes describing actions"""
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Sequence:
|
class Sequence:
|
||||||
"""A sequence of light events described over fixtures."""
|
"""A sequence of light events described over fixtures."""
|
||||||
|
@ -72,8 +108,6 @@ class Sequence:
|
||||||
name: str
|
name: str
|
||||||
"""Human readable name."""
|
"""Human readable name."""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Event:
|
class Event:
|
||||||
|
|
Loading…
Reference in a new issue