Add type filtering to dump command (Issue #52)#63
Add type filtering to dump command (Issue #52)#63SkowronskiAndrew merged 2 commits intoUnity-Technologies:mainfrom
Conversation
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
|
Very cool @Ijtihed, i'll try it out as soon as i get a chance :) |
There was a problem hiding this comment.
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/--typeoption inUnityDataTool dump, plumbed through toTextDumperTool. - 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.
…peTreeRoot call Made-with: Cursor
|
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 |
SkowronskiAndrew
left a comment
There was a problem hiding this comment.
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.
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 Typewalkthrough in command-dump.md focused on the MonoBehaviour use case. Updated parameter docs in textdumper.mdTests for name filter, numeric filter and no-match output.