Skip to content

Add type filtering to dump command (Issue #52)#63

Merged
SkowronskiAndrew merged 2 commits intoUnity-Technologies:mainfrom
Ijtihed:dump-type-filter
Apr 8, 2026
Merged

Add type filtering to dump command (Issue #52)#63
SkowronskiAndrew merged 2 commits intoUnity-Technologies:mainfrom
Ijtihed:dump-type-filter

Conversation

@Ijtihed
Copy link
Copy Markdown
Contributor

@Ijtihed Ijtihed commented Apr 5, 2026

Fixes #52

Added -t / --type option to the dump command. Accepts both numeric ClassID (-t 114) and type name (-t MonoBehaviour), case-insensitive. Resolved via TypeIdRegistry for built-in types, falls back to TypeTree root node for script types. Combine with -i as AND logic.

added Filtering by Type walkthrough in command-dump.md focused on the MonoBehaviour use case. Updated parameter docs in textdumper.md

Tests for name filter, numeric filter and no-match output.

Added -t / --type option to the dump command. Accepts both numeric
ClassID (-t 114) and type name (-t MonoBehaviour), case-insensitive.
Resolved via TypeIdRegistry for built-in types, falls back to TypeTree
root node for script types. Combines with -i as AND logic.

Added "Filtering by Type" walkthrough in command-dump.md focused on the
MonoBehaviour use case. Updated parameter docs in textdumper.md.

Tests for name filter, numeric filter and no-match output.

Made-with: Cursor
@SkowronskiAndrew
Copy link
Copy Markdown
Collaborator

Very cool @Ijtihed, i'll try it out as soon as i get a chance :)

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

Adds a -t/--type filter to the dump command to restrict output to objects of a given Unity ClassID or type name, addressing Issue #52 and improving usability when inspecting large bundles/files.

Changes:

  • Introduces -t/--type option in UnityDataTool dump, plumbed through to TextDumperTool.
  • Implements type-based filtering in the text dumper (numeric ClassID or case-insensitive name) with a “no matches” message.
  • Adds documentation and NUnit tests covering name filter, numeric filter, and no-match behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
UnityDataTool/Program.cs Adds CLI option wiring for --type and passes it into the dump handler.
TextDumper/TextDumperTool.cs Implements the actual per-object filtering logic and updated output messaging.
UnityDataTool.Tests/UnityDataToolAssetBundleTests.cs Adds tests validating filtering by type name, by ClassID, and no-match messaging.
Documentation/textdumper.md Updates API docs to include the new typeFilter parameter.
Documentation/command-dump.md Documents --type option and adds a walkthrough section focused on MonoBehaviour filtering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Ijtihed
Copy link
Copy Markdown
Contributor Author

Ijtihed commented Apr 8, 2026

it should cover everything now (well at least what copilot suggested since I agree with what it said), lmk if anything else should be touched on

Copy link
Copy Markdown
Collaborator

@SkowronskiAndrew SkowronskiAndrew 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, thank you!
I tried with with the BuildReport as a bit of sanity check and everything worked as described.

Example

.\UnityDataTool.exe dump -t 382020655 TestCommon\Data\BuildReports\AssetBundle.buildreport

.\UnityDataTool.exe dump -t PluginBuildInfo TestCommon\Data\BuildReports\AssetBundle.buildreport

This will be convenient for just pulling certain objects by type out of a large file.

@SkowronskiAndrew SkowronskiAndrew merged commit c883beb into Unity-Technologies:main Apr 8, 2026
2 checks passed
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.

"Dump" command - support filtering by object type

3 participants