hkb_editor.workflows.duplicate_clipcat
¶
duplicate_clip_category
¶
duplicate_clip_category(
behavior: HavokBehavior,
animations: list[str],
target_category: int,
*,
replace_existing: bool = False,
on_warning: Callable[[str], None] = None,
) -> list[HkbRecord]
Copy every clip of animations into a new animation category.
For each animation a counterpart in target_category is created, and
every ClipGenerator referencing the original is duplicated inside each of
its parents. Animation entries are only created where clips actually
exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
behavior
|
HavokBehavior
|
Behavior to modify. |
required |
animations
|
list of str
|
Source animation names, already validated. |
required |
target_category
|
int
|
The aXXX category to copy into. |
required |
replace_existing
|
bool
|
Overwrite clips that already target the new animation instead of skipping them. |
False
|
on_warning
|
callable
|
Called with a message when a parent has to be skipped. |
None
|
Returns:
| Type | Description |
|---|---|
list of HkbRecord
|
The clips that were created or overwritten. |
validate_animation_names
¶
validate_animation_names(
behavior: HavokBehavior, names: list[str]
) -> list[str]
Strip and verify animation names. Raises ValueError on an unknown one.