pyjallib 0.1.17__py3-none-any.whl → 0.1.20__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 +5 -4
- pyjallib/exceptions.py +75 -0
- pyjallib/logger.py +152 -65
- pyjallib/max/__init__.py +8 -0
- pyjallib/max/autoClavicle.py +17 -5
- pyjallib/max/bone.py +21 -1
- pyjallib/max/boneChain.py +2 -0
- pyjallib/max/constraint.py +27 -2
- pyjallib/max/elbow.py +105 -0
- pyjallib/max/groinBone.py +2 -0
- pyjallib/max/header.py +121 -113
- pyjallib/max/hip.py +2 -0
- pyjallib/max/inguinal.py +117 -0
- pyjallib/max/kneeBone.py +2 -0
- pyjallib/max/macro/jal_macro_bone.py +221 -8
- pyjallib/max/macro/jal_macro_constraint.py +30 -0
- pyjallib/max/mirror.py +20 -13
- pyjallib/max/shoulder.py +173 -0
- pyjallib/max/toolManager.py +22 -6
- pyjallib/max/twistBone.py +22 -19
- pyjallib/max/ui/__init__.py +10 -0
- pyjallib/max/volumeBone.py +12 -1
- pyjallib/max/wrist.py +113 -0
- pyjallib/nameToPath.py +78 -61
- pyjallib/perforce.py +101 -171
- pyjallib/ue5/inUnreal/animationImporter.py +111 -19
- pyjallib/ue5/inUnreal/baseImporter.py +10 -7
- pyjallib/ue5/inUnreal/skeletalMeshImporter.py +1 -1
- pyjallib/ue5/inUnreal/skeletonImporter.py +1 -1
- pyjallib/ue5/logger.py +152 -111
- pyjallib/ue5/templateProcessor.py +35 -2
- pyjallib/ue5/templates/__init__.py +6 -3
- pyjallib/ue5/templates/batchAnimImportTemplate.py +21 -0
- {pyjallib-0.1.17.dist-info → pyjallib-0.1.20.dist-info}/METADATA +1 -1
- {pyjallib-0.1.17.dist-info → pyjallib-0.1.20.dist-info}/RECORD +36 -29
- {pyjallib-0.1.17.dist-info → pyjallib-0.1.20.dist-info}/WHEEL +0 -0
pyjallib/max/elbow.py
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
"""
|
5
|
+
팔꿈치 모듈
|
6
|
+
자동으로 팔꿈치 본을 생성.
|
7
|
+
"""
|
8
|
+
|
9
|
+
from pymxs import runtime as rt
|
10
|
+
|
11
|
+
from .volumeBone import VolumeBone
|
12
|
+
from .boneChain import BoneChain
|
13
|
+
|
14
|
+
class Elbow(VolumeBone):
|
15
|
+
def __init__(self, nameService=None, animService=None, constraintService=None, boneService=None, helperService=None):
|
16
|
+
super().__init__(nameService=nameService, animService=animService, constraintService=constraintService, boneService=boneService, helperService=helperService)
|
17
|
+
|
18
|
+
def create_bones(self, inForeArm, inUpperArm, inRotScale=0.5, inVolumeSize=4.0, inRotAxis="Z", inElbowTransAxis="PosY", inInnerElbowTransAxis="NegY", inElbowTransScale=0.25, inInnerElbowTransScale=1.0):
|
19
|
+
"""팔꿈치 볼륨 본들을 생성합니다."""
|
20
|
+
if not rt.isValidNode(inForeArm) or not rt.isValidNode(inUpperArm):
|
21
|
+
return False
|
22
|
+
|
23
|
+
# 이름 생성 (로컬 변수로 처리)
|
24
|
+
filteringChar = self.name._get_filtering_char(inUpperArm.name)
|
25
|
+
elbowName = self.name.replace_name_part("RealName", inUpperArm.name, "Elbow")
|
26
|
+
elbowRootName = self.name.replace_name_part("RealName", elbowName, "Elbow" + filteringChar + "Root")
|
27
|
+
elbowRootDumName = self.name.replace_name_part("Type", elbowRootName, self.name.get_name_part_value_by_description("Type", "Dummy"))
|
28
|
+
elbowFwdName = self.name.replace_name_part("RealName", elbowName, "Elbow" + filteringChar + "Fwd")
|
29
|
+
elbowBckName = self.name.replace_name_part("RealName", elbowName, "Elbow" + filteringChar + "Bck")
|
30
|
+
|
31
|
+
# 소문자 처리
|
32
|
+
if inUpperArm.name[0].islower():
|
33
|
+
elbowName = elbowName.lower()
|
34
|
+
elbowRootName = elbowRootName.lower()
|
35
|
+
elbowRootDumName = elbowRootDumName.lower()
|
36
|
+
elbowFwdName = elbowFwdName.lower()
|
37
|
+
elbowBckName = elbowBckName.lower()
|
38
|
+
|
39
|
+
# 방향 결정
|
40
|
+
facingDirVec = inForeArm.transform.position - inUpperArm.transform.position
|
41
|
+
inObjXAxisVec = inForeArm.objectTransform.row1
|
42
|
+
distanceDir = 1.0 if rt.dot(inObjXAxisVec, facingDirVec) > 0 else -1.0
|
43
|
+
|
44
|
+
# 축과 스케일 설정 - 모든 배열의 길이를 맞춤
|
45
|
+
rotAxises = [inRotAxis, inRotAxis] # 2개의 볼륨 본이므로 같은 회전축을 2번
|
46
|
+
transAxises = [inElbowTransAxis, inInnerElbowTransAxis]
|
47
|
+
transScales = [inElbowTransScale, inInnerElbowTransScale]
|
48
|
+
transAxisNames = [inElbowTransAxis, inInnerElbowTransAxis]
|
49
|
+
|
50
|
+
if distanceDir < 0:
|
51
|
+
transScales = [inInnerElbowTransScale, inElbowTransScale]
|
52
|
+
transAxisNames = [inInnerElbowTransAxis, inElbowTransAxis]
|
53
|
+
|
54
|
+
# 부모 클래스의 create_bones 호출
|
55
|
+
volumeBoneResult = super().create_bones(inForeArm, inUpperArm, inRotScale, inVolumeSize, rotAxises, transAxises, transScales)
|
56
|
+
|
57
|
+
# volumeBoneResult가 None이면 실패 반환
|
58
|
+
if not volumeBoneResult:
|
59
|
+
return None
|
60
|
+
|
61
|
+
# 생성된 본들의 이름 변경
|
62
|
+
if hasattr(volumeBoneResult, 'bones') and volumeBoneResult.bones:
|
63
|
+
for item in volumeBoneResult.bones:
|
64
|
+
if rt.matchPattern(item.name.lower(), pattern="*root*"):
|
65
|
+
item.name = elbowRootName
|
66
|
+
elif rt.matchPattern(item.name.lower(), pattern="*"+transAxisNames[0].lower()+"*"):
|
67
|
+
item.name = elbowBckName
|
68
|
+
elif rt.matchPattern(item.name.lower(), pattern="*"+transAxisNames[1].lower()+"*"):
|
69
|
+
item.name = elbowFwdName
|
70
|
+
|
71
|
+
# 생성된 헬퍼들의 이름 변경
|
72
|
+
if hasattr(volumeBoneResult, 'helpers') and volumeBoneResult.helpers:
|
73
|
+
for item in volumeBoneResult.helpers:
|
74
|
+
if rt.matchPattern(item.name.lower(), pattern="*root*"):
|
75
|
+
item.name = elbowRootDumName
|
76
|
+
|
77
|
+
rt.redrawViews()
|
78
|
+
|
79
|
+
return volumeBoneResult
|
80
|
+
|
81
|
+
def create_bones_from_chain(self, inBoneChain: BoneChain):
|
82
|
+
"""기존 BoneChain에서 팔꿈치 본들을 재생성합니다."""
|
83
|
+
if not inBoneChain or inBoneChain.is_empty():
|
84
|
+
return None
|
85
|
+
|
86
|
+
inBoneChain.delete()
|
87
|
+
|
88
|
+
sourceBones = inBoneChain.sourceBones
|
89
|
+
parameters = inBoneChain.parameters
|
90
|
+
|
91
|
+
if len(sourceBones) < 2 or not rt.isValidNode(sourceBones[0]) or not rt.isValidNode(sourceBones[1]):
|
92
|
+
return None
|
93
|
+
|
94
|
+
# 매개변수 추출
|
95
|
+
inForeArm = sourceBones[0]
|
96
|
+
inUpperArm = sourceBones[1]
|
97
|
+
inRotScale = parameters[0] if len(parameters) > 0 else 0.5
|
98
|
+
inVolumeSize = parameters[1] if len(parameters) > 1 else 4.0
|
99
|
+
inRotAxis = parameters[2] if len(parameters) > 2 else "Z"
|
100
|
+
inElbowTransAxis = parameters[3] if len(parameters) > 3 else "PosY"
|
101
|
+
inInnerElbowTransAxis = parameters[4] if len(parameters) > 4 else "NegY"
|
102
|
+
inElbowTransScale = parameters[5] if len(parameters) > 5 else 0.25
|
103
|
+
inInnerElbowTransScale = parameters[6] if len(parameters) > 6 else 1.0
|
104
|
+
|
105
|
+
return self.create_bones(inForeArm, inUpperArm, inRotScale, inVolumeSize, inRotAxis, inElbowTransAxis, inInnerElbowTransAxis, inElbowTransScale, inInnerElbowTransScale)
|
pyjallib/max/groinBone.py
CHANGED
pyjallib/max/header.py
CHANGED
@@ -1,114 +1,122 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
|
4
|
-
"""
|
5
|
-
헤더 모듈 - max 패키지의 인스턴스 관리
|
6
|
-
3DS Max가 실행될 때 메모리에 한번만 로드되는 패키지 인스턴스들을 관리
|
7
|
-
"""
|
8
|
-
|
9
|
-
import os
|
10
|
-
|
11
|
-
from .name import Name
|
12
|
-
from .anim import Anim
|
13
|
-
|
14
|
-
from .helper import Helper
|
15
|
-
from .constraint import Constraint
|
16
|
-
from .bone import Bone
|
17
|
-
|
18
|
-
from .mirror import Mirror
|
19
|
-
from .layer import Layer
|
20
|
-
from .align import Align
|
21
|
-
from .select import Select
|
22
|
-
from .link import Link
|
23
|
-
|
24
|
-
from .bip import Bip
|
25
|
-
from .skin import Skin
|
26
|
-
from .skeleton import Skeleton
|
27
|
-
|
28
|
-
from .twistBone import TwistBone
|
29
|
-
from .autoClavicle import AutoClavicle
|
30
|
-
from .
|
31
|
-
from .
|
32
|
-
from .
|
33
|
-
from .
|
34
|
-
|
35
|
-
from .
|
36
|
-
|
37
|
-
from .
|
38
|
-
|
39
|
-
from .
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
self.
|
65
|
-
|
66
|
-
|
67
|
-
self.
|
68
|
-
self.
|
69
|
-
|
70
|
-
self.
|
71
|
-
self.
|
72
|
-
self.
|
73
|
-
|
74
|
-
self.
|
75
|
-
|
76
|
-
self.
|
77
|
-
self.
|
78
|
-
self.
|
79
|
-
|
80
|
-
self.
|
81
|
-
self.
|
82
|
-
self.
|
83
|
-
|
84
|
-
self.
|
85
|
-
self.
|
86
|
-
|
87
|
-
self.
|
88
|
-
|
89
|
-
self.
|
90
|
-
|
91
|
-
self.
|
92
|
-
|
93
|
-
self.
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
"""
|
5
|
+
헤더 모듈 - max 패키지의 인스턴스 관리
|
6
|
+
3DS Max가 실행될 때 메모리에 한번만 로드되는 패키지 인스턴스들을 관리
|
7
|
+
"""
|
8
|
+
|
9
|
+
import os
|
10
|
+
|
11
|
+
from .name import Name
|
12
|
+
from .anim import Anim
|
13
|
+
|
14
|
+
from .helper import Helper
|
15
|
+
from .constraint import Constraint
|
16
|
+
from .bone import Bone
|
17
|
+
|
18
|
+
from .mirror import Mirror
|
19
|
+
from .layer import Layer
|
20
|
+
from .align import Align
|
21
|
+
from .select import Select
|
22
|
+
from .link import Link
|
23
|
+
|
24
|
+
from .bip import Bip
|
25
|
+
from .skin import Skin
|
26
|
+
from .skeleton import Skeleton
|
27
|
+
|
28
|
+
from .twistBone import TwistBone
|
29
|
+
from .autoClavicle import AutoClavicle
|
30
|
+
from .shoulder import Shoulder
|
31
|
+
from .groinBone import GroinBone
|
32
|
+
from .volumeBone import VolumeBone
|
33
|
+
from .elbow import Elbow
|
34
|
+
from .wrist import Wrist
|
35
|
+
from .inguinal import Inguinal
|
36
|
+
from .kneeBone import KneeBone
|
37
|
+
from .hip import Hip
|
38
|
+
|
39
|
+
from .morph import Morph
|
40
|
+
|
41
|
+
from .rootMotion import RootMotion
|
42
|
+
|
43
|
+
from .fbxHandler import FBXHandler
|
44
|
+
from .toolManager import ToolManager
|
45
|
+
|
46
|
+
class Header:
|
47
|
+
"""
|
48
|
+
JalLib.max 패키지의 헤더 모듈
|
49
|
+
3DS Max에서 사용하는 다양한 기능을 제공하는 클래스들을 초기화하고 관리합니다.
|
50
|
+
"""
|
51
|
+
_instance = None
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def get_instance(cls):
|
55
|
+
"""싱글톤 패턴을 구현한 인스턴스 접근 메소드"""
|
56
|
+
if cls._instance is None:
|
57
|
+
cls._instance = Header()
|
58
|
+
return cls._instance
|
59
|
+
|
60
|
+
def __init__(self):
|
61
|
+
"""
|
62
|
+
Header 클래스 초기화
|
63
|
+
"""
|
64
|
+
self.configDir = os.path.join(os.path.dirname(__file__), "ConfigFiles")
|
65
|
+
self.nameConfigDir = os.path.join(self.configDir, "3DSMaxNamingConfig.json")
|
66
|
+
|
67
|
+
self.name = Name(configPath=self.nameConfigDir)
|
68
|
+
self.anim = Anim()
|
69
|
+
|
70
|
+
self.helper = Helper(nameService=self.name)
|
71
|
+
self.constraint = Constraint(nameService=self.name, helperService=self.helper)
|
72
|
+
self.bone = Bone(nameService=self.name, animService=self.anim, helperService=self.helper, constraintService=self.constraint)
|
73
|
+
|
74
|
+
self.mirror = Mirror(nameService=self.name, boneService=self.bone)
|
75
|
+
self.layer = Layer()
|
76
|
+
self.align = Align()
|
77
|
+
self.sel = Select(nameService=self.name, boneService=self.bone)
|
78
|
+
self.link = Link()
|
79
|
+
|
80
|
+
self.bip = Bip(animService=self.anim, nameService=self.name, boneService=self.bone)
|
81
|
+
self.skin = Skin()
|
82
|
+
self.skeleton = Skeleton(animService=self.anim, nameService=self.name, boneService=self.bone, bipService=self.bip, layerService=self.layer)
|
83
|
+
|
84
|
+
self.twistBone = TwistBone(nameService=self.name, animService=self.anim, constraintService=self.constraint, bipService=self.bip, boneService=self.bone)
|
85
|
+
self.groinBone = GroinBone(nameService=self.name, animService=self.anim, constraintService=self.constraint, boneService=self.bone, helperService=self.helper)
|
86
|
+
self.autoClavicle = AutoClavicle(nameService=self.name, animService=self.anim, helperService=self.helper, boneService=self.bone, constraintService=self.constraint, bipService=self.bip)
|
87
|
+
self.shoulder = Shoulder(nameService=self.name, animService=self.anim, helperService=self.helper, boneService=self.bone, constraintService=self.constraint, bipService=self.bip)
|
88
|
+
self.volumeBone = VolumeBone(nameService=self.name, animService=self.anim, constraintService=self.constraint, boneService=self.bone, helperService=self.helper)
|
89
|
+
self.elbow = Elbow(nameService=self.name, animService=self.anim, constraintService=self.constraint, boneService=self.bone, helperService=self.helper)
|
90
|
+
self.wrist = Wrist(nameService=self.name, animService=self.anim, constraintService=self.constraint, boneService=self.bone, helperService=self.helper)
|
91
|
+
self.inguinal = Inguinal(nameService=self.name, animService=self.anim, constraintService=self.constraint, boneService=self.bone, helperService=self.helper)
|
92
|
+
self.kneeBone = KneeBone(nameService=self.name, animService=self.anim, constraintService=self.constraint, boneService=self.bone, helperService=self.helper, volumeBoneService=self.volumeBone)
|
93
|
+
self.hip = Hip(nameService=self.name, animService=self.anim, helperService=self.helper, boneService=self.bone, constraintService=self.constraint)
|
94
|
+
|
95
|
+
self.morph = Morph()
|
96
|
+
|
97
|
+
self.rootMotion = RootMotion(nameService=self.name, animService=self.anim, constraintService=self.constraint, helperService=self.helper, bipService=self.bip)
|
98
|
+
|
99
|
+
self.fbx = FBXHandler()
|
100
|
+
|
101
|
+
self.toolManager = ToolManager()
|
102
|
+
|
103
|
+
def update_nameConifg(self, configPath):
|
104
|
+
"""
|
105
|
+
이름 설정을 업데이트합니다.
|
106
|
+
|
107
|
+
Args:
|
108
|
+
configPath: ConfigPath 인스턴스
|
109
|
+
"""
|
110
|
+
self.name.load_from_config_file(configPath)
|
111
|
+
|
112
|
+
# 모듈 레벨에서 전역 인스턴스 생성
|
113
|
+
_pyjallibmaxheader = Header.get_instance()
|
114
|
+
|
115
|
+
def get_pyjallibmaxheader():
|
116
|
+
"""
|
117
|
+
jal 인스턴스를 반환합니다.
|
118
|
+
|
119
|
+
Returns:
|
120
|
+
Header 인스턴스
|
121
|
+
"""
|
114
122
|
return _pyjallibmaxheader
|
pyjallib/max/hip.py
CHANGED
pyjallib/max/inguinal.py
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
"""
|
5
|
+
서혜부 모듈
|
6
|
+
자동으로 서혜부 본을 생성.
|
7
|
+
"""
|
8
|
+
|
9
|
+
from pymxs import runtime as rt
|
10
|
+
|
11
|
+
from .volumeBone import VolumeBone
|
12
|
+
from .boneChain import BoneChain
|
13
|
+
|
14
|
+
class Inguinal(VolumeBone):
|
15
|
+
def __init__(self, nameService=None, animService=None, constraintService=None, boneService=None, helperService=None):
|
16
|
+
super().__init__(nameService=nameService, animService=animService, constraintService=constraintService, boneService=boneService, helperService=helperService)
|
17
|
+
|
18
|
+
def create_bones(self, inThighTwist, inPelvis, inCalf, inRotScale=0.5, inVolumeSize=6.0, inFwdRotAxis="Z", inOutRotAxis="Y", inFwdTransAxis="PosY", inOutTransAxis="PosZ", inFwdTransScale=2.0, inOutTransScale=2.0):
|
19
|
+
"""서혜부 볼륨 본들을 생성합니다."""
|
20
|
+
if not rt.isValidNode(inThighTwist) or not rt.isValidNode(inPelvis) or not rt.isValidNode(inCalf):
|
21
|
+
return False
|
22
|
+
|
23
|
+
# 이름 생성 (로컬 변수로 처리)
|
24
|
+
filteringChar = self.name._get_filtering_char(inThighTwist.name)
|
25
|
+
inguinalName = self.name.replace_name_part("RealName", inThighTwist.name, "Inguinal")
|
26
|
+
inguinalName = self.name.remove_name_part("Nub", inguinalName)
|
27
|
+
inguinalName = self.name.remove_name_part("Index", inguinalName)
|
28
|
+
inguinalRootName = self.name.replace_name_part("RealName", inguinalName, "Inguinal" + filteringChar + "Root")
|
29
|
+
inguinalRootDumName = self.name.replace_name_part("Type", inguinalRootName, self.name.get_name_part_value_by_description("Type", "Dummy"))
|
30
|
+
inguinalFwdName = self.name.replace_name_part("RealName", inguinalName, "Inguinal" + filteringChar + "Fwd")
|
31
|
+
inguinalOutName = self.name.replace_name_part("RealName", inguinalName, "Inguinal" + filteringChar + "Out")
|
32
|
+
|
33
|
+
# 소문자 처리
|
34
|
+
if inThighTwist.name[0].islower():
|
35
|
+
inguinalName = inguinalName.lower()
|
36
|
+
inguinalRootName = inguinalRootName.lower()
|
37
|
+
inguinalRootDumName = inguinalRootDumName.lower()
|
38
|
+
inguinalFwdName = inguinalFwdName.lower()
|
39
|
+
inguinalOutName = inguinalOutName.lower()
|
40
|
+
|
41
|
+
# 방향 결정
|
42
|
+
facingDirVec = inCalf.transform.position - inThighTwist.transform.position
|
43
|
+
inObjXAxisVec = inThighTwist.objectTransform.row1
|
44
|
+
distanceDir = 1.0 if rt.dot(inObjXAxisVec, facingDirVec) > 0 else -1.0
|
45
|
+
|
46
|
+
# 축과 스케일 설정 - 2개의 볼륨 본: Fwd(앞), Out(바깥)
|
47
|
+
rotAxises = [inFwdRotAxis, inOutRotAxis]
|
48
|
+
transAxises = [inFwdTransAxis, inOutTransAxis]
|
49
|
+
transScales = [inFwdTransScale, inOutTransScale]
|
50
|
+
transAxisNames = [inFwdTransAxis, inOutTransAxis]
|
51
|
+
|
52
|
+
if distanceDir < 0:
|
53
|
+
# Neg 접두사를 Pos로 변환하여 방향 전환
|
54
|
+
transAxises = ["Neg" + inFwdTransAxis[3:], "Neg" + inOutTransAxis[3:]]
|
55
|
+
transAxisNames = [transAxises[0], transAxises[1]]
|
56
|
+
|
57
|
+
# 부모 클래스의 create_bones 호출
|
58
|
+
volumeBoneResult = super().create_bones(inThighTwist, inPelvis, inRotScale, inVolumeSize, rotAxises, transAxises, transScales)
|
59
|
+
|
60
|
+
# volumeBoneResult가 None이면 실패 반환
|
61
|
+
if not volumeBoneResult:
|
62
|
+
return None
|
63
|
+
|
64
|
+
# 생성된 본들의 이름 변경
|
65
|
+
if hasattr(volumeBoneResult, 'bones') and volumeBoneResult.bones:
|
66
|
+
for item in volumeBoneResult.bones:
|
67
|
+
if rt.matchPattern(item.name.lower(), pattern="*root*"):
|
68
|
+
item.name = inguinalRootName
|
69
|
+
elif rt.matchPattern(item.name.lower(), pattern="*" + transAxisNames[0].lower() + "*"):
|
70
|
+
item.name = inguinalFwdName
|
71
|
+
elif rt.matchPattern(item.name.lower(), pattern="*" + transAxisNames[1].lower() + "*"):
|
72
|
+
item.name = inguinalOutName
|
73
|
+
|
74
|
+
# 생성된 헬퍼들의 이름 변경
|
75
|
+
if hasattr(volumeBoneResult, 'helpers') and volumeBoneResult.helpers:
|
76
|
+
for item in volumeBoneResult.helpers:
|
77
|
+
if rt.matchPattern(item.name.lower(), pattern="*root*"):
|
78
|
+
item.name = inguinalRootDumName
|
79
|
+
|
80
|
+
result = {
|
81
|
+
"Bones": volumeBoneResult.bones,
|
82
|
+
"Helpers": volumeBoneResult.helpers,
|
83
|
+
"SourceBones": [inThighTwist, inPelvis, inCalf],
|
84
|
+
"Parameters": [inRotScale, inVolumeSize, inFwdRotAxis, inOutRotAxis, inFwdTransAxis, inOutTransAxis, inFwdTransScale, inOutTransScale]
|
85
|
+
}
|
86
|
+
|
87
|
+
rt.redrawViews()
|
88
|
+
|
89
|
+
return BoneChain.from_result(result)
|
90
|
+
|
91
|
+
def create_bones_from_chain(self, inBoneChain: BoneChain):
|
92
|
+
"""기존 BoneChain에서 서혜부 본들을 재생성합니다."""
|
93
|
+
if not inBoneChain or inBoneChain.is_empty():
|
94
|
+
return None
|
95
|
+
|
96
|
+
inBoneChain.delete()
|
97
|
+
|
98
|
+
sourceBones = inBoneChain.sourceBones
|
99
|
+
parameters = inBoneChain.parameters
|
100
|
+
|
101
|
+
if len(sourceBones) < 3 or not rt.isValidNode(sourceBones[0]) or not rt.isValidNode(sourceBones[1]) or not rt.isValidNode(sourceBones[2]):
|
102
|
+
return None
|
103
|
+
|
104
|
+
# 매개변수 추출
|
105
|
+
inThighTwist = sourceBones[0]
|
106
|
+
inPelvis = sourceBones[1]
|
107
|
+
inCalf = sourceBones[2]
|
108
|
+
inRotScale = parameters[0] if len(parameters) > 0 else 0.5
|
109
|
+
inVolumeSize = parameters[1] if len(parameters) > 1 else 6.0
|
110
|
+
inFwdRotAxis = parameters[2] if len(parameters) > 2 else "Z"
|
111
|
+
inOutRotAxis = parameters[3] if len(parameters) > 3 else "Y"
|
112
|
+
inFwdTransAxis = parameters[4] if len(parameters) > 4 else "PosY"
|
113
|
+
inOutTransAxis = parameters[5] if len(parameters) > 5 else "PosZ"
|
114
|
+
inFwdTransScale = parameters[6] if len(parameters) > 6 else 2.0
|
115
|
+
inOutTransScale = parameters[7] if len(parameters) > 7 else 2.0
|
116
|
+
|
117
|
+
return self.create_bones(inThighTwist, inPelvis, inCalf, inRotScale, inVolumeSize, inFwdRotAxis, inOutRotAxis, inFwdTransAxis, inOutTransAxis, inFwdTransScale, inOutTransScale)
|