Skip to content

"Dump" command supports outputing a single object#30

Merged
SkowronskiAndrew merged 5 commits intomainfrom
dump-single-object
Aug 14, 2025
Merged

"Dump" command supports outputing a single object#30
SkowronskiAndrew merged 5 commits intomainfrom
dump-single-object

Conversation

@SkowronskiAndrew
Copy link
Copy Markdown
Collaborator

@SkowronskiAndrew SkowronskiAndrew commented Jul 31, 2025

When writing the topic about comparing builds i realized that it could be useful to dump just a single object, especially because the dumps for large files can be many megabytes in size.

This is a little update to add an optional --objectid filter. Copilot agent did a good job of the initial implementation but I adjusted the solution to something more to my taste and added more docs.

I also tested it, including support for negative objectids.

Example:

UnityDataTool dump imagelist.bundle -i -8066222900050932585

produces a txt file that only shows object -8066222900050932585:

External References

ID: -8066222900050932585 (ClassID: 28) Texture2D
  m_Name (string) guineapig
  m_IsAlphaChannelOptional (bool) True
  m_Width (int) 1024
  m_Height (int) 1024
  m_CompleteImageSize (unsigned int) 699064
  m_MipsStripped (int) 0
  m_TextureFormat (int) 10
  m_MipCount (int) 11
  m_IsReadable (bool) False

Details:

  • I thought of suppressing the ExternalReference dump in this case, but its possible that the object has an external reference and that table is important to understand those references. So for the moment we always dump the External References (which can be empty as in the example above).

  • When run on a Scene AssetBundle that has multiple serialized files it will simply apply the filter to each dump.

  • For the moment i just added a quick mention in the comparing builds topic. But the idea of this feature is to use it in scripts that will more directly pinpoint a change in an assetbundle, e.g. first figure out which objects changed using the approaches already demonstrated, then actually dump out those objects using the new feature and trigger some sort of diff. I'm not certain the practical workflow for that given that some assetbundles might have a huge number of new/deleted/modified objects so as first step am just exposing the helpful low level functionality which can be useful even when run manually.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new command-line option --objectid to the dump command, allowing users to dump only a specific object from an AssetBundle or SerializedFile instead of dumping all objects. This is particularly useful for large files where full dumps can be many megabytes in size.

Key changes include:

  • Added --objectid parameter to the dump command with support for negative object IDs
  • Modified the text dumper to filter objects based on the provided ID
  • Updated documentation to reflect the new functionality

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
UnityDataTool/README.md Added documentation for the new --objectid option
UnityDataTool/Program.cs Added command-line option and parameter passing for object ID filtering
TextDumper/TextDumperTool.cs Implemented object ID filtering logic in the dump method
TextDumper/README.md Updated method documentation to include the new objectId parameter
Documentation/comparing-builds.md Added brief mention of the new feature for focused object analysis

Comment thread Documentation/comparing-builds.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@timt-unity3d timt-unity3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. This is super-useful. Thanks!

@SkowronskiAndrew SkowronskiAndrew merged commit f8f6028 into main Aug 14, 2025
4 checks passed
@SkowronskiAndrew
Copy link
Copy Markdown
Collaborator Author

Thanks for the review Tim!

@SkowronskiAndrew SkowronskiAndrew deleted the dump-single-object branch April 9, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants