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
{{ message }}
Repository navigation
Commit 706d569
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: UnityPy/tools/extractor.py
+15-1Lines changed: 15 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@
18
18
fromUnityPy.enums.ClassIDTypeimportClassIDType
19
19
fromtypingimportUnion, List, Dict
20
20
frompathlibimportPath
21
+
fromcollections.abcimportCallable
21
22
22
23
23
24
defexport_obj(
@@ -26,6 +27,7 @@ def export_obj(
26
27
append_name: bool=False,
27
28
append_path_id: bool=False,
28
29
export_unknown_as_typetree: bool=False,
30
+
asset_filter: Callable[[Object], bool] =None,
29
31
) ->List[int]:
30
32
"""Exports the given object to the given filepath.
31
33
@@ -35,6 +37,7 @@ def export_obj(
35
37
append_name (bool, optional): Decides if the obj name will be appended to the filepath. Defaults to False.
36
38
append_path_id (bool, optional): Decides if the obj path id will be appended to the filepath. Defaults to False.
37
39
export_unknown_as_typetree (bool, optional): If set, then unimplemented objects will be exported via their typetree or dumped as bin. Defaults to False.
40
+
asset_filter (func(Object)->bool, optional): Determines whether to export an object. Defaults to all objects.
38
41
39
42
Returns:
40
43
list: a list of exported object path_ids
@@ -50,6 +53,10 @@ def export_obj(
50
53
# set filepath
51
54
obj=obj.read()
52
55
56
+
# a filter that returned True during an earlier extract_assets check can return False now with more info from read()
0 commit comments