You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add type filtering to dump command (Issue #52) (#63)
* Add type filtering to dump command (Issue #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. 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
|`-f, --output-format <format>`| Output format |`text`|
16
16
|`-s, --skip-large-arrays`| Skip dumping large arrays |`false`|
17
17
|`-i, --objectid <id>`| Only dump object with this ID | All objects |
18
+
|`-t, --type <type>`| Filter by object type (ClassID number or type name) | All objects |
18
19
|`-d, --typetree-data <file>`| Load an external TypeTree data file before processing (Unity 6.5+) | — |
19
20
20
21
## Examples
@@ -39,6 +40,29 @@ Skip large arrays for cleaner output:
39
40
UnityDataTool dump /path/to/file -s
40
41
```
41
42
43
+
Dump only MonoBehaviour objects by type name:
44
+
```bash
45
+
UnityDataTool dump /path/to/file -t MonoBehaviour
46
+
```
47
+
48
+
Same thing using the numeric ClassID:
49
+
```bash
50
+
UnityDataTool dump /path/to/file -t 114
51
+
```
52
+
53
+
Dump the AssetBundle manifest object:
54
+
```bash
55
+
UnityDataTool dump mybundle -t AssetBundle
56
+
```
57
+
58
+
---
59
+
60
+
## Filtering by Type
61
+
62
+
The `-t` / `--type` option filters output to objects of a specific Unity type. It accepts either a numeric ClassID (e.g. `114`) or a type name (e.g. `MonoBehaviour`). Type name matching is case-insensitive.
63
+
64
+
This is particularly useful for inspecting MonoBehaviour data in built AssetBundles. MonoBehaviour and ScriptableObject field values are serialized as binary, and a typical bundle contains many other object types (meshes, textures, materials, etc.). Using `-t MonoBehaviour` dumps only the scripting objects, showing the serialized C# field names, types, and values.
Copy file name to clipboardExpand all lines: Documentation/textdumper.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,12 @@ file (AssetBundle or SerializedFile) into human-readable yaml-style text file.
5
5
6
6
## How to use
7
7
8
-
The library consists of a single class called [TextDumperTool](../TextDumper/TextDumperTool.cs). It has a method named Dump and takes four parameters:
8
+
The library consists of a single class called [TextDumperTool](../TextDumper/TextDumperTool.cs). It has a method named Dump and takes five parameters:
9
9
* path (string): path of the data file.
10
10
* outputPath (string): path where the output files will be created.
11
11
* skipLargeArrays (bool): if true, the content of arrays larger than 1KB won't be dumped.
12
12
* objectId (long, optional): if specified and not 0, only the object with this signed 64-bit id will be dumped. If 0 (default), all objects are dumped.
13
+
* typeFilter (string, optional): if specified, only objects matching this type are dumped. Accepts a numeric ClassID (e.g. 114) or a type name (e.g. MonoBehaviour, case-insensitive).
varobjectIdOpt=newOption<long>(aliases:new[]{"--objectid","-i"},()=>0,"Only dump the object with this signed 64-bit id (default: 0, dump all objects)");
95
+
vartypeOpt=newOption<string>(aliases:new[]{"--type","-t"},description:"Filter by object type (ClassID number or type name)");
0 commit comments