unityflow 0.3.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- unityflow/__init__.py +167 -0
- unityflow/asset_resolver.py +636 -0
- unityflow/asset_tracker.py +1687 -0
- unityflow/cli.py +2317 -0
- unityflow/data/__init__.py +1 -0
- unityflow/data/class_ids.json +336 -0
- unityflow/diff.py +234 -0
- unityflow/fast_parser.py +676 -0
- unityflow/formats.py +1558 -0
- unityflow/git_utils.py +307 -0
- unityflow/hierarchy.py +1672 -0
- unityflow/merge.py +226 -0
- unityflow/meta_generator.py +1291 -0
- unityflow/normalizer.py +529 -0
- unityflow/parser.py +698 -0
- unityflow/query.py +406 -0
- unityflow/script_parser.py +717 -0
- unityflow/sprite.py +378 -0
- unityflow/validator.py +783 -0
- unityflow-0.3.4.dist-info/METADATA +293 -0
- unityflow-0.3.4.dist-info/RECORD +25 -0
- unityflow-0.3.4.dist-info/WHEEL +5 -0
- unityflow-0.3.4.dist-info/entry_points.txt +2 -0
- unityflow-0.3.4.dist-info/licenses/LICENSE +21 -0
- unityflow-0.3.4.dist-info/top_level.txt +1 -0
unityflow/__init__.py
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"""Unity Prefab Deterministic Serializer.
|
|
2
|
+
|
|
3
|
+
A tool for canonical serialization of Unity YAML files (prefabs, scenes, assets)
|
|
4
|
+
to eliminate non-deterministic changes and reduce VCS noise.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from importlib.metadata import version
|
|
8
|
+
|
|
9
|
+
__version__ = version("unityflow")
|
|
10
|
+
|
|
11
|
+
from unityflow.asset_tracker import (
|
|
12
|
+
BINARY_ASSET_EXTENSIONS,
|
|
13
|
+
AssetDependency,
|
|
14
|
+
AssetReference,
|
|
15
|
+
DependencyReport,
|
|
16
|
+
GUIDIndex,
|
|
17
|
+
LazyGUIDIndex,
|
|
18
|
+
analyze_dependencies,
|
|
19
|
+
build_guid_index,
|
|
20
|
+
extract_guid_references,
|
|
21
|
+
find_references_to_asset,
|
|
22
|
+
find_unity_project_root,
|
|
23
|
+
get_cached_guid_index,
|
|
24
|
+
get_file_dependencies,
|
|
25
|
+
get_lazy_guid_index,
|
|
26
|
+
)
|
|
27
|
+
from unityflow.git_utils import (
|
|
28
|
+
UNITY_ANIMATION_EXTENSIONS,
|
|
29
|
+
UNITY_AUDIO_EXTENSIONS,
|
|
30
|
+
UNITY_CORE_EXTENSIONS,
|
|
31
|
+
UNITY_EXTENSIONS,
|
|
32
|
+
UNITY_PHYSICS_EXTENSIONS,
|
|
33
|
+
UNITY_RENDERING_EXTENSIONS,
|
|
34
|
+
UNITY_TERRAIN_EXTENSIONS,
|
|
35
|
+
UNITY_UI_EXTENSIONS,
|
|
36
|
+
get_changed_files,
|
|
37
|
+
get_files_changed_since,
|
|
38
|
+
get_repo_root,
|
|
39
|
+
is_git_repository,
|
|
40
|
+
)
|
|
41
|
+
from unityflow.hierarchy import (
|
|
42
|
+
ComponentInfo,
|
|
43
|
+
Hierarchy,
|
|
44
|
+
HierarchyNode,
|
|
45
|
+
build_hierarchy,
|
|
46
|
+
get_prefab_instance_for_stripped,
|
|
47
|
+
get_stripped_objects_for_prefab,
|
|
48
|
+
resolve_game_object_for_component,
|
|
49
|
+
)
|
|
50
|
+
from unityflow.meta_generator import (
|
|
51
|
+
EXTENSION_TO_TYPE,
|
|
52
|
+
AssetType,
|
|
53
|
+
MetaFileOptions,
|
|
54
|
+
detect_asset_type,
|
|
55
|
+
ensure_meta_file,
|
|
56
|
+
generate_guid,
|
|
57
|
+
generate_meta_content,
|
|
58
|
+
generate_meta_file,
|
|
59
|
+
generate_meta_files_recursive,
|
|
60
|
+
get_guid_from_meta,
|
|
61
|
+
get_meta_info,
|
|
62
|
+
# Meta modification functions
|
|
63
|
+
modify_meta_file,
|
|
64
|
+
set_asset_bundle,
|
|
65
|
+
set_script_execution_order,
|
|
66
|
+
set_texture_max_size,
|
|
67
|
+
set_texture_sprite_mode,
|
|
68
|
+
)
|
|
69
|
+
from unityflow.normalizer import UnityPrefabNormalizer
|
|
70
|
+
from unityflow.parser import UnityYAMLDocument, UnityYAMLObject
|
|
71
|
+
from unityflow.query import (
|
|
72
|
+
QueryResult,
|
|
73
|
+
get_value,
|
|
74
|
+
merge_values,
|
|
75
|
+
query_path,
|
|
76
|
+
set_value,
|
|
77
|
+
)
|
|
78
|
+
from unityflow.script_parser import (
|
|
79
|
+
ScriptFieldCache,
|
|
80
|
+
ScriptInfo,
|
|
81
|
+
SerializedField,
|
|
82
|
+
get_script_field_order,
|
|
83
|
+
parse_script,
|
|
84
|
+
parse_script_file,
|
|
85
|
+
reorder_fields,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
__all__ = [
|
|
89
|
+
# Classes
|
|
90
|
+
"UnityPrefabNormalizer",
|
|
91
|
+
"UnityYAMLDocument",
|
|
92
|
+
"UnityYAMLObject",
|
|
93
|
+
"QueryResult",
|
|
94
|
+
# Asset tracking classes
|
|
95
|
+
"AssetDependency",
|
|
96
|
+
"AssetReference",
|
|
97
|
+
"DependencyReport",
|
|
98
|
+
"GUIDIndex",
|
|
99
|
+
"LazyGUIDIndex",
|
|
100
|
+
# Script parsing classes
|
|
101
|
+
"ScriptInfo",
|
|
102
|
+
"SerializedField",
|
|
103
|
+
"ScriptFieldCache",
|
|
104
|
+
# Functions
|
|
105
|
+
"get_changed_files",
|
|
106
|
+
"get_files_changed_since",
|
|
107
|
+
"get_repo_root",
|
|
108
|
+
"is_git_repository",
|
|
109
|
+
# Query functions
|
|
110
|
+
"query_path",
|
|
111
|
+
"set_value",
|
|
112
|
+
"get_value",
|
|
113
|
+
"merge_values",
|
|
114
|
+
# Asset tracking functions
|
|
115
|
+
"analyze_dependencies",
|
|
116
|
+
"build_guid_index",
|
|
117
|
+
"extract_guid_references",
|
|
118
|
+
"find_references_to_asset",
|
|
119
|
+
"find_unity_project_root",
|
|
120
|
+
"get_cached_guid_index",
|
|
121
|
+
"get_file_dependencies",
|
|
122
|
+
"get_lazy_guid_index",
|
|
123
|
+
# Script parsing functions
|
|
124
|
+
"parse_script",
|
|
125
|
+
"parse_script_file",
|
|
126
|
+
"get_script_field_order",
|
|
127
|
+
"reorder_fields",
|
|
128
|
+
# Extension sets
|
|
129
|
+
"UNITY_EXTENSIONS",
|
|
130
|
+
"UNITY_CORE_EXTENSIONS",
|
|
131
|
+
"UNITY_ANIMATION_EXTENSIONS",
|
|
132
|
+
"UNITY_RENDERING_EXTENSIONS",
|
|
133
|
+
"UNITY_PHYSICS_EXTENSIONS",
|
|
134
|
+
"UNITY_TERRAIN_EXTENSIONS",
|
|
135
|
+
"UNITY_AUDIO_EXTENSIONS",
|
|
136
|
+
"UNITY_UI_EXTENSIONS",
|
|
137
|
+
"BINARY_ASSET_EXTENSIONS",
|
|
138
|
+
# Meta generator classes
|
|
139
|
+
"AssetType",
|
|
140
|
+
"MetaFileOptions",
|
|
141
|
+
# Meta generator functions
|
|
142
|
+
"generate_guid",
|
|
143
|
+
"detect_asset_type",
|
|
144
|
+
"generate_meta_content",
|
|
145
|
+
"generate_meta_file",
|
|
146
|
+
"generate_meta_files_recursive",
|
|
147
|
+
"ensure_meta_file",
|
|
148
|
+
"get_guid_from_meta",
|
|
149
|
+
# Meta modification functions
|
|
150
|
+
"modify_meta_file",
|
|
151
|
+
"set_texture_sprite_mode",
|
|
152
|
+
"set_texture_max_size",
|
|
153
|
+
"set_script_execution_order",
|
|
154
|
+
"set_asset_bundle",
|
|
155
|
+
"get_meta_info",
|
|
156
|
+
# Meta generator constants
|
|
157
|
+
"EXTENSION_TO_TYPE",
|
|
158
|
+
# Hierarchy classes
|
|
159
|
+
"ComponentInfo",
|
|
160
|
+
"HierarchyNode",
|
|
161
|
+
"Hierarchy",
|
|
162
|
+
# Hierarchy functions
|
|
163
|
+
"build_hierarchy",
|
|
164
|
+
"resolve_game_object_for_component",
|
|
165
|
+
"get_prefab_instance_for_stripped",
|
|
166
|
+
"get_stripped_objects_for_prefab",
|
|
167
|
+
]
|