pyjallib 0.1.9__py3-none-any.whl → 0.1.10__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 +1 -1
- pyjallib/max/ConfigFiles/Default_3DSMaxNamingConfig.json +161 -0
- pyjallib/max/__init__.py +14 -2
- pyjallib/max/anim.py +60 -36
- pyjallib/max/autoClavicle.py +97 -132
- pyjallib/max/autoClavicleChain.py +173 -0
- pyjallib/max/bip.py +211 -14
- pyjallib/max/bone.py +341 -16
- pyjallib/max/groinBone.py +116 -77
- pyjallib/max/groinBoneChain.py +173 -0
- pyjallib/max/header.py +42 -6
- pyjallib/max/helper.py +3 -21
- pyjallib/max/hip.py +239 -366
- pyjallib/max/kneeBone.py +517 -0
- pyjallib/max/macro/jal_macro_align.py +11 -10
- pyjallib/max/macro/jal_macro_bone.py +2 -1
- 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 +258 -475
- pyjallib/max/twistBoneChain.py +162 -0
- pyjallib/max/volumeBone.py +273 -0
- pyjallib/max/volumeBoneChain.py +363 -0
- pyjallib/namePart.py +16 -16
- pyjallib/nameToPath.py +1 -1
- pyjallib/naming.py +15 -16
- pyjallib/namingConfig.py +3 -3
- {pyjallib-0.1.9.dist-info → pyjallib-0.1.10.dist-info}/METADATA +1 -1
- pyjallib-0.1.10.dist-info/RECORD +46 -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.10.dist-info}/WHEEL +0 -0
@@ -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)
|