pyjallib 0.1.8__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 +100 -92
- pyjallib/max/autoClavicleChain.py +173 -0
- pyjallib/max/bip.py +211 -14
- pyjallib/max/bone.py +348 -16
- pyjallib/max/constraint.py +29 -38
- pyjallib/max/groinBone.py +109 -39
- pyjallib/max/groinBoneChain.py +173 -0
- pyjallib/max/header.py +40 -6
- pyjallib/max/helper.py +3 -21
- pyjallib/max/hip.py +239 -0
- 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 +259 -476
- 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/perforce.py +446 -653
- {pyjallib-0.1.8.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 -171
- pyjallib-0.1.8.dist-info/RECORD +0 -39
- {pyjallib-0.1.8.dist-info → pyjallib-0.1.10.dist-info}/WHEEL +0 -0
pyjallib/max/bone.py
CHANGED
@@ -239,7 +239,7 @@ class Bone:
|
|
239
239
|
nubBone.backfin = False
|
240
240
|
nubBone.sidefins = False
|
241
241
|
nubBone.name = self.name.remove_name_part("Index", inName)
|
242
|
-
nubBone.name = self.name.replace_name_part("Nub", nubBone.name, "Nub")
|
242
|
+
nubBone.name = self.name.replace_name_part("Nub", nubBone.name, self.name.get_name_part_value_by_description("Nub", "Nub"))
|
243
243
|
|
244
244
|
# 화면 갱신 재개
|
245
245
|
rt.enableSceneRedraw()
|
@@ -679,18 +679,18 @@ class Bone:
|
|
679
679
|
inOriBone: 원본 뼈대
|
680
680
|
"""
|
681
681
|
self.anim.save_xform(inSkinBone)
|
682
|
-
self.anim.set_xform(inSkinBone)
|
682
|
+
self.anim.set_xform(inSkinBone, space="World")
|
683
683
|
|
684
684
|
self.anim.save_xform(inOriBone)
|
685
|
-
self.anim.set_xform(inOriBone)
|
686
685
|
|
687
686
|
rt.setPropertyController(inSkinBone.controller, "Scale", rt.scaleXYZ())
|
688
687
|
|
689
688
|
linkConst = rt.link_constraint()
|
689
|
+
linkConst.addTarget(inOriBone, 0)
|
690
|
+
|
690
691
|
inSkinBone.controller = linkConst
|
691
692
|
|
692
|
-
self.anim.set_xform(
|
693
|
-
linkConst.addTarget(inOriBone, 0)
|
693
|
+
self.anim.set_xform(inSkinBone, space="World")
|
694
694
|
|
695
695
|
def link_skin_bones(self, inSkinBoneArray, inOriBoneArray):
|
696
696
|
"""
|
@@ -705,14 +705,52 @@ class Bone:
|
|
705
705
|
False: 실패
|
706
706
|
"""
|
707
707
|
if len(inSkinBoneArray) != len(inOriBoneArray):
|
708
|
+
print("Error: Skin bone array and original bone array must have the same length.")
|
708
709
|
return False
|
709
710
|
|
710
|
-
|
711
|
-
|
711
|
+
skinBoneDict = {}
|
712
|
+
oriBoneDict = {}
|
713
|
+
|
714
|
+
# 스킨 뼈대 딕셔너리 생성 (이름과 패턴화된 이름을 함께 저장)
|
715
|
+
for item in inSkinBoneArray:
|
716
|
+
# 아이템 저장
|
717
|
+
skinBoneDict[item.name] = item
|
718
|
+
# 언더스코어를 별표로 변환한 패턴 생성
|
719
|
+
namePattern = self.name.remove_name_part("Base", item.name)
|
720
|
+
namePattern = namePattern.replace("_", "*")
|
721
|
+
skinBoneDict[item.name + "_Pattern"] = namePattern
|
722
|
+
|
723
|
+
# 원본 뼈대 딕셔너리 생성 (이름과 패턴화된 이름을 함께 저장)
|
724
|
+
for item in inOriBoneArray:
|
725
|
+
# 아이템 저장
|
726
|
+
oriBoneDict[item.name] = item
|
727
|
+
# 공백을 별표로 변환한 패턴 생성
|
728
|
+
namePattern = self.name.remove_name_part("Base", item.name)
|
729
|
+
namePattern = namePattern.replace(" ", "*")
|
730
|
+
oriBoneDict[item.name + "_Pattern"] = namePattern
|
731
|
+
|
732
|
+
# 정렬된 배열 생성
|
733
|
+
sortedSkinBoneArray = []
|
734
|
+
sortedOriBoneArray = []
|
735
|
+
|
736
|
+
# 같은 패턴을 가진 뼈대들을 찾아 매칭
|
737
|
+
for skinName, skinBone in [(k, v) for k, v in skinBoneDict.items() if not k.endswith("_Pattern")]:
|
738
|
+
skinPattern = skinBoneDict[skinName + "_Pattern"]
|
739
|
+
|
740
|
+
for oriName, oriBone in [(k, v) for k, v in oriBoneDict.items() if not k.endswith("_Pattern")]:
|
741
|
+
oriPattern = oriBoneDict[oriName + "_Pattern"]
|
742
|
+
|
743
|
+
if rt.matchPattern(skinName, pattern=oriPattern):
|
744
|
+
sortedSkinBoneArray.append(skinBone)
|
745
|
+
sortedOriBoneArray.append(oriBone)
|
746
|
+
break
|
747
|
+
# 링크 연결 수행
|
748
|
+
for i in range(len(sortedSkinBoneArray)):
|
749
|
+
self.link_skin_bone(sortedSkinBoneArray[i], sortedOriBoneArray[i])
|
712
750
|
|
713
751
|
return True
|
714
752
|
|
715
|
-
def create_skin_bone(self, inBoneArray, skipNub=True, mesh=True, link=True, skinBoneBaseName="
|
753
|
+
def create_skin_bone(self, inBoneArray, skipNub=True, mesh=True, link=True, skinBoneBaseName=""):
|
716
754
|
"""
|
717
755
|
스킨 뼈대 생성.
|
718
756
|
|
@@ -731,11 +769,13 @@ class Bone:
|
|
731
769
|
skinBonePushAmount = -0.02
|
732
770
|
returnBones = []
|
733
771
|
|
772
|
+
definedSkinBoneBaseName = self.name.get_name_part_value_by_description("Base", "SkinBone")
|
773
|
+
|
734
774
|
for i in range(len(inBoneArray)):
|
735
|
-
skinBoneName = self.name.
|
775
|
+
skinBoneName = self.name.replace_name_part("Base", inBoneArray[i].name, definedSkinBoneBaseName)
|
736
776
|
skinBoneName = self.name.replace_filtering_char(skinBoneName, skinBoneFilteringChar)
|
737
777
|
|
738
|
-
skinBone = self.create_nub_bone("
|
778
|
+
skinBone = self.create_nub_bone(f"{definedSkinBoneBaseName}_TempSkin", 2)
|
739
779
|
skinBone.name = skinBoneName
|
740
780
|
skinBone.wireColor = rt.Color(255, 88, 199)
|
741
781
|
skinBone.transform = inBoneArray[i].transform
|
@@ -753,25 +793,32 @@ class Bone:
|
|
753
793
|
|
754
794
|
skinBone.boneEnable = True
|
755
795
|
skinBone.renderable = False
|
756
|
-
skinBone.boneScaleType = rt.Name("
|
796
|
+
skinBone.boneScaleType = rt.Name("None")
|
757
797
|
|
758
798
|
bones.append(skinBone)
|
759
799
|
|
760
800
|
for i in range(len(inBoneArray)):
|
761
801
|
oriParentObj = inBoneArray[i].parent
|
762
802
|
if oriParentObj is not None:
|
763
|
-
skinBoneParentObjName = self.name.
|
803
|
+
skinBoneParentObjName = self.name.replace_name_part("Base", oriParentObj.name, definedSkinBoneBaseName)
|
764
804
|
skinBoneParentObjName = self.name.replace_filtering_char(skinBoneParentObjName, skinBoneFilteringChar)
|
765
805
|
bones[i].parent = rt.getNodeByName(skinBoneParentObjName)
|
766
806
|
else:
|
767
807
|
bones[i].parent = None
|
768
808
|
|
809
|
+
for item in bones:
|
810
|
+
item.showLinks = True
|
811
|
+
item.showLinksOnly = True
|
812
|
+
|
813
|
+
for item in bones:
|
814
|
+
item.name = self.name.replace_name_part("Base", item.name, skinBoneBaseName)
|
815
|
+
|
769
816
|
if link:
|
770
817
|
self.link_skin_bones(bones, inBoneArray)
|
771
818
|
|
772
819
|
if skipNub:
|
773
820
|
for item in bones:
|
774
|
-
if not rt.matchPattern(item.name, pattern=("*" + self.name.
|
821
|
+
if not rt.matchPattern(item.name, pattern=("*" + self.name.get_name_part_value_by_description("Nub", "Nub"))):
|
775
822
|
returnBones.append(item)
|
776
823
|
else:
|
777
824
|
rt.delete(item)
|
@@ -782,7 +829,7 @@ class Bone:
|
|
782
829
|
|
783
830
|
return returnBones
|
784
831
|
|
785
|
-
def create_skin_bone_from_bip(self, inBoneArray, skipNub=True, mesh=False, link=True, skinBoneBaseName="
|
832
|
+
def create_skin_bone_from_bip(self, inBoneArray, skipNub=True, mesh=False, link=True, skinBoneBaseName=""):
|
786
833
|
"""
|
787
834
|
바이페드 객체에서 스킨 뼈대 생성.
|
788
835
|
|
@@ -791,7 +838,7 @@ class Bone:
|
|
791
838
|
skipNub: Nub 뼈대 건너뛰기 (기본값: True)
|
792
839
|
mesh: 메시 스냅샷 사용 (기본값: False)
|
793
840
|
link: 원본 뼈대에 연결 (기본값: True)
|
794
|
-
skinBoneBaseName: 스킨 뼈대 기본 이름 (기본값: "
|
841
|
+
skinBoneBaseName: 스킨 뼈대 기본 이름 (기본값: "")
|
795
842
|
|
796
843
|
Returns:
|
797
844
|
생성된 스킨 뼈대 배열
|
@@ -806,7 +853,7 @@ class Bone:
|
|
806
853
|
|
807
854
|
return returnSkinBones
|
808
855
|
|
809
|
-
def create_skin_bone_from_bip_for_unreal(self, inBoneArray, skipNub=True, mesh=False, link=True, skinBoneBaseName="
|
856
|
+
def create_skin_bone_from_bip_for_unreal(self, inBoneArray, skipNub=True, mesh=False, link=True, skinBoneBaseName=""):
|
810
857
|
"""
|
811
858
|
언리얼 엔진용 바이페드 객체에서 스킨 뼈대 생성.
|
812
859
|
|
@@ -837,6 +884,291 @@ class Bone:
|
|
837
884
|
|
838
885
|
return genBones
|
839
886
|
|
887
|
+
def gen_missing_bip_bones_for_ue5manny(self, inBoneArray):
|
888
|
+
returnBones = []
|
889
|
+
spine3 = None
|
890
|
+
neck = None
|
891
|
+
|
892
|
+
handL = None
|
893
|
+
handR = None
|
894
|
+
|
895
|
+
fingerNames = ["index", "middle", "ring", "pinky"]
|
896
|
+
knuckleName = "metacarpal"
|
897
|
+
lKnuckleDistance = []
|
898
|
+
rKnuckleDistance = []
|
899
|
+
|
900
|
+
lFingers = []
|
901
|
+
rFingers = []
|
902
|
+
|
903
|
+
for item in inBoneArray:
|
904
|
+
if rt.matchPattern(item.name, pattern="*spine 03"):
|
905
|
+
spine3 = item
|
906
|
+
if rt.matchPattern(item.name, pattern="*neck 01"):
|
907
|
+
neck = item
|
908
|
+
if rt.matchPattern(item.name, pattern="*hand*l"):
|
909
|
+
handL = item
|
910
|
+
if rt.matchPattern(item.name, pattern="*hand*r"):
|
911
|
+
handR = item
|
912
|
+
|
913
|
+
for fingerName in fingerNames:
|
914
|
+
if rt.matchPattern(item.name, pattern="*"+fingerName+"*01*l"):
|
915
|
+
lFingers.append(item)
|
916
|
+
if rt.matchPattern(item.name, pattern="*"+fingerName+"*01*r"):
|
917
|
+
rFingers.append(item)
|
918
|
+
for finger in lFingers:
|
919
|
+
fingerDistance = rt.distance(finger, handL)
|
920
|
+
lKnuckleDistance.append(fingerDistance)
|
921
|
+
for finger in rFingers:
|
922
|
+
fingerDistance = rt.distance(finger, handR)
|
923
|
+
rKnuckleDistance.append(fingerDistance)
|
924
|
+
|
925
|
+
filteringChar = self.name._get_filtering_char(inBoneArray[-1].name)
|
926
|
+
isLower = inBoneArray[-1].name[0].islower()
|
927
|
+
spineName = self.name.get_name_part_value_by_description("Base", "Biped") + filteringChar + "Spine"
|
928
|
+
|
929
|
+
spine4 = self.create_nub_bone(spineName, 2)
|
930
|
+
spine5 = self.create_nub_bone(spineName, 2)
|
931
|
+
|
932
|
+
spine4.name = self.name.replace_name_part("Index", spine4.name, "4")
|
933
|
+
spine4.name = self.name.remove_name_part("Nub", spine4.name)
|
934
|
+
spine5.name = self.name.replace_name_part("Index", spine5.name, "5")
|
935
|
+
spine5.name = self.name.remove_name_part("Nub", spine5.name)
|
936
|
+
if isLower:
|
937
|
+
spine4.name = spine4.name.lower()
|
938
|
+
spine5.name = spine5.name.lower()
|
939
|
+
|
940
|
+
spineDistance = rt.distance(spine3, neck)/3.0
|
941
|
+
rt.setProperty(spine4, "transform", spine3.transform)
|
942
|
+
rt.setProperty(spine5, "transform", spine3.transform)
|
943
|
+
self.anim.move_local(spine4, spineDistance, 0, 0)
|
944
|
+
self.anim.move_local(spine5, spineDistance * 2, 0, 0)
|
945
|
+
|
946
|
+
returnBones.append(spine4)
|
947
|
+
returnBones.append(spine5)
|
948
|
+
|
949
|
+
for i, finger in enumerate(lFingers):
|
950
|
+
knuckleBoneName = self.name.add_suffix_to_real_name(finger.name, filteringChar+knuckleName)
|
951
|
+
knuckleBoneName = self.name.remove_name_part("Index", knuckleBoneName)
|
952
|
+
|
953
|
+
knuckleBone = self.create_nub_bone(knuckleBoneName, 2)
|
954
|
+
knuckleBone.name = self.name.remove_name_part("Nub", knuckleBone.name)
|
955
|
+
if isLower:
|
956
|
+
knuckleBone.name = knuckleBone.name.lower()
|
957
|
+
|
958
|
+
knuckleBone.transform = finger.transform
|
959
|
+
lookAtConst = self.const.assign_lookat(knuckleBone, handL)
|
960
|
+
lookAtConst.upnode_world = False
|
961
|
+
lookAtConst.pickUpNode = handL
|
962
|
+
lookAtConst.lookat_vector_length = 0.0
|
963
|
+
lookAtConst.target_axisFlip = True
|
964
|
+
self.const.collapse(knuckleBone)
|
965
|
+
self.anim.move_local(knuckleBone, -lKnuckleDistance[i]*0.8, 0, 0)
|
966
|
+
|
967
|
+
returnBones.append(knuckleBone)
|
968
|
+
|
969
|
+
for i, finger in enumerate(rFingers):
|
970
|
+
knuckleBoneName = self.name.add_suffix_to_real_name(finger.name, filteringChar+knuckleName)
|
971
|
+
knuckleBoneName = self.name.remove_name_part("Index", knuckleBoneName)
|
972
|
+
|
973
|
+
knuckleBone = self.create_nub_bone(knuckleBoneName, 2)
|
974
|
+
knuckleBone.name = self.name.remove_name_part("Nub", knuckleBone.name)
|
975
|
+
if isLower:
|
976
|
+
knuckleBone.name = knuckleBone.name.lower()
|
977
|
+
|
978
|
+
knuckleBone.transform = finger.transform
|
979
|
+
lookAtConst = self.const.assign_lookat(knuckleBone, handR)
|
980
|
+
lookAtConst.upnode_world = False
|
981
|
+
lookAtConst.pickUpNode = handR
|
982
|
+
lookAtConst.lookat_vector_length = 0.0
|
983
|
+
lookAtConst.target_axisFlip = True
|
984
|
+
self.const.collapse(knuckleBone)
|
985
|
+
self.anim.move_local(knuckleBone, -rKnuckleDistance[i]*0.8, 0, 0)
|
986
|
+
|
987
|
+
returnBones.append(knuckleBone)
|
988
|
+
|
989
|
+
return returnBones
|
990
|
+
|
991
|
+
def relink_missing_bip_bones_for_ue5manny(self, inBipArray, inMissingBoneArray):
|
992
|
+
returnBones = []
|
993
|
+
|
994
|
+
spine3 = None
|
995
|
+
|
996
|
+
handL = None
|
997
|
+
handR = None
|
998
|
+
|
999
|
+
knuckleName = "metacarpal"
|
1000
|
+
|
1001
|
+
for item in inBipArray:
|
1002
|
+
if rt.matchPattern(item.name, pattern="*spine 03"):
|
1003
|
+
spine3 = item
|
1004
|
+
if rt.matchPattern(item.name, pattern="*hand*l"):
|
1005
|
+
handL = item
|
1006
|
+
if rt.matchPattern(item.name, pattern="*hand*r"):
|
1007
|
+
handR = item
|
1008
|
+
|
1009
|
+
for item in inMissingBoneArray:
|
1010
|
+
if rt.matchPattern(item.name, pattern="*spine*"):
|
1011
|
+
item.parent = spine3
|
1012
|
+
if rt.matchPattern(item.name, pattern=f"*{knuckleName}*l"):
|
1013
|
+
item.parent = handL
|
1014
|
+
if rt.matchPattern(item.name, pattern=f"*{knuckleName}*r"):
|
1015
|
+
item.parent = handR
|
1016
|
+
|
1017
|
+
returnBones.append(inBipArray)
|
1018
|
+
returnBones.append(inMissingBoneArray)
|
1019
|
+
return returnBones
|
1020
|
+
|
1021
|
+
def relink_missing_skin_bones_for_ue5manny(self, inSkinArray):
|
1022
|
+
returnBones = []
|
1023
|
+
spine3 = None
|
1024
|
+
spine4 = None
|
1025
|
+
spine5 = None
|
1026
|
+
|
1027
|
+
neck = None
|
1028
|
+
clavicleL = None
|
1029
|
+
clavicleR = None
|
1030
|
+
|
1031
|
+
handL = None
|
1032
|
+
handR = None
|
1033
|
+
|
1034
|
+
fingerNames = ["index", "middle", "ring", "pinky"]
|
1035
|
+
knuckleName = "metacarpal"
|
1036
|
+
|
1037
|
+
lFingers = []
|
1038
|
+
rFingers = []
|
1039
|
+
|
1040
|
+
for item in inSkinArray:
|
1041
|
+
if rt.matchPattern(item.name, pattern="*spine*03"):
|
1042
|
+
spine3 = item
|
1043
|
+
if rt.matchPattern(item.name, pattern="*neck*01"):
|
1044
|
+
neck = item
|
1045
|
+
if rt.matchPattern(item.name, pattern="*clavicle*l"):
|
1046
|
+
clavicleL = item
|
1047
|
+
if rt.matchPattern(item.name, pattern="*clavicle*r"):
|
1048
|
+
clavicleR = item
|
1049
|
+
|
1050
|
+
if rt.matchPattern(item.name, pattern="*hand*l"):
|
1051
|
+
handL = item
|
1052
|
+
if rt.matchPattern(item.name, pattern="*hand*r"):
|
1053
|
+
handR = item
|
1054
|
+
|
1055
|
+
for fingerName in fingerNames:
|
1056
|
+
if rt.matchPattern(item.name, pattern="*"+fingerName+"*01*l"):
|
1057
|
+
lFingers.append(item)
|
1058
|
+
if rt.matchPattern(item.name, pattern="*"+fingerName+"*01*r"):
|
1059
|
+
rFingers.append(item)
|
1060
|
+
|
1061
|
+
for item in inSkinArray:
|
1062
|
+
if rt.matchPattern(item.name, pattern="*spine*04"):
|
1063
|
+
spine4 = item
|
1064
|
+
item.parent = spine3
|
1065
|
+
|
1066
|
+
if rt.matchPattern(item.name, pattern="*spine*05"):
|
1067
|
+
spine5 = item
|
1068
|
+
item.parent = spine4
|
1069
|
+
neck.parent = spine5
|
1070
|
+
clavicleL.parent = spine5
|
1071
|
+
clavicleR.parent = spine5
|
1072
|
+
|
1073
|
+
if rt.matchPattern(item.name, pattern=f"*{knuckleName}*l"):
|
1074
|
+
item.parent = handL
|
1075
|
+
if rt.matchPattern(item.name, pattern=f"*{knuckleName}*r"):
|
1076
|
+
item.parent = handR
|
1077
|
+
|
1078
|
+
filteringChar = self.name._get_filtering_char(inSkinArray[-1].name)
|
1079
|
+
|
1080
|
+
for item in lFingers:
|
1081
|
+
fingerNamePattern = self.name.add_suffix_to_real_name(item.name, filteringChar+knuckleName)
|
1082
|
+
fingerNamePattern = self.name.remove_name_part("Index", fingerNamePattern)
|
1083
|
+
for knuckle in inSkinArray:
|
1084
|
+
if rt.matchPattern(knuckle.name, pattern=fingerNamePattern):
|
1085
|
+
item.parent = knuckle
|
1086
|
+
break
|
1087
|
+
|
1088
|
+
for item in rFingers:
|
1089
|
+
fingerNamePattern = self.name.add_suffix_to_real_name(item.name, filteringChar+knuckleName)
|
1090
|
+
fingerNamePattern = self.name.remove_name_part("Index", fingerNamePattern)
|
1091
|
+
for knuckle in inSkinArray:
|
1092
|
+
if rt.matchPattern(knuckle.name, pattern=fingerNamePattern):
|
1093
|
+
item.parent = knuckle
|
1094
|
+
break
|
1095
|
+
|
1096
|
+
return returnBones
|
1097
|
+
|
1098
|
+
def create_skin_bone_from_bip_for_ue5manny(self, inBoneArray, skipNub=True, mesh=False, link=True, isHuman=False, skinBoneBaseName=""):
|
1099
|
+
targetBones = [item for item in inBoneArray
|
1100
|
+
if (rt.classOf(item) == rt.Biped_Object)
|
1101
|
+
and (not rt.matchPattern(item.name, pattern="*Twist*"))
|
1102
|
+
and (item != item.controller.rootNode)]
|
1103
|
+
|
1104
|
+
missingBipBones = []
|
1105
|
+
|
1106
|
+
if isHuman:
|
1107
|
+
missingBipBones = self.gen_missing_bip_bones_for_ue5manny(targetBones)
|
1108
|
+
self.relink_missing_bip_bones_for_ue5manny(targetBones, missingBipBones)
|
1109
|
+
|
1110
|
+
for item in missingBipBones:
|
1111
|
+
targetBones.append(item)
|
1112
|
+
|
1113
|
+
sortedBipBones = self.sort_bones_as_hierarchy(targetBones)
|
1114
|
+
|
1115
|
+
skinBones = self.create_skin_bone(sortedBipBones, skipNub=skipNub, mesh=mesh, link=False, skinBoneBaseName=skinBoneBaseName)
|
1116
|
+
if len(skinBones) == 0:
|
1117
|
+
return False
|
1118
|
+
|
1119
|
+
for item in skinBones:
|
1120
|
+
if rt.matchPattern(item.name, pattern="*pelvis*"):
|
1121
|
+
self.anim.rotate_local(item, 180, 0, 0, dontAffectChildren=True)
|
1122
|
+
if rt.matchPattern(item.name, pattern="*spine*"):
|
1123
|
+
self.anim.rotate_local(item, 180, 0, 0, dontAffectChildren=True)
|
1124
|
+
if rt.matchPattern(item.name, pattern="*neck*"):
|
1125
|
+
self.anim.rotate_local(item, 180, 0, 0, dontAffectChildren=True)
|
1126
|
+
if rt.matchPattern(item.name, pattern="*head*"):
|
1127
|
+
self.anim.rotate_local(item, 180, 0, 0, dontAffectChildren=True)
|
1128
|
+
if rt.matchPattern(item.name, pattern="*thigh*l"):
|
1129
|
+
self.anim.rotate_local(item, 0, 0, 180, dontAffectChildren=True)
|
1130
|
+
if rt.matchPattern(item.name, pattern="*calf*l"):
|
1131
|
+
self.anim.rotate_local(item, 0, 0, 180, dontAffectChildren=True)
|
1132
|
+
if rt.matchPattern(item.name, pattern="*foot*l"):
|
1133
|
+
self.anim.rotate_local(item, 0, 0, 180, dontAffectChildren=True)
|
1134
|
+
if rt.matchPattern(item.name, pattern="*ball*r"):
|
1135
|
+
self.anim.rotate_local(item, 0, 0, 180, dontAffectChildren=True)
|
1136
|
+
|
1137
|
+
if rt.matchPattern(item.name, pattern="*clavicle*r"):
|
1138
|
+
self.anim.rotate_local(item, 0, 0, -180, dontAffectChildren=True)
|
1139
|
+
if rt.matchPattern(item.name, pattern="*upperarm*r"):
|
1140
|
+
self.anim.rotate_local(item, 0, 0, -180, dontAffectChildren=True)
|
1141
|
+
if rt.matchPattern(item.name, pattern="*lowerarm*r"):
|
1142
|
+
self.anim.rotate_local(item, 0, 0, -180, dontAffectChildren=True)
|
1143
|
+
if rt.matchPattern(item.name, pattern="*hand*r"):
|
1144
|
+
self.anim.rotate_local(item, 0, 0, -180, dontAffectChildren=True)
|
1145
|
+
|
1146
|
+
if rt.matchPattern(item.name, pattern="*thumb*r"):
|
1147
|
+
self.anim.rotate_local(item, 0, 0, 180, dontAffectChildren=True)
|
1148
|
+
if rt.matchPattern(item.name, pattern="*index*r"):
|
1149
|
+
self.anim.rotate_local(item, 0, 0, 180, dontAffectChildren=True)
|
1150
|
+
if rt.matchPattern(item.name, pattern="*middle*r"):
|
1151
|
+
self.anim.rotate_local(item, 0, 0, 180, dontAffectChildren=True)
|
1152
|
+
if rt.matchPattern(item.name, pattern="*ring*r"):
|
1153
|
+
self.anim.rotate_local(item, 0, 0, 180, dontAffectChildren=True)
|
1154
|
+
if rt.matchPattern(item.name, pattern="*pinky*r"):
|
1155
|
+
self.anim.rotate_local(item, 0, 0, 180, dontAffectChildren=True)
|
1156
|
+
|
1157
|
+
if rt.matchPattern(item.name, pattern="*metacarpal*"):
|
1158
|
+
tempArray = self.name._split_to_array(item.name)
|
1159
|
+
item.name = self.name._combine(tempArray, inFilChar="_")
|
1160
|
+
item.name = self.name.remove_name_part("Base", item.name)
|
1161
|
+
|
1162
|
+
self.anim.save_xform(item)
|
1163
|
+
|
1164
|
+
self.relink_missing_skin_bones_for_ue5manny(skinBones)
|
1165
|
+
|
1166
|
+
self.link_skin_bones(skinBones, sortedBipBones)
|
1167
|
+
for item in skinBones:
|
1168
|
+
self.anim.save_xform(item)
|
1169
|
+
|
1170
|
+
return skinBones
|
1171
|
+
|
840
1172
|
def set_bone_on(self, inBone):
|
841
1173
|
"""
|
842
1174
|
뼈대 활성화.
|
pyjallib/max/constraint.py
CHANGED
@@ -233,6 +233,8 @@ class Constraint:
|
|
233
233
|
# 마지막 타겟에 특정 가중치 적용
|
234
234
|
targetNum = targetPosConst.getNumTargets()
|
235
235
|
targetPosConst.SetWeight(targetNum, inWeight)
|
236
|
+
|
237
|
+
return targetPosConst
|
236
238
|
|
237
239
|
def assign_pos_xyz(self, inObj):
|
238
240
|
"""
|
@@ -443,6 +445,8 @@ class Constraint:
|
|
443
445
|
# 마지막 타겟에 특정 가중치 적용
|
444
446
|
targetNum = targetRotConstraint.getNumTargets()
|
445
447
|
targetRotConstraint.SetWeight(targetNum, inWeight)
|
448
|
+
|
449
|
+
return targetRotConstraint
|
446
450
|
|
447
451
|
def assign_euler_xyz(self, inObj):
|
448
452
|
"""
|
@@ -609,6 +613,8 @@ class Constraint:
|
|
609
613
|
rot_list = self.get_rot_list_controller(inObj)
|
610
614
|
rt.setPropertyController(rot_list, "Available", targetRotConstraint)
|
611
615
|
rot_list.setActive(rot_list.count)
|
616
|
+
|
617
|
+
return targetRotConstraint
|
612
618
|
|
613
619
|
def assign_rot_const_scripted(self, inObj, inTarget):
|
614
620
|
"""
|
@@ -635,32 +641,19 @@ class Constraint:
|
|
635
641
|
rot_list.setActive(rot_list.count)
|
636
642
|
|
637
643
|
# 헬퍼 객체 이름 생성
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
print(f"rotPointName: {rotPointName}, rotMeasurePointName: {rotMeasurePointName}, rotExpName: {rotExpName}")
|
647
|
-
else:
|
648
|
-
# name 서비스가 없는 경우 기본 이름 사용
|
649
|
-
base_name = rt.getProperty(inObj, "name")
|
650
|
-
rotPointName = f"dum_{base_name}"
|
651
|
-
rotMeasurePointName = f"dum_{base_name}_01"
|
652
|
-
rotExpName = f"exp_{base_name}_0"
|
644
|
+
rotPointName = self.name.replace_Type(inObj.name, self.name.get_dummy_value())
|
645
|
+
rotMeasurePointName = self.name.increase_index(rotPointName, 1)
|
646
|
+
rotExpName = self.name.replace_Type(inObj.name, self.name.get_exposeTm_value())
|
647
|
+
rotExpName = self.name.replace_Index(rotExpName, "0")
|
648
|
+
|
649
|
+
print(f"dumStr: {self.name.get_dummy_value()}")
|
650
|
+
print(f"exposeTmStr: {self.name.get_exposeTm_value()}")
|
651
|
+
print(f"rotPointName: {rotPointName}, rotMeasurePointName: {rotMeasurePointName}, rotExpName: {rotExpName}")
|
653
652
|
|
654
653
|
# 헬퍼 객체 생성
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
rotExpPoint = rt.ExposeTm(name=rotExpName, size=3, box=False, cross=True, wirecolor=rt.Color(14, 255, 2))
|
659
|
-
else:
|
660
|
-
# 직접 헬퍼 객체 생성
|
661
|
-
rotPoint = rt.Point(name=rotPointName, size=2, box=True, cross=False)
|
662
|
-
rotMeasuerPoint = rt.Point(name=rotMeasurePointName, size=3, box=True, cross=False)
|
663
|
-
rotExpPoint = rt.ExposeTm(name=rotExpName, size=3, box=False, cross=True, wirecolor=rt.Color(14, 255, 2))
|
654
|
+
rotPoint = self.helper.create_point(rotPointName, size=2, boxToggle=True, crossToggle=False)
|
655
|
+
rotMeasuerPoint = self.helper.create_point(rotMeasurePointName, size=3, boxToggle=True, crossToggle=False)
|
656
|
+
rotExpPoint = rt.ExposeTm(name=rotExpName, size=3, box=False, cross=True, wirecolor=rt.Color(14, 255, 2))
|
664
657
|
|
665
658
|
# 초기 변환 설정
|
666
659
|
rt.setProperty(rotPoint, "transform", rt.getProperty(inObj, "transform"))
|
@@ -710,22 +703,20 @@ class Constraint:
|
|
710
703
|
targetObjArray = inTarget
|
711
704
|
|
712
705
|
# 객체 이름 생성
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
lookAtExpPointName = self.name.replace_Index(lookAtExpPointName, "0")
|
706
|
+
objName = self.name.get_string(oriObj.name)
|
707
|
+
indexVal = self.name.get_index_as_digit(oriObj.name)
|
708
|
+
indexNum = 0 if indexVal is False else indexVal
|
709
|
+
dummyName = self.name.add_prefix_to_real_name(objName, self.name.get_dummy_value())
|
710
|
+
|
711
|
+
lookAtPointName = self.name.replace_Index(dummyName, str(indexNum))
|
712
|
+
lookAtMeasurePointName = self.name.replace_Index(dummyName, str(indexNum+1))
|
713
|
+
lookAtExpPointName = dummyName + self.name.get_exposeTm_value()
|
714
|
+
lookAtExpPointName = self.name.replace_Index(lookAtExpPointName, "0")
|
723
715
|
|
724
716
|
# 헬퍼 객체 생성
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
lookAtExpPoint = rt.ExposeTm(name=lookAtExpPointName, size=3, box=False, cross=True, wirecolor=rt.Color(14, 255, 2))
|
717
|
+
lookAtPoint = self.helper.create_point(lookAtPointName, size=2, boxToggle=True, crossToggle=False)
|
718
|
+
lookAtMeasurePoint = self.helper.create_point(lookAtMeasurePointName, size=3, boxToggle=True, crossToggle=False)
|
719
|
+
lookAtExpPoint = rt.ExposeTm(name=lookAtExpPointName, size=3, box=False, cross=True, wirecolor=rt.Color(14, 255, 2))
|
729
720
|
|
730
721
|
# 초기 변환 설정
|
731
722
|
rt.setProperty(lookAtPoint, "transform", rt.getProperty(oriObj, "transform"))
|