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.
@@ -0,0 +1,293 @@
1
+ Metadata-Version: 2.4
2
+ Name: unityflow
3
+ Version: 0.3.4
4
+ Summary: Unity workflow automation - edit, diff, and merge prefabs, scenes, and assets without the Unity Editor
5
+ Author: unityflow contributors
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/TrueCyan/unityflow
8
+ Project-URL: Repository, https://github.com/TrueCyan/unityflow
9
+ Project-URL: Issues, https://github.com/TrueCyan/unityflow/issues
10
+ Keywords: unity,prefab,scene,asset,yaml,llm,workflow,automation,git
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Version Control :: Git
17
+ Classifier: Topic :: Games/Entertainment
18
+ Requires-Python: >=3.12
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: unityparser>=4.0.0
22
+ Requires-Dist: rapidyaml>=0.10.0
23
+ Requires-Dist: click>=8.0.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
26
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
27
+ Requires-Dist: black>=23.0.0; extra == "dev"
28
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
29
+ Provides-Extra: all
30
+ Requires-Dist: unityflow[dev]; extra == "all"
31
+ Dynamic: license-file
32
+
33
+ # unityflow
34
+
35
+ Unity 워크플로우 자동화 도구입니다. Unity 에디터 없이 프리팹, 씬, 에셋을 편집하고, diff/merge하고, LLM과 통합할 수 있습니다.
36
+
37
+ ## 주요 기능
38
+
39
+ - **정규화**: Unity YAML 파일을 결정적 형식으로 변환하여 불필요한 diff 제거
40
+ - **검증**: 참조 유효성, 순환 참조, 중복 fileID 검사
41
+ - **비교/병합**: 정규화된 diff 및 3-way 병합 지원
42
+ - **에셋 추적**: 의존성 분석 및 역참조 검색
43
+ - **Git 통합**: textconv, merge 드라이버, pre-commit 훅 지원
44
+
45
+ ## 설치
46
+
47
+ ### PyPI에서 설치 (권장)
48
+
49
+ ```bash
50
+ pip install unityflow
51
+ ```
52
+
53
+ ### GitHub에서 설치
54
+
55
+ ```bash
56
+ pip install git+https://github.com/TrueCyan/unityflow.git
57
+ ```
58
+
59
+ ### 소스에서 설치
60
+
61
+ ```bash
62
+ git clone https://github.com/TrueCyan/unityflow
63
+ cd unityflow
64
+ pip install .
65
+ ```
66
+
67
+ ### 개발 환경 설치
68
+
69
+ ```bash
70
+ git clone https://github.com/TrueCyan/unityflow
71
+ cd unityflow
72
+ pip install -e ".[dev]"
73
+ ```
74
+
75
+ ## 요구 사항
76
+
77
+ - Python 3.12 이상
78
+ - 의존성:
79
+ - `unityparser>=4.0.0`
80
+ - `rapidyaml>=0.10.0`
81
+ - `click>=8.0.0`
82
+
83
+ ## 빠른 시작
84
+
85
+ ### 파일 정규화
86
+
87
+ ```bash
88
+ # 단일 파일 정규화
89
+ unityflow normalize Player.prefab
90
+ unityflow normalize MainScene.unity
91
+ unityflow normalize GameConfig.asset
92
+
93
+ # 여러 파일 정규화
94
+ unityflow normalize *.prefab *.unity *.asset
95
+
96
+ # 병렬 처리 (4 워커)
97
+ unityflow normalize Assets/**/*.prefab --parallel 4 --progress
98
+
99
+ # Git에서 변경된 파일만 정규화
100
+ unityflow normalize --changed-only
101
+
102
+ # 스테이징된 파일만 정규화
103
+ unityflow normalize --changed-only --staged-only
104
+ ```
105
+
106
+ ### 파일 검증
107
+
108
+ ```bash
109
+ # 단일 파일 검증
110
+ unityflow validate Player.prefab
111
+ unityflow validate MainScene.unity
112
+
113
+ # 엄격 모드 (경고도 오류로 처리)
114
+ unityflow validate Player.prefab --strict
115
+ ```
116
+
117
+ ### 파일 비교
118
+
119
+ ```bash
120
+ # 두 파일 비교
121
+ unityflow diff old.prefab new.prefab
122
+ unityflow diff Scene_v1.unity Scene_v2.unity
123
+
124
+ # 정규화 없이 비교
125
+ unityflow diff old.prefab new.prefab --no-normalize
126
+ ```
127
+
128
+ ### 에셋 의존성 분석
129
+
130
+ ```bash
131
+ # 모든 의존성 표시
132
+ unityflow deps Player.prefab
133
+
134
+ # 바이너리 에셋만 (텍스처, 메시 등)
135
+ unityflow deps Player.prefab --binary-only
136
+
137
+ # 특정 에셋을 참조하는 파일 찾기
138
+ unityflow find-refs Textures/player.png
139
+ ```
140
+
141
+ ## Git 통합 설정
142
+
143
+ Unity 프로젝트 루트에서 단일 명령어로 Git 통합을 설정할 수 있습니다:
144
+
145
+ ```bash
146
+ # 기본 설정 (diff/merge 드라이버 + .gitattributes)
147
+ unityflow setup
148
+
149
+ # pre-commit 훅도 함께 설치
150
+ unityflow setup --with-hooks
151
+
152
+ # 글로벌 설정 (모든 저장소에 적용)
153
+ unityflow setup --global
154
+ ```
155
+
156
+ 이 명령어는 다음을 자동으로 수행합니다:
157
+ - Git diff 드라이버 설정 (정규화된 diff 출력)
158
+ - Git merge 드라이버 설정 (Unity 파일 3-way 병합)
159
+ - `.gitattributes` 파일 생성/업데이트
160
+
161
+ ### 수동 설정 (선택사항)
162
+
163
+ 수동으로 설정하려면 `.gitconfig`에 추가:
164
+ ```ini
165
+ [diff "unity"]
166
+ textconv = unityflow git-textconv
167
+
168
+ [merge "unity"]
169
+ name = Unity YAML Merge
170
+ driver = unityflow merge %O %A %B -o %A --path %P
171
+ ```
172
+
173
+ `.gitattributes`에 추가:
174
+ ```
175
+ *.prefab diff=unity merge=unity text eol=lf
176
+ *.unity diff=unity merge=unity text eol=lf
177
+ *.asset diff=unity merge=unity text eol=lf
178
+ ```
179
+
180
+ ## Python API 사용법
181
+
182
+ ```python
183
+ from unityflow import (
184
+ UnityYAMLDocument,
185
+ UnityPrefabNormalizer,
186
+ analyze_dependencies,
187
+ get_changed_files,
188
+ )
189
+
190
+ # Unity YAML 파일 로드 (.prefab, .unity, .asset)
191
+ doc = UnityYAMLDocument.load("Player.prefab")
192
+ doc = UnityYAMLDocument.load("MainScene.unity")
193
+ doc = UnityYAMLDocument.load("GameConfig.asset")
194
+
195
+ # 정규화
196
+ normalizer = UnityPrefabNormalizer()
197
+ content = normalizer.normalize_file("Player.prefab")
198
+
199
+ # 의존성 분석
200
+ from pathlib import Path
201
+ report = analyze_dependencies([Path("Player.prefab")])
202
+ for dep in report.get_binary_dependencies():
203
+ print(f"{dep.path} [{dep.asset_type}]")
204
+
205
+ # Git 변경 파일 조회
206
+ changed = get_changed_files(staged_only=True)
207
+ ```
208
+
209
+ ### Unity 파일 프로그래매틱 생성
210
+
211
+ ```python
212
+ from unityflow.parser import (
213
+ UnityYAMLDocument,
214
+ create_game_object,
215
+ create_transform,
216
+ create_rect_transform,
217
+ )
218
+
219
+ # 새 문서 생성
220
+ doc = UnityYAMLDocument()
221
+
222
+ # 고유 fileID 생성
223
+ go_id = doc.generate_unique_file_id()
224
+ transform_id = doc.generate_unique_file_id()
225
+
226
+ # GameObject 생성
227
+ go = create_game_object("MyObject", file_id=go_id, components=[transform_id])
228
+
229
+ # Transform 생성
230
+ transform = create_transform(
231
+ game_object_id=go_id,
232
+ file_id=transform_id,
233
+ position={"x": 0, "y": 5, "z": 0},
234
+ )
235
+
236
+ # 문서에 추가 및 저장
237
+ doc.add_object(go)
238
+ doc.add_object(transform)
239
+ doc.save("MyObject.prefab") # 또는 .unity, .asset
240
+ ```
241
+
242
+ ## 지원 파일 형식
243
+
244
+ | 카테고리 | 확장자 |
245
+ |---------|--------|
246
+ | Core | `.prefab`, `.unity`, `.asset` |
247
+ | Animation | `.anim`, `.controller`, `.overrideController`, `.playable`, `.mask`, `.signal` |
248
+ | Rendering | `.mat`, `.renderTexture`, `.flare`, `.shadervariants`, `.spriteatlas`, `.cubemap` |
249
+ | Physics | `.physicMaterial`, `.physicsMaterial2D` |
250
+ | Terrain | `.terrainlayer`, `.brush` |
251
+ | Audio | `.mixer` |
252
+ | UI/Editor | `.guiskin`, `.fontsettings`, `.preset`, `.giparams` |
253
+
254
+ ## CLI 명령어 요약
255
+
256
+ ```bash
257
+ unityflow setup # Git 통합 설정
258
+ unityflow normalize # Unity YAML 파일 정규화
259
+ unityflow validate # 구조적 무결성 검증
260
+ unityflow diff # 두 파일 비교
261
+ unityflow merge # 3-way 병합
262
+ unityflow query # 경로 기반 데이터 조회
263
+ unityflow set # 경로 기반 값 설정
264
+ unityflow deps # 에셋 의존성 분석
265
+ unityflow find-refs # 역참조 검색
266
+ unityflow stats # 파일 통계 조회
267
+ ```
268
+
269
+ 전체 옵션은 `unityflow <command> --help`로 확인하세요.
270
+
271
+ ## 향후 계획
272
+
273
+ - **프로젝트 전체 통계**: `unityflow stats --recursive Assets/`
274
+
275
+ ## 개발
276
+
277
+ ```bash
278
+ # 개발 환경 설치
279
+ pip install -e ".[dev]"
280
+
281
+ # 테스트 실행
282
+ pytest tests/
283
+
284
+ # 코드 포맷팅
285
+ black src/ tests/
286
+ ruff check src/ tests/
287
+ ```
288
+
289
+ 아키텍처와 API 상세 문서는 [DEVELOPMENT.md](DEVELOPMENT.md)를 참조하세요.
290
+
291
+ ## 라이선스
292
+
293
+ MIT License
@@ -0,0 +1,25 @@
1
+ unityflow/__init__.py,sha256=5bMpxrTw3bjkXeQBv9WUfh86wJ0kQQdZ4bcD1zsDf4Q,4148
2
+ unityflow/asset_resolver.py,sha256=TObMXLRxwi4S8ovMnOL3e8HirzhFKVjw_snyHYqsbOs,19520
3
+ unityflow/asset_tracker.py,sha256=NwyKbivaOTDeLuKcPW-EEwiDtL1_vkpRhhEmel9JweQ,56916
4
+ unityflow/cli.py,sha256=BxmEXekxo0plhw4djA-p3vfoLpnSD0yyxyaYbGdw994,79525
5
+ unityflow/diff.py,sha256=iAbKSZu71zyDT97NAUksfRk0RziWTRfEYtT0Iv3vzuk,6889
6
+ unityflow/fast_parser.py,sha256=7FrOctrr9p0uqAZo-wYlsr6XjYXHYcJPesH5l-OTc8s,24067
7
+ unityflow/formats.py,sha256=IpPkGYI2euQvbybV32VAvCvkt0uThNLv_7zqyeNWkEQ,54999
8
+ unityflow/git_utils.py,sha256=ZlSMvChHm03tu-mgfu-CCwWM_70Ng-y95_KRctMzJ6I,8254
9
+ unityflow/hierarchy.py,sha256=tUU9PGHoZiko4IGnhhtynk9Cn2kkUfE4DVI5gc4VStg,65466
10
+ unityflow/merge.py,sha256=NxFxGWkyghW-E79M2pfW3Jene9QvqEUTQgXmPBnkh4o,6935
11
+ unityflow/meta_generator.py,sha256=8YI8ixlzFbGlGLztpg3WHPz-A6aQyB4PKKUf_p41nf4,38173
12
+ unityflow/normalizer.py,sha256=uFu7IRN_sXjw9TqX5BeSZFdoT8KGAT9EAis2ql0kX0U,18788
13
+ unityflow/parser.py,sha256=57PLBIGYR0KV84shms6jpoBE8_iGDchBM6K3wD6Ub_4,21899
14
+ unityflow/query.py,sha256=ogrSN_lHMZtumTkembbdt3dkyEZBGgXS_VPZpj_Ho_w,11546
15
+ unityflow/script_parser.py,sha256=D9wCNjKOe5FCXkcRSRr8dR-AEEIv5yy9PzGlleWwDtk,22836
16
+ unityflow/sprite.py,sha256=07K5Yyg7OP1tfEgLtF4BYdQyFhXN57i2haoyGqc0Wr8,11683
17
+ unityflow/validator.py,sha256=2yOrHjdzexfmKIbNA34ziLAJ8IqrtzFD7TjZ9zF7IF0,27851
18
+ unityflow/data/__init__.py,sha256=JatxIRoa7IpAQSLsCvMjuqCVJwekAih9LTWjRaoTHls,39
19
+ unityflow/data/class_ids.json,sha256=3FHcqdZSzgyBnk-gkxA2gxSyR8Tz0BqHYvvgFZ5QWRU,9957
20
+ unityflow-0.3.4.dist-info/licenses/LICENSE,sha256=ZHwUWPN3UIQ-JQz8enB9tdVBzShrsslteKxyfpl0GR4,1065
21
+ unityflow-0.3.4.dist-info/METADATA,sha256=8WjJh-xBfC6e4V6j6wiF3nkMpUyTUDMsRpzv_N6B1nc,7452
22
+ unityflow-0.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
23
+ unityflow-0.3.4.dist-info/entry_points.txt,sha256=zqRjzMbaiiSRMJ7TADy8RVKZsUeHbI09z3s8p6icCNE,49
24
+ unityflow-0.3.4.dist-info/top_level.txt,sha256=SsUHJNh4BYZVDpJ-Z30AiZ3HK2pfhd_hq-g1kA_geOg,10
25
+ unityflow-0.3.4.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ unityflow = unityflow.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 TrueCyan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ unityflow