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 CHANGED
@@ -6,12 +6,12 @@ pyjallib Package
6
6
  Python library for game character development pipeline.
7
7
  """
8
8
 
9
- __version__ = '0.1.9'
9
+ __version__ = '0.1.11'
10
10
 
11
11
  # reload_modules 함수를 패키지 레벨에서 사용 가능하게 함
12
- from .namePart import NamePart, NamePartType
13
- from .naming import Naming
14
- from .namingConfig import NamingConfig
15
- from .nameToPath import NameToPath
16
- from .perforce import Perforce
17
- from .reloadModules import reload_modules
12
+ from pyjallib.namePart import NamePart, NamePartType
13
+ from pyjallib.naming import Naming
14
+ from pyjallib.namingConfig import NamingConfig
15
+ from pyjallib.nameToPath import NameToPath
16
+ from pyjallib.perforce import Perforce
17
+ from pyjallib.reloadModules import reload_modules
@@ -0,0 +1,161 @@
1
+ {
2
+ "paddingNum": 2,
3
+ "partOrder": [
4
+ "Base",
5
+ "Type",
6
+ "Side",
7
+ "FrontBack",
8
+ "RealName",
9
+ "Index",
10
+ "Nub"
11
+ ],
12
+ "nameParts": [
13
+ {
14
+ "name": "Base",
15
+ "predefinedValues": [
16
+ "b",
17
+ "Bip001"
18
+ ],
19
+ "weights": [
20
+ 5,
21
+ 10
22
+ ],
23
+ "type": "PREFIX",
24
+ "descriptions": [
25
+ "SkinBone",
26
+ "Biped"
27
+ ],
28
+ "koreanDescriptions": [
29
+ "",
30
+ ""
31
+ ],
32
+ "isDirection": false
33
+ },
34
+ {
35
+ "name": "Type",
36
+ "predefinedValues": [
37
+ "Dum",
38
+ "P",
39
+ "Exp",
40
+ "IK",
41
+ "T",
42
+ "Rot",
43
+ "Pos",
44
+ "Lat",
45
+ "UpN"
46
+ ],
47
+ "weights": [
48
+ 5,
49
+ 10,
50
+ 15,
51
+ 20,
52
+ 25,
53
+ 30,
54
+ 35,
55
+ 40,
56
+ 45
57
+ ],
58
+ "type": "PREFIX",
59
+ "descriptions": [
60
+ "Dummy",
61
+ "Parent",
62
+ "ExposeTM",
63
+ "IK",
64
+ "Target",
65
+ "Rotation",
66
+ "Position",
67
+ "LookAt",
68
+ "UpNode"
69
+ ],
70
+ "koreanDescriptions": [
71
+ "",
72
+ "",
73
+ "",
74
+ "",
75
+ "",
76
+ "",
77
+ "",
78
+ "",
79
+ ""
80
+ ],
81
+ "isDirection": false
82
+ },
83
+ {
84
+ "name": "Side",
85
+ "predefinedValues": [
86
+ "L",
87
+ "R"
88
+ ],
89
+ "weights": [
90
+ 5,
91
+ 10
92
+ ],
93
+ "type": "PREFIX",
94
+ "descriptions": [
95
+ "Left",
96
+ "Right"
97
+ ],
98
+ "koreanDescriptions": [
99
+ "",
100
+ ""
101
+ ],
102
+ "isDirection": true
103
+ },
104
+ {
105
+ "name": "FrontBack",
106
+ "predefinedValues": [
107
+ "F",
108
+ "B"
109
+ ],
110
+ "weights": [
111
+ 5,
112
+ 10
113
+ ],
114
+ "type": "PREFIX",
115
+ "descriptions": [
116
+ "Front",
117
+ "Back"
118
+ ],
119
+ "koreanDescriptions": [
120
+ "",
121
+ ""
122
+ ],
123
+ "isDirection": true
124
+ },
125
+ {
126
+ "name": "RealName",
127
+ "predefinedValues": [],
128
+ "weights": [],
129
+ "type": "REALNAME",
130
+ "descriptions": [],
131
+ "koreanDescriptions": [],
132
+ "isDirection": false
133
+ },
134
+ {
135
+ "name": "Index",
136
+ "predefinedValues": [],
137
+ "weights": [],
138
+ "type": "INDEX",
139
+ "descriptions": [],
140
+ "koreanDescriptions": [],
141
+ "isDirection": false
142
+ },
143
+ {
144
+ "name": "Nub",
145
+ "predefinedValues": [
146
+ "Nub"
147
+ ],
148
+ "weights": [
149
+ 5
150
+ ],
151
+ "type": "SUFFIX",
152
+ "descriptions": [
153
+ "Nub"
154
+ ],
155
+ "koreanDescriptions": [
156
+ ""
157
+ ],
158
+ "isDirection": false
159
+ }
160
+ ]
161
+ }
pyjallib/max/__init__.py CHANGED
@@ -7,31 +7,35 @@ JalTools 3DS 패키지
7
7
  """
8
8
 
9
9
  # 모듈 임포트
10
- from .header import Header
10
+ from pyjallib.max.header import Header
11
11
 
12
- from .name import Name
13
- from .anim import Anim
12
+ from pyjallib.max.name import Name
13
+ from pyjallib.max.anim import Anim
14
14
 
15
- from .helper import Helper
16
- from .constraint import Constraint
17
- from .bone import Bone
15
+ from pyjallib.max.helper import Helper
16
+ from pyjallib.max.constraint import Constraint
17
+ from pyjallib.max.bone import Bone
18
18
 
19
- from .mirror import Mirror
20
- from .layer import Layer
21
- from .align import Align
22
- from .select import Select
23
- from .link import Link
19
+ from pyjallib.max.mirror import Mirror
20
+ from pyjallib.max.layer import Layer
21
+ from pyjallib.max.align import Align
22
+ from pyjallib.max.select import Select
23
+ from pyjallib.max.link import Link
24
24
 
25
- from .bip import Bip
26
- from .skin import Skin
27
- from .morph import Morph
25
+ from pyjallib.max.bip import Bip
26
+ from pyjallib.max.skin import Skin
27
+ from pyjallib.max.morph import Morph
28
28
 
29
- from .twistBone import TwistBone
30
- from .groinBone import GroinBone
31
- from .autoClavicle import AutoClavicle
32
- from .volumePreserveBone import VolumePreserveBone
29
+ from pyjallib.max.boneChain import BoneChain
33
30
 
34
- from .ui.Container import Container
31
+ from pyjallib.max.twistBone import TwistBone
32
+ from pyjallib.max.groinBone import GroinBone
33
+ from pyjallib.max.autoClavicle import AutoClavicle
34
+ from pyjallib.max.volumeBone import VolumeBone
35
+ from pyjallib.max.kneeBone import KneeBone
36
+ from pyjallib.max.hip import Hip
37
+
38
+ from pyjallib.max.ui.Container import Container
35
39
 
36
40
  # 모듈 내보내기
37
41
  __all__ = [
@@ -49,9 +53,16 @@ __all__ = [
49
53
  'Bip',
50
54
  'Skin',
51
55
  'Morph',
56
+ 'BoneChain',
52
57
  'TwistBone',
58
+ 'TwistBoneChain',
53
59
  'GroinBone',
60
+ 'GroinBoneChain',
54
61
  'AutoClavicle',
55
- 'VolumePreserveBone',
62
+ 'AutoClavicleChain',
63
+ 'VolumeBone',
64
+ 'VolumeBoneChain',
65
+ 'KneeBone',
66
+ 'Hip',
56
67
  'Container'
57
68
  ]
pyjallib/max/anim.py CHANGED
@@ -22,7 +22,7 @@ class Anim:
22
22
  """클래스 초기화 (현재 특별한 초기화 동작은 없음)"""
23
23
  pass
24
24
 
25
- def rotate_local(self, inObj, rx, ry, rz):
25
+ def rotate_local(self, inObj, rx, ry, rz, dontAffectChildren=False):
26
26
  """
27
27
  객체를 로컬 좌표계에서 회전시킴.
28
28
 
@@ -32,6 +32,16 @@ class Anim:
32
32
  ry : Y축 회전 각도 (도 단위)
33
33
  rz : Z축 회전 각도 (도 단위)
34
34
  """
35
+ tempParent = None
36
+ tempChildren = []
37
+ if dontAffectChildren:
38
+ # 자식 객체에 영향을 주지 않도록 설정
39
+ tempParent = inObj.parent
40
+ for item in inObj.children:
41
+ tempChildren.append(item)
42
+ for item in tempChildren:
43
+ item.parent = None
44
+
35
45
  # 현재 객체의 변환 행렬을 가져옴
36
46
  currentMatrix = rt.getProperty(inObj, "transform")
37
47
  # 오일러 각도를 통해 회전 행렬(쿼터니언) 생성
@@ -41,8 +51,14 @@ class Anim:
41
51
  rt.preRotate(currentMatrix, quatRotation)
42
52
  # 변경된 행렬을 객체에 설정
43
53
  rt.setProperty(inObj, "transform", currentMatrix)
54
+
55
+ if dontAffectChildren:
56
+ # 자식 객체의 부모를 원래대로 복원
57
+ for item in tempChildren:
58
+ item.parent = inObj
59
+ inObj.parent = tempParent
44
60
 
45
- def move_local(self, inObj, mx, my, mz):
61
+ def move_local(self, inObj, mx, my, mz, dontAffectChildren=False):
46
62
  """
47
63
  객체를 로컬 좌표계에서 이동시킴.
48
64
 
@@ -52,14 +68,30 @@ class Anim:
52
68
  my : Y축 이동 거리
53
69
  mz : Z축 이동 거리
54
70
  """
71
+ tempParent = None
72
+ tempChildren = []
73
+ if dontAffectChildren:
74
+ # 자식 객체에 영향을 주지 않도록 설정
75
+ tempParent = inObj.parent
76
+ for item in inObj.children:
77
+ tempChildren.append(item)
78
+ for item in tempChildren:
79
+ item.parent = None
80
+
55
81
  # 현재 변환 행렬 가져오기
56
- currentMatrix = rt.getProperty(inObj, "transform")
82
+ currentMatrix = rt.getProperty(inObj, "transform", dontAffectChildren=False)
57
83
  # 이동량을 Point3 형태로 생성
58
84
  translation = rt.Point3(mx, my, mz)
59
85
  # preTranslate를 이용해 행렬에 이동 적용
60
86
  rt.preTranslate(currentMatrix, translation)
61
87
  # 적용된 이동 변환 행렬을 객체에 설정
62
88
  rt.setProperty(inObj, "transform", currentMatrix)
89
+
90
+ if dontAffectChildren:
91
+ # 자식 객체의 부모를 원래대로 복원
92
+ for item in tempChildren:
93
+ item.parent = inObj
94
+ inObj.parent = tempParent
63
95
 
64
96
  def reset_transform_controller(self, inObj):
65
97
  """
@@ -549,22 +581,18 @@ class Anim:
549
581
  매개변수:
550
582
  inObj : 변환 값을 저장할 객체
551
583
  """
552
- try:
553
- # 월드 스페이스 행렬 저장
554
- transformString = str(inObj.transform)
555
- rt.setUserProp(inObj, rt.Name("WorldSpaceMatrix"), transformString)
556
-
557
- # 부모가 존재하면 부모 스페이스 행렬도 저장
558
- parent = inObj.parent
559
- if parent is not None:
560
- parentTransform = parent.transform
561
- inverseParent = rt.inverse(parentTransform)
562
- objTransform = inObj.transform
563
- parentSpaceMatrix = objTransform * inverseParent
564
- rt.setUserProp(inObj, rt.Name("ParentSpaceMatrix"), str(parentSpaceMatrix))
565
- except:
566
- # 오류 발생 시 예외 무시
567
- pass
584
+ # 월드 스페이스 행렬 저장
585
+ transformString = str(inObj.transform)
586
+ rt.setUserProp(inObj, rt.Name("WorldSpaceMatrix"), transformString)
587
+
588
+ # 부모가 존재하면 부모 스페이스 행렬도 저장
589
+ parent = inObj.parent
590
+ if parent is not None:
591
+ parentTransform = parent.transform
592
+ inverseParent = rt.inverse(parentTransform)
593
+ objTransform = inObj.transform
594
+ parentSpaceMatrix = objTransform * inverseParent
595
+ rt.setUserProp(inObj, rt.Name("ParentSpaceMatrix"), str(parentSpaceMatrix))
568
596
 
569
597
  def set_xform(self, inObj, space="World"):
570
598
  """
@@ -574,21 +602,17 @@ class Anim:
574
602
  inObj : 변환 값을 적용할 객체
575
603
  space : "World" 또는 "Parent" (적용할 변환 공간)
576
604
  """
577
- try:
578
- if space == "World":
579
- # 월드 스페이스 행렬 적용
580
- matrixString = rt.getUserProp(inObj, rt.Name("WorldSpaceMatrix"))
581
- transformMatrix = rt.execute(matrixString)
605
+ if space == "World":
606
+ # 월드 스페이스 행렬 적용
607
+ matrixString = rt.getUserProp(inObj, rt.Name("WorldSpaceMatrix"))
608
+ transformMatrix = rt.execute(matrixString)
609
+ rt.setProperty(inObj, "transform", transformMatrix)
610
+ elif space == "Parent":
611
+ # 부모 스페이스 행렬 적용
612
+ parent = inObj.parent
613
+ matrixString = rt.getUserProp(inObj, rt.Name("ParentSpaceMatrix"))
614
+ parentSpaceMatrix = rt.execute(matrixString)
615
+ if parent is not None:
616
+ parentTransform = parent.transform
617
+ transformMatrix = parentSpaceMatrix * parentTransform
582
618
  rt.setProperty(inObj, "transform", transformMatrix)
583
- elif space == "Parent":
584
- # 부모 스페이스 행렬 적용
585
- parent = inObj.parent
586
- matrixString = rt.getUserProp(inObj, rt.Name("ParentSpaceMatrix"))
587
- parentSpaceMatrix = rt.execute(matrixString)
588
- if parent is not None:
589
- parentTransform = parent.transform
590
- transformMatrix = parentSpaceMatrix * parentTransform
591
- rt.setProperty(inObj, "transform", transformMatrix)
592
- except:
593
- # 오류 발생 시 예외 무시
594
- pass