pyjallib 0.1.9__py3-none-any.whl → 0.1.11__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.
- pyjallib/__init__.py +7 -7
- pyjallib/max/ConfigFiles/Default_3DSMaxNamingConfig.json +161 -0
- pyjallib/max/__init__.py +31 -20
- pyjallib/max/anim.py +60 -36
- pyjallib/max/autoClavicle.py +122 -122
- pyjallib/max/bip.py +213 -14
- pyjallib/max/bone.py +378 -16
- pyjallib/max/boneChain.py +182 -0
- pyjallib/max/groinBone.py +148 -73
- pyjallib/max/header.py +42 -6
- pyjallib/max/helper.py +3 -21
- pyjallib/max/hip.py +276 -366
- pyjallib/max/kneeBone.py +552 -0
- pyjallib/max/macro/jal_macro_align.py +11 -10
- pyjallib/max/macro/jal_macro_bone.py +3 -2
- pyjallib/max/macro/jal_macro_constraint.py +2 -1
- pyjallib/max/macro/jal_macro_helper.py +2 -1
- pyjallib/max/macro/jal_macro_link.py +2 -1
- pyjallib/max/macro/jal_macro_select.py +2 -1
- pyjallib/max/mirror.py +1 -1
- pyjallib/max/twistBone.py +264 -462
- pyjallib/max/volumeBone.py +324 -0
- pyjallib/namePart.py +16 -16
- pyjallib/nameToPath.py +1 -1
- pyjallib/naming.py +16 -17
- pyjallib/namingConfig.py +3 -3
- pyjallib/perforce.py +127 -9
- {pyjallib-0.1.9.dist-info → pyjallib-0.1.11.dist-info}/METADATA +1 -1
- pyjallib-0.1.11.dist-info/RECORD +43 -0
- pyjallib/max/volumePreserveBone.py +0 -209
- pyjallib/p4module.py +0 -488
- pyjallib-0.1.9.dist-info/RECORD +0 -41
- {pyjallib-0.1.9.dist-info → pyjallib-0.1.11.dist-info}/WHEEL +0 -0
pyjallib/perforce.py
CHANGED
@@ -283,6 +283,36 @@ class Perforce:
|
|
283
283
|
bool: 체크아웃 성공 시 True, 실패 시 False
|
284
284
|
"""
|
285
285
|
return self._file_op("edit", file_path, change_list_number, "체크아웃")
|
286
|
+
|
287
|
+
def checkout_files(self, file_paths: list, change_list_number: int) -> bool:
|
288
|
+
"""여러 파일을 한 번에 체크아웃합니다.
|
289
|
+
|
290
|
+
Args:
|
291
|
+
file_paths (list): 체크아웃할 파일 경로 리스트
|
292
|
+
change_list_number (int): 체인지 리스트 번호
|
293
|
+
|
294
|
+
Returns:
|
295
|
+
bool: 모든 파일 체크아웃 성공 시 True, 하나라도 실패 시 False
|
296
|
+
"""
|
297
|
+
if not file_paths:
|
298
|
+
logger.debug("체크아웃할 파일 목록이 비어있습니다.")
|
299
|
+
return True
|
300
|
+
|
301
|
+
logger.info(f"체인지 리스트 {change_list_number}에 {len(file_paths)}개 파일 체크아웃 시도...")
|
302
|
+
|
303
|
+
all_success = True
|
304
|
+
for file_path in file_paths:
|
305
|
+
success = self.checkout_file(file_path, change_list_number)
|
306
|
+
if not success:
|
307
|
+
all_success = False
|
308
|
+
logger.warning(f"파일 '{file_path}' 체크아웃 실패")
|
309
|
+
|
310
|
+
if all_success:
|
311
|
+
logger.info(f"모든 파일({len(file_paths)}개)을 체인지 리스트 {change_list_number}에 성공적으로 체크아웃했습니다.")
|
312
|
+
else:
|
313
|
+
logger.warning(f"일부 파일을 체인지 리스트 {change_list_number}에 체크아웃하지 못했습니다.")
|
314
|
+
|
315
|
+
return all_success
|
286
316
|
|
287
317
|
def add_file(self, file_path: str, change_list_number: int) -> bool:
|
288
318
|
"""파일을 추가합니다.
|
@@ -295,6 +325,36 @@ class Perforce:
|
|
295
325
|
bool: 추가 성공 시 True, 실패 시 False
|
296
326
|
"""
|
297
327
|
return self._file_op("add", file_path, change_list_number, "추가")
|
328
|
+
|
329
|
+
def add_files(self, file_paths: list, change_list_number: int) -> bool:
|
330
|
+
"""여러 파일을 한 번에 추가합니다.
|
331
|
+
|
332
|
+
Args:
|
333
|
+
file_paths (list): 추가할 파일 경로 리스트
|
334
|
+
change_list_number (int): 체인지 리스트 번호
|
335
|
+
|
336
|
+
Returns:
|
337
|
+
bool: 모든 파일 추가 성공 시 True, 하나라도 실패 시 False
|
338
|
+
"""
|
339
|
+
if not file_paths:
|
340
|
+
logger.debug("추가할 파일 목록이 비어있습니다.")
|
341
|
+
return True
|
342
|
+
|
343
|
+
logger.info(f"체인지 리스트 {change_list_number}에 {len(file_paths)}개 파일 추가 시도...")
|
344
|
+
|
345
|
+
all_success = True
|
346
|
+
for file_path in file_paths:
|
347
|
+
success = self.add_file(file_path, change_list_number)
|
348
|
+
if not success:
|
349
|
+
all_success = False
|
350
|
+
logger.warning(f"파일 '{file_path}' 추가 실패")
|
351
|
+
|
352
|
+
if all_success:
|
353
|
+
logger.info(f"모든 파일({len(file_paths)}개)을 체인지 리스트 {change_list_number}에 성공적으로 추가했습니다.")
|
354
|
+
else:
|
355
|
+
logger.warning(f"일부 파일을 체인지 리스트 {change_list_number}에 추가하지 못했습니다.")
|
356
|
+
|
357
|
+
return all_success
|
298
358
|
|
299
359
|
def delete_file(self, file_path: str, change_list_number: int) -> bool:
|
300
360
|
"""파일을 삭제합니다.
|
@@ -307,6 +367,36 @@ class Perforce:
|
|
307
367
|
bool: 삭제 성공 시 True, 실패 시 False
|
308
368
|
"""
|
309
369
|
return self._file_op("delete", file_path, change_list_number, "삭제")
|
370
|
+
|
371
|
+
def delete_files(self, file_paths: list, change_list_number: int) -> bool:
|
372
|
+
"""여러 파일을 한 번에 삭제합니다.
|
373
|
+
|
374
|
+
Args:
|
375
|
+
file_paths (list): 삭제할 파일 경로 리스트
|
376
|
+
change_list_number (int): 체인지 리스트 번호
|
377
|
+
|
378
|
+
Returns:
|
379
|
+
bool: 모든 파일 삭제 성공 시 True, 하나라도 실패 시 False
|
380
|
+
"""
|
381
|
+
if not file_paths:
|
382
|
+
logger.debug("삭제할 파일 목록이 비어있습니다.")
|
383
|
+
return True
|
384
|
+
|
385
|
+
logger.info(f"체인지 리스트 {change_list_number}에서 {len(file_paths)}개 파일 삭제 시도...")
|
386
|
+
|
387
|
+
all_success = True
|
388
|
+
for file_path in file_paths:
|
389
|
+
success = self.delete_file(file_path, change_list_number)
|
390
|
+
if not success:
|
391
|
+
all_success = False
|
392
|
+
logger.warning(f"파일 '{file_path}' 삭제 실패")
|
393
|
+
|
394
|
+
if all_success:
|
395
|
+
logger.info(f"모든 파일({len(file_paths)}개)을 체인지 리스트 {change_list_number}에서 성공적으로 삭제했습니다.")
|
396
|
+
else:
|
397
|
+
logger.warning(f"일부 파일을 체인지 리스트 {change_list_number}에서 삭제하지 못했습니다.")
|
398
|
+
|
399
|
+
return all_success
|
310
400
|
|
311
401
|
def submit_change_list(self, change_list_number: int) -> bool:
|
312
402
|
"""체인지 리스트를 제출합니다.
|
@@ -393,6 +483,28 @@ class Perforce:
|
|
393
483
|
self._handle_p4_exception(e, f"체인지 리스트 {change_list_number} 삭제")
|
394
484
|
return False
|
395
485
|
|
486
|
+
def revert_file(self, file_path: str, change_list_number: int) -> bool:
|
487
|
+
"""체인지 리스트에서 특정 파일을 되돌립니다.
|
488
|
+
|
489
|
+
Args:
|
490
|
+
file_path (str): 되돌릴 파일 경로
|
491
|
+
change_list_number (int): 체인지 리스트 번호
|
492
|
+
|
493
|
+
Returns:
|
494
|
+
bool: 되돌리기 성공 시 True, 실패 시 False
|
495
|
+
"""
|
496
|
+
if not self._is_connected():
|
497
|
+
return False
|
498
|
+
|
499
|
+
logger.info(f"파일 '{file_path}'을 체인지 리스트 {change_list_number}에서 되돌리기 시도...")
|
500
|
+
try:
|
501
|
+
self.p4.run_revert("-c", change_list_number, file_path)
|
502
|
+
logger.info(f"파일 '{file_path}'를 체인지 리스트 {change_list_number}에서 되돌리기 성공.")
|
503
|
+
return True
|
504
|
+
except P4Exception as e:
|
505
|
+
self._handle_p4_exception(e, f"파일 '{file_path}'를 체인지 리스트 {change_list_number}에서 되돌리기")
|
506
|
+
return False
|
507
|
+
|
396
508
|
def revert_files(self, change_list_number: int, file_paths: list) -> bool:
|
397
509
|
"""체인지 리스트 내의 특정 파일들을 되돌립니다.
|
398
510
|
|
@@ -401,7 +513,7 @@ class Perforce:
|
|
401
513
|
file_paths (list): 되돌릴 파일 경로 리스트
|
402
514
|
|
403
515
|
Returns:
|
404
|
-
bool: 되돌리기 성공 시 True, 실패 시 False
|
516
|
+
bool: 모든 파일 되돌리기 성공 시 True, 하나라도 실패 시 False
|
405
517
|
"""
|
406
518
|
if not self._is_connected():
|
407
519
|
return False
|
@@ -410,14 +522,20 @@ class Perforce:
|
|
410
522
|
return True
|
411
523
|
|
412
524
|
logger.info(f"체인지 리스트 {change_list_number}에서 {len(file_paths)}개 파일 되돌리기 시도...")
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
525
|
+
|
526
|
+
all_success = True
|
527
|
+
for file_path in file_paths:
|
528
|
+
success = self.revert_file(file_path, change_list_number)
|
529
|
+
if not success:
|
530
|
+
all_success = False
|
531
|
+
logger.warning(f"파일 '{file_path}' 되돌리기 실패")
|
532
|
+
|
533
|
+
if all_success:
|
534
|
+
logger.info(f"모든 파일({len(file_paths)}개)을 체인지 리스트 {change_list_number}에서 성공적으로 되돌렸습니다.")
|
535
|
+
else:
|
536
|
+
logger.warning(f"일부 파일을 체인지 리스트 {change_list_number}에서 되돌리지 못했습니다.")
|
537
|
+
|
538
|
+
return all_success
|
421
539
|
|
422
540
|
def check_update_required(self, file_paths: list) -> bool:
|
423
541
|
"""파일이나 폴더의 업데이트 필요 여부를 확인합니다.
|
@@ -0,0 +1,43 @@
|
|
1
|
+
pyjallib/__init__.py,sha256=p42vjyKiUbkBVpBscAl-u6DPP6RqHznA4_8tNayPIIk,509
|
2
|
+
pyjallib/namePart.py,sha256=lKIiOVkWrtAW-D3nuv--vHmdAnlQeVPaXLYUDhcr8QU,24177
|
3
|
+
pyjallib/nameToPath.py,sha256=aBeezepLYdpv3VYxnQ2c4ZWzz2WjticXjkdbAIlVa1k,4676
|
4
|
+
pyjallib/naming.py,sha256=8Yq_j8gZuG0OeOfF0TagVVwgozZS9Ca7aIifasrqRZY,36768
|
5
|
+
pyjallib/namingConfig.py,sha256=3w8Xjs_HR3R0K25eySivJn58N9MZwfpk80ySZYVI7Qw,34005
|
6
|
+
pyjallib/perforce.py,sha256=GcpPmV5I30fMOnjvnNVfKVkELqA-u3Pn0474VIl7DYA,29555
|
7
|
+
pyjallib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
+
pyjallib/reloadModules.py,sha256=RAEG3IxzJ0TlsjvnZwJt56JOkc2j8voqAnRbfQuZ44g,1151
|
9
|
+
pyjallib/ConfigFiles/namingConfig.json,sha256=Ov4bbVJb6qodPaooU63e11YUMGXXPWFAA4AQq1sLBYU,1486
|
10
|
+
pyjallib/max/__init__.py,sha256=sLF07So7OcCccPOWixSjIkAhuye37-buK-1I5Hp8F4U,1537
|
11
|
+
pyjallib/max/align.py,sha256=HKjCViQCuicGmtvHB6xxVv4BEGEBGtV2gO3NvR_6R2A,5183
|
12
|
+
pyjallib/max/anim.py,sha256=QTpR8T047IMpV40wnMMNo080wY9rHMV9k7ISrh4P61I,26083
|
13
|
+
pyjallib/max/autoClavicle.py,sha256=Iga8bWUhRabfFePObdwGJSshp5Gww1Jv1Hwcul_y0V4,9559
|
14
|
+
pyjallib/max/bip.py,sha256=J0i-ZK2MO2hYS4aeRfTeGnIJxoCXmM-3ZftEPsBYLPU,27394
|
15
|
+
pyjallib/max/bone.py,sha256=XVtX6e5UbMcGaOqz5UeoMEpQNMfbyQWDNM-UuS1CCUA,50019
|
16
|
+
pyjallib/max/boneChain.py,sha256=weuOmGk7Y7i-0QNCr7G2hRPOecb5xmErshqpmXtikI0,5660
|
17
|
+
pyjallib/max/constraint.py,sha256=93g-X0aZHtZMKXVKr8xMjIhbKou61yc2b3ubQKJquBs,40589
|
18
|
+
pyjallib/max/groinBone.py,sha256=nLR8rgWl6Vt4qQPZKY_jDgTRNF9RCnst49iR2JdWEMs,9144
|
19
|
+
pyjallib/max/header.py,sha256=nuNCVfm5bfYMS0KxB8IRR67D30CXXHRUXHfFYkLG0jU,4120
|
20
|
+
pyjallib/max/helper.py,sha256=Na3jFRwLsjHh4rz0Tk_r_CwHQxOA6n8LhDRA9x5xcSk,18018
|
21
|
+
pyjallib/max/hip.py,sha256=OXMS_bBJUYVKT-aZoJ2YCbbS9eQStwMOkXfA22t-PKw,12696
|
22
|
+
pyjallib/max/kneeBone.py,sha256=P5vDX1MFMbDy4DEI1LsT05a2Z62rqgr_FqGBxl2yEeY,24397
|
23
|
+
pyjallib/max/layer.py,sha256=e9Mn8h7xf0oBYST3QIpyBpLMl8qpWTExO9Y6yH6rKc0,8795
|
24
|
+
pyjallib/max/link.py,sha256=J3z9nkP8ZxAh9yYhR16tjQFCJTCYZMSB0MGbSHfA7uI,2592
|
25
|
+
pyjallib/max/mirror.py,sha256=TcbfZXSk-VJQstNqAmD6VGCqYBF9bMuJtFTg-6SiGdQ,14505
|
26
|
+
pyjallib/max/morph.py,sha256=I8HRYx4NznL6GZL4CbT9iTv05SeaBW_mJJ4PzMxCBkw,12664
|
27
|
+
pyjallib/max/name.py,sha256=DcJt2td-N7vfUGyWazdGTD4-0JW-noa7z5nwc6SHm6I,15337
|
28
|
+
pyjallib/max/select.py,sha256=HMJD2WNX3zVBEeYrj0UX2YXM3fHNItfw6UtQSItNsoU,9487
|
29
|
+
pyjallib/max/skin.py,sha256=5mBzG2wSUxoGlkFeb9Ys8uUxOwuZRGeqUMTI9LiWWZU,41937
|
30
|
+
pyjallib/max/twistBone.py,sha256=3fs8EzRH-TTt2Oypm4LGoR9QtNcno9Fe1OV5_gA9p4U,17049
|
31
|
+
pyjallib/max/volumeBone.py,sha256=SfmxxqmozcDinRtfPsjdNOPDMcqDkHJoquaZZOLrn1g,14649
|
32
|
+
pyjallib/max/ConfigFiles/3DSMaxNamingConfig.json,sha256=PBUYawCELG0aLNRdTh6j-Yka4eNdmpF4P8iRyp0Ngpg,3717
|
33
|
+
pyjallib/max/ConfigFiles/Default_3DSMaxNamingConfig.json,sha256=PBUYawCELG0aLNRdTh6j-Yka4eNdmpF4P8iRyp0Ngpg,3717
|
34
|
+
pyjallib/max/macro/jal_macro_align.py,sha256=_Iqwskz0i4AVlP_AhDrqHwhLml6zoDWkVAxPF3AKqEQ,4286
|
35
|
+
pyjallib/max/macro/jal_macro_bone.py,sha256=SROjidH4z4rec9jNtWK0Dmkx_-sP6GJiMi0Hf6ipwsI,12418
|
36
|
+
pyjallib/max/macro/jal_macro_constraint.py,sha256=jJnNHCjsFJNYRqaBEPjzW-dnCDJT6JRZXH7dqBPkeiw,4160
|
37
|
+
pyjallib/max/macro/jal_macro_helper.py,sha256=hd8e5x56aq7Qt0g-hP5bY0p-njVy8ja77_qMPZyvDag,12906
|
38
|
+
pyjallib/max/macro/jal_macro_link.py,sha256=E8i3z2xsrQiGDEz4Qoxc75hkpalzS95mOMcIic0J-Fc,1193
|
39
|
+
pyjallib/max/macro/jal_macro_select.py,sha256=jeSFR_mqqudTTrZE1rU6qifJ4g441cYxXWcHPTWh1CU,2289
|
40
|
+
pyjallib/max/ui/Container.py,sha256=QSk3oCqhfiR4aglSSkherRGAyPFqMRUt83L-0ENBz-s,5571
|
41
|
+
pyjallib-0.1.11.dist-info/METADATA,sha256=FXi5CkTZfVvCBHO3IpxZEgWOfhsl3USJJk97DSuMXjI,870
|
42
|
+
pyjallib-0.1.11.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
43
|
+
pyjallib-0.1.11.dist-info/RECORD,,
|
@@ -1,209 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
|
4
|
-
"""
|
5
|
-
관절 부피 유지 본(Volume preserve Bone) 모듈 - 3ds Max용 관절의 부피를 유지하기 위해 추가되는 중간본들을 위한 모듈
|
6
|
-
"""
|
7
|
-
|
8
|
-
from pymxs import runtime as rt
|
9
|
-
|
10
|
-
from .header import jal
|
11
|
-
|
12
|
-
class VolumePreserveBone:
|
13
|
-
"""
|
14
|
-
관절 부피 유지 본(Volume preserve Bone) 클래스
|
15
|
-
3ds Max에서 관절의 부피를 유지하기 위해 추가되는 중간본들을 위한 클래스
|
16
|
-
"""
|
17
|
-
def __init__(self):
|
18
|
-
self.name = jal.name
|
19
|
-
self.anim = jal.anim
|
20
|
-
self.const = jal.constraint
|
21
|
-
self.bone = jal.bone
|
22
|
-
self.helper = jal.helper
|
23
|
-
|
24
|
-
self.obj = None
|
25
|
-
|
26
|
-
self.genBones = []
|
27
|
-
self.genHelpers = []
|
28
|
-
|
29
|
-
def create_rot_helpers(self, inObj, inRotScale=0.5):
|
30
|
-
if rt.isValidNode(inObj) == False or rt.isValidNode(inObj.parent) == False:
|
31
|
-
return False
|
32
|
-
|
33
|
-
volName = self.name.get_RealName(inObj.name)
|
34
|
-
volName = volName + "Vol"
|
35
|
-
|
36
|
-
parentObj = inObj.parent
|
37
|
-
|
38
|
-
rt.select(inObj)
|
39
|
-
rotHelpers = self.helper.create_helper(make_two=True)
|
40
|
-
rotHelpers[0].parent = inObj
|
41
|
-
rotHelpers[1].parent = parentObj
|
42
|
-
|
43
|
-
rotHelpers[0].name = self.name.replace_RealName(rotHelpers[0].name, volName)
|
44
|
-
rotHelpers[1].name = self.name.replace_RealName(rotHelpers[1].name, volName + self.name.get_name_part_value_by_description("Type", "Target"))
|
45
|
-
|
46
|
-
rotConst = self.const.assign_rot_const_multi(rotHelpers[0], [inObj, rotHelpers[1]])
|
47
|
-
rotConst.setWeight(1, inRotScale * 100.0)
|
48
|
-
rotConst.setWeight(2, (1.0 - inRotScale) * 100.0)
|
49
|
-
|
50
|
-
return rotHelpers
|
51
|
-
|
52
|
-
def create_init_bone(self, inObj, inVolumeSize, inRotHelpers, inRotAxis="Z", inTransAxis="PosY", inTransScale=1.0):
|
53
|
-
if rt.isValidNode(inObj) == False or rt.isValidNode(inObj.parent) == False:
|
54
|
-
return False
|
55
|
-
|
56
|
-
returnVal = {
|
57
|
-
"Bones": [],
|
58
|
-
"Helpers": []
|
59
|
-
}
|
60
|
-
|
61
|
-
volName = self.name.get_RealName(inObj.name)
|
62
|
-
volName = volName + "Vol"
|
63
|
-
|
64
|
-
# ExposeTM을 사용하여 회전값을 가져오는 방법
|
65
|
-
# rt.select(inObj)
|
66
|
-
# expHelper = self.helper.create_exp_tm()[0]
|
67
|
-
# expHelper.parent = parentObj
|
68
|
-
# expHelper.exposeNode = rotHelpers[0]
|
69
|
-
# expHelper.useParent = False
|
70
|
-
# expHelper.localReferenceNode = rotHelpers[1]
|
71
|
-
# expHelper.eulerXOrder = 5
|
72
|
-
# expHelper.eulerYOrder = 5
|
73
|
-
# expHelper.eulerZOrder = 5
|
74
|
-
|
75
|
-
# expHelper.name = self.name.replace_RealName(expHelper.name, volName)
|
76
|
-
|
77
|
-
boneGenHelperA = rt.point()
|
78
|
-
boneGenHelperB = rt.point()
|
79
|
-
boneGenHelperA.transform = inObj.transform
|
80
|
-
boneGenHelperB.transform = inObj.transform
|
81
|
-
|
82
|
-
if inTransAxis == "PosX":
|
83
|
-
self.anim.move_local(boneGenHelperB, inVolumeSize, 0, 0)
|
84
|
-
elif inTransAxis == "NegX":
|
85
|
-
self.anim.move_local(boneGenHelperB, -inVolumeSize, 0, 0)
|
86
|
-
elif inTransAxis == "PosY":
|
87
|
-
self.anim.move_local(boneGenHelperB, 0, inVolumeSize, 0)
|
88
|
-
elif inTransAxis == "NegY":
|
89
|
-
self.anim.move_local(boneGenHelperB, 0, -inVolumeSize, 0)
|
90
|
-
elif inTransAxis == "PosZ":
|
91
|
-
self.anim.move_local(boneGenHelperB, 0, 0, inVolumeSize)
|
92
|
-
elif inTransAxis == "NegZ":
|
93
|
-
self.anim.move_local(boneGenHelperB, 0, 0, -inVolumeSize)
|
94
|
-
|
95
|
-
row = ""
|
96
|
-
sourceUpAxist = 0
|
97
|
-
upAxis = 0
|
98
|
-
if inRotAxis == "Y":
|
99
|
-
row = "row3"
|
100
|
-
sourceUpAxist = 2
|
101
|
-
upAxis = 2
|
102
|
-
elif inRotAxis == "Z":
|
103
|
-
row = "row2"
|
104
|
-
sourceUpAxist = 3
|
105
|
-
upAxis = 3
|
106
|
-
|
107
|
-
volumeBoneName = self.name.replace_RealName(self.name.get_string(inObj.name), volName + inRotAxis + inTransAxis)
|
108
|
-
|
109
|
-
volumeBones = self.bone.create_simple_bone(inVolumeSize, volumeBoneName)
|
110
|
-
volumeBones[0].transform = inObj.transform
|
111
|
-
lookatConst = self.const.assign_lookat(volumeBones[0], boneGenHelperB)
|
112
|
-
lookatConst.pickUpNode = inObj
|
113
|
-
lookatConst.upnode_world = False
|
114
|
-
lookatConst.StoUP_axis = sourceUpAxist
|
115
|
-
lookatConst.upnode_axis = upAxis
|
116
|
-
self.const.collapse(volumeBones[0])
|
117
|
-
|
118
|
-
rt.delete(boneGenHelperA)
|
119
|
-
rt.delete(boneGenHelperB)
|
120
|
-
|
121
|
-
volumeBones[0].parent = inRotHelpers[0]
|
122
|
-
rt.select(volumeBones[0])
|
123
|
-
parentHelper = self.helper.create_parent_helper()[0]
|
124
|
-
|
125
|
-
posConst = self.const.assign_pos_script_controller(volumeBones[0])
|
126
|
-
# posConst.AddNode("rotExp", expHelper)
|
127
|
-
posConst.AddNode("rotObj", inRotHelpers[0])
|
128
|
-
posConst.AddNode("rotParent", inRotHelpers[1])
|
129
|
-
posConst.AddConstant("volumeSize", inVolumeSize)
|
130
|
-
posConst.AddConstant("transScale", inTransScale)
|
131
|
-
|
132
|
-
posConstCode = f""
|
133
|
-
posConstCode += f"local parentXAxis = (normalize rotParent.objectTransform.{row})\n"
|
134
|
-
posConstCode += f"local rotObjXAxis = (normalize rotObj.objectTransform.{row})\n"
|
135
|
-
posConstCode += f"local rotAmount = (1.0 - (dot parentXAxis rotObjXAxis))/2.0\n"
|
136
|
-
posConstCode += f"local posX = rotAmount * volumeSize * transScale\n"
|
137
|
-
posConstCode += f"[posX, 0.0, 0.0]\n"
|
138
|
-
|
139
|
-
posConst.SetExpression(posConstCode)
|
140
|
-
posConst.Update()
|
141
|
-
|
142
|
-
returnVal["Bones"] = volumeBones
|
143
|
-
returnVal["Helpers"] = [parentHelper]
|
144
|
-
|
145
|
-
return returnVal
|
146
|
-
|
147
|
-
def create_bones(self,inObj, inVolumeSize, inRotAxises, inRotScale, inTransAxiese, inTransScales):
|
148
|
-
if rt.isValidNode(inObj) == False or rt.isValidNode(inObj.parent) == False:
|
149
|
-
return False
|
150
|
-
|
151
|
-
if not len(inTransAxiese) == len(inTransScales) == len(inTransAxiese) == len(inRotAxises):
|
152
|
-
return False
|
153
|
-
|
154
|
-
self.genBones = []
|
155
|
-
self.genHelpers = []
|
156
|
-
returnVal = {
|
157
|
-
"Bones": [],
|
158
|
-
"Helpers": []
|
159
|
-
}
|
160
|
-
|
161
|
-
self.obj = inObj
|
162
|
-
|
163
|
-
rotHelpers = self.create_rot_helpers(inObj, inRotScale=inRotScale)
|
164
|
-
|
165
|
-
for i in range(len(inRotAxises)):
|
166
|
-
genResult = self.create_init_bone(inObj, inVolumeSize, rotHelpers, inRotAxises[i], inTransAxiese[i], inTransScales[i])
|
167
|
-
self.genBones.extend(genResult["Bones"])
|
168
|
-
self.genHelpers.extend(genResult["Helpers"])
|
169
|
-
|
170
|
-
self.genHelpers.insert(0, rotHelpers[0])
|
171
|
-
self.genHelpers.insert(1, rotHelpers[1])
|
172
|
-
|
173
|
-
returnVal["Bones"] = self.genBones
|
174
|
-
returnVal["Helpers"] = self.genHelpers
|
175
|
-
|
176
|
-
return returnVal
|
177
|
-
|
178
|
-
def delete(self):
|
179
|
-
"""
|
180
|
-
생성된 본과 헬퍼를 삭제하는 메소드.
|
181
|
-
|
182
|
-
Returns:
|
183
|
-
None
|
184
|
-
"""
|
185
|
-
rt.delete(self.genBones)
|
186
|
-
rt.delete(self.genHelpers)
|
187
|
-
|
188
|
-
self.genBones = []
|
189
|
-
self.genHelpers = []
|
190
|
-
|
191
|
-
def update_setting(self, inVolumeSize, inRotAxises, inRotScale, inTransAxiese, inTransScales):
|
192
|
-
"""
|
193
|
-
생성된 본과 헬퍼의 설정을 업데이트하는 메소드.
|
194
|
-
|
195
|
-
Args:
|
196
|
-
inVolumeSize: 부피 크기
|
197
|
-
inRotAxises: 회전 축 배열
|
198
|
-
inRotScale: 회전 스케일
|
199
|
-
inTransAxiese: 변환 축 배열
|
200
|
-
inTransScales: 변환 스케일 배열
|
201
|
-
|
202
|
-
Returns:
|
203
|
-
None
|
204
|
-
"""
|
205
|
-
if len(self.genBones) == 0:
|
206
|
-
return False
|
207
|
-
|
208
|
-
self.delete()
|
209
|
-
self.create_bones(self.obj, inVolumeSize, inRotAxises, inRotScale, inTransAxiese, inTransScales)
|