set_anim_number_of_frames
Set the frame count of a UAnimSequence's data model in one undo step and save the package. Use it to fix or update animation length; the new count is read back to confirm the change.
Instructions
Set the number of frames of the data model of a UAnimSequence (IAnimationDataController::SetNumberOfFrames, one undo step), then save the package; frame_count is read back from the data model. When the data model rate differs from the sequence sampling rate (as after set_anim_frame_rate), a count that is not a whole number of frames at the sampling rate is an error naming the multiple to use, with nothing changed (only the default sampling rate is checked, not per-platform overrides of it). The current count gives saved=false and a note, with nothing saved. A count the data controller rejects is an error with nothing saved, and a failed save makes success false, with saved=false and save_error.
Returns: { sequence_path, frame_count, saved, save_error, note? }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| frame_count | Yes | New number of frames (integer > 0). | |
| sequence_path | Yes | Asset path of the UAnimSequence. |