VElementGroup
Element transform group with complete SVG transform capabilities.
Uses chainable builder pattern for animation construction.
Constructor
VElementGroup(elements: Optional[List[VElement]] = None) -> None
Initialize an element group with builder pattern.
Parameters
-
elements - Optional initial list of child elements
Methods
add_element
add_element(child: 'VElement') -> 'VElementGroup'
Add a child element to the group.
add_elements
add_elements(elements: List['VElement']) -> 'VElementGroup'
Add multiple child elements to the group.
attributes
attributes(
easing_dict: Optional[Dict[str, Callable[[float], float]]] = None,
curve_dict: Optional[Dict[str, CurveFunction]] = None,
keystates_dict: Optional[AttributeKeyStatesDict] = None
) -> T
Set element-level attribute configuration.
Parameters
-
easing_dict - Per-field easing functions {field_name: easing_func}
-
curve_dict - Per-field path functions {field_name: path_func}
-
keystates_dict - Per-field keystate timelines {field_name: [values]}
Returns
self for chaining
clear_elements
clear_elements()
Remove all child elements from the group.
clip
clip(velement: 'VElement') -> 'VElementGroup'
Add a clip element. Can be called multiple times.
default_transition
default_transition(
easing_dict: Optional[Dict[str, Callable[[float], float]]] = None,
curve_dict: Optional[Dict[str, CurveFunction]] = None,
morphing: Optional['MorphingConfig'] = None
) -> T
Set default transition parameters for all subsequent segments.
Parameters
-
easing_dict - Per-field easing functions to use as default
-
curve_dict - Per-field path functions to use as default
-
morphing - Morphing configuration to use as default
Returns
self for chaining
get_elements
get_elements()
Get the list of child elements.
get_frame
get_frame(t: float) -> Optional[VElementGroupState]
Get the interpolated state at a specific time.
is_animatable
is_animatable()
Check if this group can be animated.
is_empty
is_empty()
Check if the group has no child elements.
keystate
keystate(
state: State,
at: Optional[float] = None,
skip_render_at: bool = False
) -> T
Add a keystate at the specified time.
Parameters
-
state - State for this keystate
-
at - Time position (0.0-1.0), or None for auto-timing
-
skip_render_at - If True, skip rendering at exactly this time point. Useful for boundary handoffs between elements.
Returns
self for chaining
keystates
keystates(
states: List[State],
between: Optional[List[float]] = None,
extend: bool = False,
at: Optional[List[float]] = None
) -> T
Add multiple keystates with automatic timing.
Parameters
-
states - List of states to add
-
between - Time range [start, end] for the states (default [0.0, 1.0])
-
extend - If True and time range doesn't cover [0,1], extend with copies of first/last state at 0.0/1.0
-
at - Exact times for each state (overrides between if both given)
Returns
self for chaining
mask
mask(velement: 'VElement') -> 'VElementGroup'
Set the mask element.
remove_element
remove_element(child: 'VElement') -> 'VElementGroup'
Remove a child element from the group.
render
render()
Render the element group in its initial state.
render_at_frame_time
render_at_frame_time(
t: float,
drawing: Optional[Drawing] = None
) -> Optional[Group]
Render the element transform group at a specific animation time.
transition
transition(
easing_dict: Optional[Dict[str, Callable[[float], float]]] = None,
curve_dict: Optional[Dict[str, CurveFunction]] = None,
morphing_config: Optional['MorphingConfig'] = None
) -> T
Configure the transition between the previous and next keystate.
Parameters
-
easing_dict - Per-field easing functions for this segment
-
curve_dict - Per-field path functions for this segment
-
morphing_config - Morphing configuration for vertex state transitions
Returns
self for chaining