Animation Frame Packer and Unpacking. #143
Open
DatMoshu wants to merge 12 commits intopolserver:masterfrom
Open
Animation Frame Packer and Unpacking. #143DatMoshu wants to merge 12 commits intopolserver:masterfrom
DatMoshu wants to merge 12 commits intopolserver:masterfrom
Conversation
Introduces functionality to export animation frames as packed JSON/PNG sprite sheets and import them back, including new context menu items and dialogs for options. Adds supporting classes for JSON structure in PackerClasses.cs and integrates handlers in AnimationListControl for packing and unpacking frames.
Refactored the animation frame import process to prompt the user once for overwrite/append behavior across all directions, improving usability. Added palette building and region extraction helpers for more efficient and accurate color mapping. Enhanced error handling and memory management during large imports.
Introduces a 'One row per direction' checkbox to the PackOptionsForm, allowing packed sprite sheets to organize frames with each direction on a separate row. Updates packing logic to support this option and outputs a text file with row mapping when enabled.
Introduces a 'FrameSpacing' option in the animation packing dialog, allowing users to specify spacing between frames when exporting packed animations. Updates layout logic to respect the spacing value, and adds a UI slider for user control.
Introduces an 'Export all animations' checkbox to the pack options form, allowing users to export all actions for the selected body. Refactors export logic to support batch exporting and updates UI layout to accommodate the new option.
Introduces a 'Bulk Unpack Frames' menu item and handler to allow importing multiple animation JSON files at once. Refactors unpack logic into a reusable method and adds overwrite/append options for bulk imports, improving workflow for batch animation imports.
Added a check to skip processing animation directions greater than 4 in AnimationListControl. This prevents handling unsupported or invalid direction values.
Moved PackedOutput, PackedMeta, PackedFrameEntry, Rect, PointStruct, and SizeStruct classes from AnimationListControl.cs to UoFiddler.Controls/Classes for reuse and better organization. Deleted PackerClasses.cs, consolidating all packed animation-related data structures into the new shared classes. Adjusted button layout in AnimationListControl for improved UI.
Introduces an 'Import Animation' menu item to the context menu in AnimationListControl, allowing users to import animations via unpacking frames. Also refactors the export animation submenu to remove unpack options, consolidating import-related actions under the new menu item.
The PackOptionsForm class was relocated from AnimationListControl.cs to its own file, PackOptionsForm.cs, to improve code organization and maintain compilation visibility.
Introduced AnimationDebugHelper to create a debug image with frame bounds and center crosshairs. Updated AnimationListControl to generate and save this debug image alongside the packed sprite and JSON output.
Introduces export and import functionality for packed item ranges in ItemsControl, including new classes for packed item metadata and output, a range input form, and UI integration. Users can export selected item ranges to a sprite sheet and JSON, and import them back, facilitating easier sharing and management of item graphics.
AsYlum-
requested changes
Dec 20, 2025
Collaborator
AsYlum-
left a comment
There was a problem hiding this comment.
Overall looks good. Minor changes needed.
Collaborator
There was a problem hiding this comment.
This can probably be reverted. Formatting changes in unrelated file.
Collaborator
There was a problem hiding this comment.
Could we move this to Forms directory?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Animation Packing & Unpacking System
Overview
This PR introduces a robust system for exporting (packing) and importing (unpacking) animations in UOFiddler. It allows users to easily transfer animation data between UOFiddler and external tools by converting complex UO frame structures into standard PNG sprite sheets with accompanying JSON metadata.
Key Features
1. Pack Frames (Export)
anim_{body}_{action}.png(sprite sheet) andanim_{body}_{action}.json(metadata).Index(Frame order)Centerpoint (The "pivot" or "anchor" of the frame, essential for correct alignment in-game)2. Unpack Frames (Import)
Centerpoints for every frame.3. Bulk Unpack (Batch Import)
*.jsonfiles.anim_{body}_{action}.json) to automatically map data to the correct Body and Action IDs.Technical Implementation
How to Test