pycozmo.anim¶
Animation clip representation, reading, and preprocessing.
Functions
load_animation_groups(resource_dir) |
|
load_backpack_light_patterns(resource_dir) |
|
load_cube_animation_groups(resource_dir) |
|
load_trigger_map(resource_dir, map_relative_path) |
Classes
AnimationGroup(members) |
|
AnimationGroupMember(name, weight, …) |
|
BackpackAnimation(*args, **kwargs) |
|
CubeAnimation(duration, rotation_period, …) |
|
LightAnimation(on_colors, off_colors, …) |
|
PreprocessedClip(keyframes, …) |
Preprocessed animation clip that can be played back. |
-
class
pycozmo.anim.PreprocessedClip(keyframes: Optional[Dict[int, List[pycozmo.protocol_base.Packet]]] = None)¶ Bases:
objectPreprocessed animation clip that can be played back.
-
classmethod
from_anim_clip(clip: pycozmo.anim_encoder.AnimClip) → pycozmo.anim.PreprocessedClip¶
-
classmethod
keyframe_to_im(keyframe) → <module 'PIL.Image' from '/home/docs/checkouts/readthedocs.org/user_builds/pycozmo/envs/latest/lib/python3.7/site-packages/PIL/Image.py'>¶
-
classmethod
-
class
pycozmo.anim.AnimationGroupMember(name: str, weight: float, cooldown_time: float, mood: str, use_head_angle: Optional[bool] = False, head_angle_min: Optional[float] = 0.0, head_angle_max: Optional[float] = 0.0)¶ Bases:
object-
cooldown_time¶
-
classmethod
from_json(data: Dict[KT, VT])¶
-
head_angle_max¶
-
head_angle_min¶
-
mood¶
-
name¶
-
use_head_angle¶
-
weight¶
-
-
class
pycozmo.anim.AnimationGroup(members: Iterable[pycozmo.anim.AnimationGroupMember])¶ Bases:
object-
choose_member()¶ Choose member by weight.
-
classmethod
from_json(data: Dict[KT, VT])¶
-
member_probabilities¶
-
members¶
-
-
pycozmo.anim.load_animation_groups(resource_dir: str) → Dict[str, pycozmo.anim.AnimationGroup]¶
-
pycozmo.anim.load_cube_animation_groups(resource_dir: str) → Dict[str, List[pycozmo.anim.CubeAnimation]]¶
-
pycozmo.anim.load_backpack_light_patterns(resource_dir: str) → Dict[str, pycozmo.anim.BackpackAnimation]¶