objName = ""
objFrame = ""
objRotEul = ""
objRotQut = ""
outputStr = ""
txtfilename = ""
selObjs = selection as array
hideByCategory.geometry = true
hideByCategory.helpers = true
hideByCategory.bones = true
if (selObjs.count !=0) then
(
txtfilename = (Filterstring maxFileName ".")[1]
pathFile = maxfilepath + "\\" + txtfilename + ".txt"
filestm = createFile pathFile
for i = 1 to selObjs.count do
(
objName = selObjs[i].name
outputStr = outputStr + objName + "\n"
if (classof selObjs[i] == Biped_Object) then
(
for j =1 to (selObjs[i].controller.keys).count do
(
sliderTime = selObjs[i].controller.keys[j].time
objFrame = (selObjs[i].controller.keys[j].time) as string
objRotQut = (selObjs[i].transform.rotation) as string
objRotEul = ((selObjs[i].transform.rotation) as eulerAngles) as string
outputStr = outputStr + objFrame + "\t" + objRotEul + "\n"
if((selObjs[i].controller.keys).count == j)do outputStr = outputStr + "\n"
)
)
else
(
for j =1 to (selObjs[i].rotation.controller.keys).count do
(
sliderTime = selObjs[i].rotation.controller.keys[j].time
objFrame = (selObjs[i].rotation.controller.keys[j].time) as string
objRotQut = (selObjs[i].rotation.controller.value) as string
objRotEul = ((selObjs[i].rotation.controller.value) as eulerAngles) as string
outputStr = outputStr + objFrame + "\t" + objRotEul + "\n"
if((selObjs[i].rotation.controller.keys).count == j)do outputStr = outputStr + "\n"
)
)
)
format "%" outputStr to:filestm
close filestm
)
else
(
)
hideByCategory.geometry = false
hideByCategory.helpers = false
hideByCategory.bones = false
===============================================================================
바이패드 또는 그외의 오브젝트들의 애니메이션 키값을 순차 적으로 읽어 해당값의 로테이션 값을 저장하는 스크립트다.
조금더 다듬는다면 맥스파일의 애니메이션 회전값을 다른 맥스파일에 적용하는데 사용될 수있는 스크립트다.
만들게 된 계기가 있는데 다음과 같다.
몇달전에 모 카페에다가 맥스 스크립트를 외주하는것이 실효성이 있는가 하는 의견을 올린적이 있다.
본업은 애니메이션 이긴하지만 회사의 업무에 필요한 맥스 스크립트를 제작하면서, 모바일게임이나 인원수가 적은 업체에서는 스크립트를 작업 할 수 있는 사람을 구하기 힘들어 작업 시간을 줄일 수 있는 일을 줄이지 못해 어려움이 있을것 같다는 생각이 들었기 때문이다.
물론 본격적으로 맥스 스크립트를 공부하고 작업한것이 아니기 때문에 사람들의 답변이 궁금했었다.
그런데 뜬금없이 모 회사에서 스크립트 외주 요청이 들어왔었다.
결국에는 나의 잘못으로 외주 업무를 하지 못했지만, 내심 스크립트도 잘하면 외주를 할수 있는 하나의 업종이 될수 있겠구나 하는 생각이 들었다.
당시 모 회사에서 요청했던 기능을 간단하게 구현한 스크립트다.
결론은 스크립트 공부 열심히 하자!!!
2014년 2월 15일 토요일
바이패드 복사 본 만들기 ver1.1
bips = #()
bons = #()
boneName = ""
boundingBox = undefined
bipLength = undefined
bipwidth = undefined
bipheight = undefined
selObj = selection as array
objs = #()
rootBipName = ""
filterRootBipName = #()
cNameValue = "Bone"
fn changeName strs oldStr newStr =
(
findFlag = findstring strs oldStr
if (findFlag != undefined) do
(
changeStr = replace strs findFlag oldStr.count newStr
)
changeStr
)
for i = 1 to selObj.count do
(
if (classof selObj[i] == Biped_Object) do append objs selObj[i]
)
if objs.count == 0 then
(
messagebox "바이패드 노드를 하나 이상 선택하세요."
)
else
(
filterRootBipName = filterstring objs[1].name " "
(execute("$'"+filterRootBipName[1] + "'")).transform.controller.figureMode = true
(execute("$'"+filterRootBipName[1] + "'")).transform.controller.trianglePelvis = false
(execute("$'"+filterRootBipName[1] + "'")).transform.controller.triangleNeck = true
rollout bipMirrbone "흉내 내기본 생성"
(
edittext newNameText "Bip 대신 넣을 이름" text:"Bone"
checkbox twistBon_chk "트위스트본사용" checked:false width:200
checkbox autoNeck_chk "자동본사용" checked:false width:200
Button start_btn "실행"
on newNameText changed txt do
(
cNameValue = txt
)
on start_btn pressed do
(
for i = 1 to objs.count do
(
if((classof objs[i] == Biped_Object) and (objs[i].name != "Bip01 Footsteps")) do append bips objs[i]
)
clearSelection()
for i = 1 to bips.count do
(
boneName = bips[i].name
boneName = changeName boneName "Bip" cNameValue
boundingBox = nodeGetBoundingBox bips[i]bips[i].transform
bipLength = boundingBox[2].x
bipheight = boundingBox[2].y
bipwidth = boundingBox[2].z
madeBone = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
madeBone.name = boneName
madeBone.width = bipWidth
madeBone.height = bipheight
madeBone.length = bipLength
madeBone.boxmode = on
madeBone.rotation = (inverse(biped.getTransform bips[i] #rotation))
madeBone.position = (bips[i].transform.pos)
if((autoNeck_chk.checked == true)and(matchPattern bips[i].name pattern:"*Neck" == true)) then
(
madeBone.rotation.controller= Orientation_Constraint()
madeBone.rotation.controller.appendTarget bips[i].parent 50.0
madeBone.rotation.controller.appendTarget bips[i].children[1] 50.0
)
else if((autoNeck_chk.checked == true)and(matchPattern bips[i].name pattern:"*Head" == true)) then
(
madeBone.rotation.controller= Orientation_Constraint()
madeBone.rotation.controller.appendTarget bips[i] 50.0
)
else
(
madeBone.position.controller = Position_Constraint()
madeBone.position.controller.appendTarget bips[i] 50.0
madeBone.rotation.controller= Orientation_Constraint()
madeBone.rotation.controller.appendTarget bips[i] 50.0
)
append bons madeBone
)
for i = 1 to bips.count do
(
if(bips[i].parent != undefined) do
(
parentBip = bips[i].parent
boneName = parentBip.name
boneName = changeName boneName "Bip" cNameValue
bons[i].parent = execute("$'" + boneName + "'")
)
)
filterRootBoneName = filterstring boneName " "
if(twistBon_chk.checked == true) do
(
if((execute ("$'" + filterRootBoneName[1] + " L Clavicle'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " L UpperArm'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " L Forearm'") != undefined)) do
(
-- 왼쪽 어께트위스트1 더미
Point_L_UpperArmTwist02 = point()
Point_L_UpperArmTwist02.name = "Point_L_UpperArmTwist02"
Point_L_UpperArmTwist02.size = 2.0
Point_L_UpperArmTwist02.box = false
Point_L_UpperArmTwist02.cross = true
Point_L_UpperArmTwist02.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L UpperArm'")) #rotation))
Point_L_UpperArmTwist02.pos = ((execute("$'"+filterRootBipName[1] + " L UpperArm'")).transform.pos)
Point_L_UpperArmTwist02.parent =(execute ("$'" + filterRootBoneName[1] + " L Clavicle'"))
Point_L_UpperArmTwist02.pos.controller = Position_Expression()
Point_L_UpperArmTwist02.parent = (execute ("$'" + filterRootBoneName[1] + " L UpperArm'"))
Point_L_UpperArmTwist02.wirecolor = (color 10 10 10)
-- 왼쪽 어께트위스트2 더미
Point_L_UpperArmTwist01 = point()
Point_L_UpperArmTwist01.name = "Point_L_UpperArmTwist01"
Point_L_UpperArmTwist01.size = 2.0
Point_L_UpperArmTwist01.box = true
Point_L_UpperArmTwist01.cross = false
Point_L_UpperArmTwist01.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L Clavicle'")) #rotation))
Point_L_UpperArmTwist01.pos = ((execute("$'"+filterRootBipName[1] + " L Clavicle'")).transform.pos)
Point_L_UpperArmTwist01.parent = (execute ("$'" + filterRootBoneName[1] + " L Clavicle'"))
Point_L_UpperArmTwist01.rotation.controller=LookAt_Constraint()
Point_L_UpperArmTwist01.rotation.controller.appendTarget $'Point_L_UpperArmTwist02' 50.0
Point_L_UpperArmTwist01.rotation.controller.viewline_length_abs = false
Point_L_UpperArmTwist01.rotation.controller.upnode_world = false
Point_L_UpperArmTwist01.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " L Clavicle'"))
Point_L_UpperArmTwist01.wirecolor = (color 10 10 10)
-- 왼쪽 어께 트위스트1,2 본
LUpperArmTwist01 = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
LUpperArmTwist01.name = filterRootBoneName[1] +" L UpperArmTwist01"
LUpperArmTwist01.width = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).width) * 0.8
LUpperArmTwist01.height = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).height) * 0.8
LUpperArmTwist01.length = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) / 4
LUpperArmTwist02 = Bonesys.createBone[(((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) / 4),0,0][1,0,0][0,0,1]
LUpperArmTwist02.name = filterRootBoneName[1] + " L UpperArmTwist02"
LUpperArmTwist02.width = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).width) * 0.8
LUpperArmTwist02.height = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).height) * 0.8
LUpperArmTwist02.length = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) / 3
LUpperArmTwist02.parent = LUpperArmTwist01
LUpperArmTwist01.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L UpperArm'")) #rotation))
LUpperArmTwist01.pos = ((execute("$'"+filterRootBipName[1] + " L UpperArm'")).transform.pos)
LUpperArmTwist01.parent = (execute ("$'" + filterRootBoneName[1] + " L UpperArm'"))
LUpperArmTwist02.parent = (execute ("$'" + filterRootBoneName[1] + " L UpperArm'"))
LUpperArmTwist01.rotation.controller=LookAt_Constraint()
LUpperArmTwist01.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " L Forearm'")) 50.0
LUpperArmTwist01.rotation.controller.viewline_length_abs = false
LUpperArmTwist01.rotation.controller.upnode_world = false
LUpperArmTwist01.rotation.controller.pickUpNode = Point_L_UpperArmTwist01
LUpperArmTwist01.wirecolor = (color 10 10 10)
LUpperArmTwist01.boxmode = on
LUpperArmTwist02.rotation.controller=Orientation_Constraint()
LUpperArmTwist02.rotation.controller.appendTarget LUpperArmTwist01 60.0
LUpperArmTwist02.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " L UpperArm'")) 40.0
LUpperArmTwist02.wirecolor = (color 10 10 10)
LUpperArmTwist02.boxmode = on
)
if((execute ("$'" + filterRootBoneName[1] + " R Clavicle'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " R UpperArm'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " R Forearm'") != undefined)) do
(
-- 오른쪽 어께트위스트1 더미
Point_R_UpperArmTwist02 = point()
Point_R_UpperArmTwist02.name = "Point_R_UpperArmTwist02"
Point_R_UpperArmTwist02.size = 2.0
Point_R_UpperArmTwist02.box = false
Point_R_UpperArmTwist02.cross = true
Point_R_UpperArmTwist02.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R UpperArm'")) #rotation))
Point_R_UpperArmTwist02.pos = ((execute("$'"+filterRootBipName[1] + " R UpperArm'")).transform.pos)
Point_R_UpperArmTwist02.parent =(execute ("$'" + filterRootBoneName[1] + " R Clavicle'"))
Point_R_UpperArmTwist02.pos.controller = Position_Expression()
Point_R_UpperArmTwist02.parent = (execute ("$'" + filterRootBoneName[1] + " R UpperArm'"))
Point_R_UpperArmTwist02.wirecolor = (color 10 10 10)
-- 오른쪽 어께트위스트2 더미
Point_R_UpperArmTwist01 = point()
Point_R_UpperArmTwist01.name = "Point_R_UpperArmTwist01"
Point_R_UpperArmTwist01.size = 2.0
Point_R_UpperArmTwist01.box = true
Point_R_UpperArmTwist01.cross = false
Point_R_UpperArmTwist01.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R Clavicle'")) #rotation))
Point_R_UpperArmTwist01.pos = ((execute("$'"+filterRootBipName[1] + " R Clavicle'")).transform.pos)
Point_R_UpperArmTwist01.parent = (execute ("$'" + filterRootBoneName[1] + " R Clavicle'"))
Point_R_UpperArmTwist01.rotation.controller=LookAt_Constraint()
Point_R_UpperArmTwist01.rotation.controller.appendTarget $'Point_R_UpperArmTwist02' 50.0
Point_R_UpperArmTwist01.rotation.controller.viewline_length_abs = false
Point_R_UpperArmTwist01.rotation.controller.upnode_world = false
Point_R_UpperArmTwist01.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " R Clavicle'"))
Point_R_UpperArmTwist01.wirecolor = (color 10 10 10)
-- 오른쪽 어께 트위스트1,2 본
RUpperArmTwist01 = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
RUpperArmTwist01.name = filterRootBoneName[1] +" R UpperArmTwist01"
RUpperArmTwist01.width = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).width) * 0.8
RUpperArmTwist01.height = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).height) * 0.8
RUpperArmTwist01.length = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).length) / 4
RUpperArmTwist02 = Bonesys.createBone[(((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) / 4),0,0][1,0,0][0,0,1]
RUpperArmTwist02.name = filterRootBoneName[1] + " R UpperArmTwist02"
RUpperArmTwist02.width = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).width) * 0.8
RUpperArmTwist02.height = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).height) * 0.8
RUpperArmTwist02.length = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).length) / 4
RUpperArmTwist02.parent = RUpperArmTwist01
RUpperArmTwist01.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R UpperArm'")) #rotation))
RUpperArmTwist01.pos = ((execute("$'"+filterRootBipName[1] + " R UpperArm'")).transform.pos)
RUpperArmTwist01.parent = (execute ("$'" + filterRootBoneName[1] + " R UpperArm'"))
RUpperArmTwist02.parent = (execute ("$'" + filterRootBoneName[1] + " R UpperArm'"))
RUpperArmTwist01.rotation.controller=LookAt_Constraint()
RUpperArmTwist01.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " R Forearm'")) 50.0
RUpperArmTwist01.rotation.controller.viewline_length_abs = false
RUpperArmTwist01.rotation.controller.upnode_world = false
RUpperArmTwist01.rotation.controller.pickUpNode = Point_R_UpperArmTwist01
RUpperArmTwist01.wirecolor = (color 10 10 10)
RUpperArmTwist01.boxmode = on
RUpperArmTwist02.rotation.controller=Orientation_Constraint()
RUpperArmTwist02.rotation.controller.appendTarget RUpperArmTwist01 60.0
RUpperArmTwist02.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " R UpperArm'")) 40.0
RUpperArmTwist02.wirecolor = (color 10 10 10)
RUpperArmTwist02.boxmode = on
)
if((execute ("$'" + filterRootBoneName[1] + " L Forearm'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " L Hand'") != undefined)) do
(
-- 왼쪽 손목 트위스트 본
L_ForearmTwist = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
L_ForearmTwist.name = filterRootBoneName[1] + " L_ForearmTwist"
L_ForearmTwist.width = ((execute ("$'" + filterRootBoneName[1] + " L Forearm'")).width) * 0.8
L_ForearmTwist.height = ((execute ("$'" + filterRootBoneName[1] + " L Forearm'")).height) * 0.8
L_ForearmTwist.length = ((execute ("$'" + filterRootBoneName[1] + " L Forearm'")).length) / 4
L_ForearmTwist.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L Forearm'")) #rotation))
L_ForearmTwist.pos = ((execute("$'"+filterRootBipName[1] + " L Forearm'")).transform.pos)
coordsys local move L_ForearmTwist [((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) - (((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) / 4),0,0]
L_ForearmTwist.parent = (execute ("$'" + filterRootBoneName[1] + " L Forearm'"))
L_ForearmTwist.rotation.controller=LookAt_Constraint()
L_ForearmTwist.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " L Hand'")) 50.0
L_ForearmTwist.rotation.controller.viewline_length_abs = false
L_ForearmTwist.rotation.controller.upnode_world = false
L_ForearmTwist.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " L Hand'"))
L_ForearmTwist.wirecolor = (color 10 10 10)
L_ForearmTwist.boxmode = on
)
if((execute ("$'" + filterRootBoneName[1] + " R Forearm'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " R Hand'") != undefined)) do
(
-- 오른쪽 손목 트위스트 본
R_ForearmTwist = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
R_ForearmTwist.name = filterRootBoneName[1] + " R_ForearmTwist"
R_ForearmTwist.width = ((execute ("$'" + filterRootBoneName[1] + " R Forearm'")).width) * 0.8
R_ForearmTwist.height = ((execute ("$'" + filterRootBoneName[1] + " R Forearm'")).height) * 0.8
R_ForearmTwist.length = ((execute ("$'" + filterRootBoneName[1] + " R Forearm'")).length) / 4
R_ForearmTwist.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R Forearm'")) #rotation))
R_ForearmTwist.pos = ((execute("$'"+filterRootBipName[1] + " R Forearm'")).transform.pos)
coordsys local move R_ForearmTwist [((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).length) - (((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).length) / 4),0,0]
R_ForearmTwist.parent = (execute ("$'" + filterRootBoneName[1] + " R Forearm'"))
R_ForearmTwist.rotation.controller=LookAt_Constraint()
R_ForearmTwist.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " R Hand'")) 50.0
R_ForearmTwist.rotation.controller.viewline_length_abs = false
R_ForearmTwist.rotation.controller.upnode_world = false
R_ForearmTwist.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " R Hand'"))
R_ForearmTwist.wirecolor = (color 10 10 10)
R_ForearmTwist.boxmode = on
)
if(((execute ("$'" + filterRootBoneName[1] + " L Thigh'")) != undefined) and ((execute ("$'" + filterRootBoneName[1] + " L Calf'")) != undefined)) do
(
-- 왼쪽 허벅지 트위스트 ExposeTM
ExposeTransformL = ExposeTransform()
ExposeTransformL.name = "ExposeTransform L"
ExposeTransformL.size = 1.5
ExposeTransformL.box = true
ExposeTransformL.cross = false
ExposeTransformL.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L Thigh'")) #rotation))
ExposeTransformL.pos = ((execute("$'"+filterRootBipName[1] + " L Thigh'")).transform.pos)
ExposeTransformL.parent = (execute ("$'" + filterRootBoneName[1] + " L Thigh'"))
ExposeTransformL.exposeNode = (execute ("$'" + filterRootBoneName[1] + " L Calf'"))
ExposeTransformL.useParent = false
ExposeTransformL.localReferenceNode = (execute ("$'" + filterRootBoneName[1] + " Pelvis'"))
ExposeTransformL.wirecolor = (color 10 10 10)
-- 왼쪽 허벅지 트위스트 더미
PointLThigh = point()
PointLThigh.name = filterRootBoneName[1] + " Point L Thigh"
PointLThigh.size = 1.0
PointLThigh.box = false
PointLThigh.cross = true
PointLThigh.pos = ((execute("$'"+filterRootBipName[1] + " Pelvis'")).transform.pos)
coordsys local move PointLThigh [10,0,0]
PointLThigh.parent = (execute ("$'" + filterRootBoneName[1] + " Pelvis'"))
reactContL = PointLThigh.pos.controller = Position_reactor()
PointLThigh.wirecolor = (color 10 10 10)
-- 왼쪽 허벅지 트위스트 본
L_ThighTwist = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
L_ThighTwist.name = filterRootBoneName[1] + " L_ThighTwist"
L_ThighTwist.width = ((execute ("$'" + filterRootBoneName[1] + " L Thigh'")).width) * 0.8
L_ThighTwist.height = ((execute ("$'" + filterRootBoneName[1] + " L Thigh'")).height) * 0.8
L_ThighTwist.length = ((execute ("$'" + filterRootBoneName[1] + " L Thigh'")).length) / 4
L_ThighTwist.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L Thigh'")) #rotation))
L_ThighTwist.pos = ((execute("$'"+filterRootBipName[1] + " L Thigh'")).transform.pos)
L_ThighTwist.parent = (execute ("$'" + filterRootBoneName[1] + " L Thigh'"))
L_ThighTwist.rotation.controller=LookAt_Constraint()
L_ThighTwist.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " L Calf'")) 50.0
L_ThighTwist.rotation.controller.viewline_length_abs = false
L_ThighTwist.rotation.controller.upnode_world = false
L_ThighTwist.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " Point L Thigh'"))
L_ThighTwist.rotation.controller.upnode_ctrl = 0
L_ThighTwist.rotation.controller.StoUP_axisFlip = true
L_ThighTwist.wirecolor = (color 10 10 10)
L_ThighTwist.boxmode = on
reactContL.reactTo $'ExposeTransform L'.localPosition.controller
)
if(((execute ("$'" + filterRootBoneName[1] + " R Thigh'")) != undefined) and ((execute ("$'" + filterRootBoneName[1] + " R Calf'")) != undefined)) do
(
-- 오른쪽 허벅지 트위스트 ExposeTM
ExposeTransformR = ExposeTransform()
ExposeTransformR.name = "ExposeTransform R"
ExposeTransformR.size = 1.5
ExposeTransformR.box = true
ExposeTransformR.cross = false
ExposeTransformR.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R Thigh'")) #rotation))
ExposeTransformR.pos = ((execute("$'"+filterRootBipName[1] + " R Thigh'")).transform.pos)
ExposeTransformR.parent = (execute ("$'" + filterRootBoneName[1] + " R Thigh'"))
ExposeTransformR.exposeNode = (execute ("$'" + filterRootBoneName[1] + " R Calf'"))
ExposeTransformR.useParent = false
ExposeTransformR.localReferenceNode = (execute ("$'" + filterRootBoneName[1] + " Pelvis'"))
ExposeTransformR.wirecolor = (color 10 10 10)
-- 오른쪽 허벅지 트위스트 더미
PointRThigh = point()
PointRThigh.name = filterRootBoneName[1] + " Point R Thigh"
PointRThigh.size = 1.0
PointRThigh.box = false
PointRThigh.cross = true
PointRThigh.pos = ((execute("$'"+filterRootBipName[1] + " Pelvis'")).transform.pos)
coordsys local move PointRThigh [-10,0,0]
PointRThigh.parent = ((execute ("$'" + filterRootBoneName[1] + " Pelvis'")))
reactContR = PointRThigh.pos.controller = Position_reactor()
PointRThigh.wirecolor = (color 10 10 10)
-- 오른쪽 허벅지 트위스트 본
R_ThighTwist = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
R_ThighTwist.name = filterRootBoneName[1] + " R_ThighTwist"
R_ThighTwist.width = ((execute ("$'" + filterRootBoneName[1] + " R Thigh'")).width) * 0.8
R_ThighTwist.height = ((execute ("$'" + filterRootBoneName[1] + " R Thigh'")).height) * 0.8
R_ThighTwist.length = ((execute ("$'" + filterRootBoneName[1] + " R Thigh'")).length) / 4
R_ThighTwist.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R Thigh'")) #rotation))
R_ThighTwist.pos = ((execute("$'"+filterRootBipName[1] + " R Thigh'")).transform.pos)
R_ThighTwist.parent = (execute ("$'" + filterRootBoneName[1] + " R Thigh'"))
R_ThighTwist.rotation.controller=LookAt_Constraint()
R_ThighTwist.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " R Calf'")) 50.0
R_ThighTwist.rotation.controller.viewline_length_abs = false
R_ThighTwist.rotation.controller.upnode_world = false
R_ThighTwist.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " Point R Thigh'"))
R_ThighTwist.rotation.controller.upnode_ctrl = 0
R_ThighTwist.wirecolor = (color 10 10 10)
R_ThighTwist.boxmode = on
reactContR.reactTo $'ExposeTransform R'.localPosition.controller
)
)
select bons
destroydialog bipMirrbone
)
)
createdialog bipMirrbone
)
================================================================================
아는 동생의 집에서 이 스크립트를 사용했는데 문제가 발생했다.
확인해 본 결과 종전의 맥스버전에서는 당연히 바이패드가 'Bip01'로 지정이 되는데
2012, 2013버전에서는 'Bip001'로 변경된것이다.
허거덩~~~~
물론 바이패드 이름을 'Bip01'로 변경해주면 되지만 그건 그거 나름대로 스크립트 작업자로서 거부감이 들어서 수정작업을 했다.
수정을 하면서 보니 트위스트 본에도 문제가 있다는것을 알았다.
조금더 확인 한다음에 올릴걸~~ㅠ,.ㅠ
아무튼 수정하여 올린다.
bons = #()
boneName = ""
boundingBox = undefined
bipLength = undefined
bipwidth = undefined
bipheight = undefined
selObj = selection as array
objs = #()
rootBipName = ""
filterRootBipName = #()
cNameValue = "Bone"
fn changeName strs oldStr newStr =
(
findFlag = findstring strs oldStr
if (findFlag != undefined) do
(
changeStr = replace strs findFlag oldStr.count newStr
)
changeStr
)
for i = 1 to selObj.count do
(
if (classof selObj[i] == Biped_Object) do append objs selObj[i]
)
if objs.count == 0 then
(
messagebox "바이패드 노드를 하나 이상 선택하세요."
)
else
(
filterRootBipName = filterstring objs[1].name " "
(execute("$'"+filterRootBipName[1] + "'")).transform.controller.figureMode = true
(execute("$'"+filterRootBipName[1] + "'")).transform.controller.trianglePelvis = false
(execute("$'"+filterRootBipName[1] + "'")).transform.controller.triangleNeck = true
rollout bipMirrbone "흉내 내기본 생성"
(
edittext newNameText "Bip 대신 넣을 이름" text:"Bone"
checkbox twistBon_chk "트위스트본사용" checked:false width:200
checkbox autoNeck_chk "자동본사용" checked:false width:200
Button start_btn "실행"
on newNameText changed txt do
(
cNameValue = txt
)
on start_btn pressed do
(
for i = 1 to objs.count do
(
if((classof objs[i] == Biped_Object) and (objs[i].name != "Bip01 Footsteps")) do append bips objs[i]
)
clearSelection()
for i = 1 to bips.count do
(
boneName = bips[i].name
boneName = changeName boneName "Bip" cNameValue
boundingBox = nodeGetBoundingBox bips[i]bips[i].transform
bipLength = boundingBox[2].x
bipheight = boundingBox[2].y
bipwidth = boundingBox[2].z
madeBone = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
madeBone.name = boneName
madeBone.width = bipWidth
madeBone.height = bipheight
madeBone.length = bipLength
madeBone.boxmode = on
madeBone.rotation = (inverse(biped.getTransform bips[i] #rotation))
madeBone.position = (bips[i].transform.pos)
if((autoNeck_chk.checked == true)and(matchPattern bips[i].name pattern:"*Neck" == true)) then
(
madeBone.rotation.controller= Orientation_Constraint()
madeBone.rotation.controller.appendTarget bips[i].parent 50.0
madeBone.rotation.controller.appendTarget bips[i].children[1] 50.0
)
else if((autoNeck_chk.checked == true)and(matchPattern bips[i].name pattern:"*Head" == true)) then
(
madeBone.rotation.controller= Orientation_Constraint()
madeBone.rotation.controller.appendTarget bips[i] 50.0
)
else
(
madeBone.position.controller = Position_Constraint()
madeBone.position.controller.appendTarget bips[i] 50.0
madeBone.rotation.controller= Orientation_Constraint()
madeBone.rotation.controller.appendTarget bips[i] 50.0
)
append bons madeBone
)
for i = 1 to bips.count do
(
if(bips[i].parent != undefined) do
(
parentBip = bips[i].parent
boneName = parentBip.name
boneName = changeName boneName "Bip" cNameValue
bons[i].parent = execute("$'" + boneName + "'")
)
)
filterRootBoneName = filterstring boneName " "
if(twistBon_chk.checked == true) do
(
if((execute ("$'" + filterRootBoneName[1] + " L Clavicle'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " L UpperArm'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " L Forearm'") != undefined)) do
(
-- 왼쪽 어께트위스트1 더미
Point_L_UpperArmTwist02 = point()
Point_L_UpperArmTwist02.name = "Point_L_UpperArmTwist02"
Point_L_UpperArmTwist02.size = 2.0
Point_L_UpperArmTwist02.box = false
Point_L_UpperArmTwist02.cross = true
Point_L_UpperArmTwist02.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L UpperArm'")) #rotation))
Point_L_UpperArmTwist02.pos = ((execute("$'"+filterRootBipName[1] + " L UpperArm'")).transform.pos)
Point_L_UpperArmTwist02.parent =(execute ("$'" + filterRootBoneName[1] + " L Clavicle'"))
Point_L_UpperArmTwist02.pos.controller = Position_Expression()
Point_L_UpperArmTwist02.parent = (execute ("$'" + filterRootBoneName[1] + " L UpperArm'"))
Point_L_UpperArmTwist02.wirecolor = (color 10 10 10)
-- 왼쪽 어께트위스트2 더미
Point_L_UpperArmTwist01 = point()
Point_L_UpperArmTwist01.name = "Point_L_UpperArmTwist01"
Point_L_UpperArmTwist01.size = 2.0
Point_L_UpperArmTwist01.box = true
Point_L_UpperArmTwist01.cross = false
Point_L_UpperArmTwist01.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L Clavicle'")) #rotation))
Point_L_UpperArmTwist01.pos = ((execute("$'"+filterRootBipName[1] + " L Clavicle'")).transform.pos)
Point_L_UpperArmTwist01.parent = (execute ("$'" + filterRootBoneName[1] + " L Clavicle'"))
Point_L_UpperArmTwist01.rotation.controller=LookAt_Constraint()
Point_L_UpperArmTwist01.rotation.controller.appendTarget $'Point_L_UpperArmTwist02' 50.0
Point_L_UpperArmTwist01.rotation.controller.viewline_length_abs = false
Point_L_UpperArmTwist01.rotation.controller.upnode_world = false
Point_L_UpperArmTwist01.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " L Clavicle'"))
Point_L_UpperArmTwist01.wirecolor = (color 10 10 10)
-- 왼쪽 어께 트위스트1,2 본
LUpperArmTwist01 = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
LUpperArmTwist01.name = filterRootBoneName[1] +" L UpperArmTwist01"
LUpperArmTwist01.width = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).width) * 0.8
LUpperArmTwist01.height = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).height) * 0.8
LUpperArmTwist01.length = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) / 4
LUpperArmTwist02 = Bonesys.createBone[(((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) / 4),0,0][1,0,0][0,0,1]
LUpperArmTwist02.name = filterRootBoneName[1] + " L UpperArmTwist02"
LUpperArmTwist02.width = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).width) * 0.8
LUpperArmTwist02.height = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).height) * 0.8
LUpperArmTwist02.length = ((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) / 3
LUpperArmTwist02.parent = LUpperArmTwist01
LUpperArmTwist01.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L UpperArm'")) #rotation))
LUpperArmTwist01.pos = ((execute("$'"+filterRootBipName[1] + " L UpperArm'")).transform.pos)
LUpperArmTwist01.parent = (execute ("$'" + filterRootBoneName[1] + " L UpperArm'"))
LUpperArmTwist02.parent = (execute ("$'" + filterRootBoneName[1] + " L UpperArm'"))
LUpperArmTwist01.rotation.controller=LookAt_Constraint()
LUpperArmTwist01.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " L Forearm'")) 50.0
LUpperArmTwist01.rotation.controller.viewline_length_abs = false
LUpperArmTwist01.rotation.controller.upnode_world = false
LUpperArmTwist01.rotation.controller.pickUpNode = Point_L_UpperArmTwist01
LUpperArmTwist01.wirecolor = (color 10 10 10)
LUpperArmTwist01.boxmode = on
LUpperArmTwist02.rotation.controller=Orientation_Constraint()
LUpperArmTwist02.rotation.controller.appendTarget LUpperArmTwist01 60.0
LUpperArmTwist02.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " L UpperArm'")) 40.0
LUpperArmTwist02.wirecolor = (color 10 10 10)
LUpperArmTwist02.boxmode = on
)
if((execute ("$'" + filterRootBoneName[1] + " R Clavicle'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " R UpperArm'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " R Forearm'") != undefined)) do
(
-- 오른쪽 어께트위스트1 더미
Point_R_UpperArmTwist02 = point()
Point_R_UpperArmTwist02.name = "Point_R_UpperArmTwist02"
Point_R_UpperArmTwist02.size = 2.0
Point_R_UpperArmTwist02.box = false
Point_R_UpperArmTwist02.cross = true
Point_R_UpperArmTwist02.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R UpperArm'")) #rotation))
Point_R_UpperArmTwist02.pos = ((execute("$'"+filterRootBipName[1] + " R UpperArm'")).transform.pos)
Point_R_UpperArmTwist02.parent =(execute ("$'" + filterRootBoneName[1] + " R Clavicle'"))
Point_R_UpperArmTwist02.pos.controller = Position_Expression()
Point_R_UpperArmTwist02.parent = (execute ("$'" + filterRootBoneName[1] + " R UpperArm'"))
Point_R_UpperArmTwist02.wirecolor = (color 10 10 10)
-- 오른쪽 어께트위스트2 더미
Point_R_UpperArmTwist01 = point()
Point_R_UpperArmTwist01.name = "Point_R_UpperArmTwist01"
Point_R_UpperArmTwist01.size = 2.0
Point_R_UpperArmTwist01.box = true
Point_R_UpperArmTwist01.cross = false
Point_R_UpperArmTwist01.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R Clavicle'")) #rotation))
Point_R_UpperArmTwist01.pos = ((execute("$'"+filterRootBipName[1] + " R Clavicle'")).transform.pos)
Point_R_UpperArmTwist01.parent = (execute ("$'" + filterRootBoneName[1] + " R Clavicle'"))
Point_R_UpperArmTwist01.rotation.controller=LookAt_Constraint()
Point_R_UpperArmTwist01.rotation.controller.appendTarget $'Point_R_UpperArmTwist02' 50.0
Point_R_UpperArmTwist01.rotation.controller.viewline_length_abs = false
Point_R_UpperArmTwist01.rotation.controller.upnode_world = false
Point_R_UpperArmTwist01.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " R Clavicle'"))
Point_R_UpperArmTwist01.wirecolor = (color 10 10 10)
-- 오른쪽 어께 트위스트1,2 본
RUpperArmTwist01 = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
RUpperArmTwist01.name = filterRootBoneName[1] +" R UpperArmTwist01"
RUpperArmTwist01.width = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).width) * 0.8
RUpperArmTwist01.height = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).height) * 0.8
RUpperArmTwist01.length = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).length) / 4
RUpperArmTwist02 = Bonesys.createBone[(((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) / 4),0,0][1,0,0][0,0,1]
RUpperArmTwist02.name = filterRootBoneName[1] + " R UpperArmTwist02"
RUpperArmTwist02.width = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).width) * 0.8
RUpperArmTwist02.height = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).height) * 0.8
RUpperArmTwist02.length = ((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).length) / 4
RUpperArmTwist02.parent = RUpperArmTwist01
RUpperArmTwist01.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R UpperArm'")) #rotation))
RUpperArmTwist01.pos = ((execute("$'"+filterRootBipName[1] + " R UpperArm'")).transform.pos)
RUpperArmTwist01.parent = (execute ("$'" + filterRootBoneName[1] + " R UpperArm'"))
RUpperArmTwist02.parent = (execute ("$'" + filterRootBoneName[1] + " R UpperArm'"))
RUpperArmTwist01.rotation.controller=LookAt_Constraint()
RUpperArmTwist01.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " R Forearm'")) 50.0
RUpperArmTwist01.rotation.controller.viewline_length_abs = false
RUpperArmTwist01.rotation.controller.upnode_world = false
RUpperArmTwist01.rotation.controller.pickUpNode = Point_R_UpperArmTwist01
RUpperArmTwist01.wirecolor = (color 10 10 10)
RUpperArmTwist01.boxmode = on
RUpperArmTwist02.rotation.controller=Orientation_Constraint()
RUpperArmTwist02.rotation.controller.appendTarget RUpperArmTwist01 60.0
RUpperArmTwist02.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " R UpperArm'")) 40.0
RUpperArmTwist02.wirecolor = (color 10 10 10)
RUpperArmTwist02.boxmode = on
)
if((execute ("$'" + filterRootBoneName[1] + " L Forearm'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " L Hand'") != undefined)) do
(
-- 왼쪽 손목 트위스트 본
L_ForearmTwist = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
L_ForearmTwist.name = filterRootBoneName[1] + " L_ForearmTwist"
L_ForearmTwist.width = ((execute ("$'" + filterRootBoneName[1] + " L Forearm'")).width) * 0.8
L_ForearmTwist.height = ((execute ("$'" + filterRootBoneName[1] + " L Forearm'")).height) * 0.8
L_ForearmTwist.length = ((execute ("$'" + filterRootBoneName[1] + " L Forearm'")).length) / 4
L_ForearmTwist.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L Forearm'")) #rotation))
L_ForearmTwist.pos = ((execute("$'"+filterRootBipName[1] + " L Forearm'")).transform.pos)
coordsys local move L_ForearmTwist [((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) - (((execute ("$'" + filterRootBoneName[1] + " L UpperArm'")).length) / 4),0,0]
L_ForearmTwist.parent = (execute ("$'" + filterRootBoneName[1] + " L Forearm'"))
L_ForearmTwist.rotation.controller=LookAt_Constraint()
L_ForearmTwist.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " L Hand'")) 50.0
L_ForearmTwist.rotation.controller.viewline_length_abs = false
L_ForearmTwist.rotation.controller.upnode_world = false
L_ForearmTwist.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " L Hand'"))
L_ForearmTwist.wirecolor = (color 10 10 10)
L_ForearmTwist.boxmode = on
)
if((execute ("$'" + filterRootBoneName[1] + " R Forearm'") != undefined) and (execute ("$'" + filterRootBoneName[1] + " R Hand'") != undefined)) do
(
-- 오른쪽 손목 트위스트 본
R_ForearmTwist = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
R_ForearmTwist.name = filterRootBoneName[1] + " R_ForearmTwist"
R_ForearmTwist.width = ((execute ("$'" + filterRootBoneName[1] + " R Forearm'")).width) * 0.8
R_ForearmTwist.height = ((execute ("$'" + filterRootBoneName[1] + " R Forearm'")).height) * 0.8
R_ForearmTwist.length = ((execute ("$'" + filterRootBoneName[1] + " R Forearm'")).length) / 4
R_ForearmTwist.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R Forearm'")) #rotation))
R_ForearmTwist.pos = ((execute("$'"+filterRootBipName[1] + " R Forearm'")).transform.pos)
coordsys local move R_ForearmTwist [((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).length) - (((execute ("$'" + filterRootBoneName[1] + " R UpperArm'")).length) / 4),0,0]
R_ForearmTwist.parent = (execute ("$'" + filterRootBoneName[1] + " R Forearm'"))
R_ForearmTwist.rotation.controller=LookAt_Constraint()
R_ForearmTwist.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " R Hand'")) 50.0
R_ForearmTwist.rotation.controller.viewline_length_abs = false
R_ForearmTwist.rotation.controller.upnode_world = false
R_ForearmTwist.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " R Hand'"))
R_ForearmTwist.wirecolor = (color 10 10 10)
R_ForearmTwist.boxmode = on
)
if(((execute ("$'" + filterRootBoneName[1] + " L Thigh'")) != undefined) and ((execute ("$'" + filterRootBoneName[1] + " L Calf'")) != undefined)) do
(
-- 왼쪽 허벅지 트위스트 ExposeTM
ExposeTransformL = ExposeTransform()
ExposeTransformL.name = "ExposeTransform L"
ExposeTransformL.size = 1.5
ExposeTransformL.box = true
ExposeTransformL.cross = false
ExposeTransformL.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L Thigh'")) #rotation))
ExposeTransformL.pos = ((execute("$'"+filterRootBipName[1] + " L Thigh'")).transform.pos)
ExposeTransformL.parent = (execute ("$'" + filterRootBoneName[1] + " L Thigh'"))
ExposeTransformL.exposeNode = (execute ("$'" + filterRootBoneName[1] + " L Calf'"))
ExposeTransformL.useParent = false
ExposeTransformL.localReferenceNode = (execute ("$'" + filterRootBoneName[1] + " Pelvis'"))
ExposeTransformL.wirecolor = (color 10 10 10)
-- 왼쪽 허벅지 트위스트 더미
PointLThigh = point()
PointLThigh.name = filterRootBoneName[1] + " Point L Thigh"
PointLThigh.size = 1.0
PointLThigh.box = false
PointLThigh.cross = true
PointLThigh.pos = ((execute("$'"+filterRootBipName[1] + " Pelvis'")).transform.pos)
coordsys local move PointLThigh [10,0,0]
PointLThigh.parent = (execute ("$'" + filterRootBoneName[1] + " Pelvis'"))
reactContL = PointLThigh.pos.controller = Position_reactor()
PointLThigh.wirecolor = (color 10 10 10)
-- 왼쪽 허벅지 트위스트 본
L_ThighTwist = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
L_ThighTwist.name = filterRootBoneName[1] + " L_ThighTwist"
L_ThighTwist.width = ((execute ("$'" + filterRootBoneName[1] + " L Thigh'")).width) * 0.8
L_ThighTwist.height = ((execute ("$'" + filterRootBoneName[1] + " L Thigh'")).height) * 0.8
L_ThighTwist.length = ((execute ("$'" + filterRootBoneName[1] + " L Thigh'")).length) / 4
L_ThighTwist.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " L Thigh'")) #rotation))
L_ThighTwist.pos = ((execute("$'"+filterRootBipName[1] + " L Thigh'")).transform.pos)
L_ThighTwist.parent = (execute ("$'" + filterRootBoneName[1] + " L Thigh'"))
L_ThighTwist.rotation.controller=LookAt_Constraint()
L_ThighTwist.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " L Calf'")) 50.0
L_ThighTwist.rotation.controller.viewline_length_abs = false
L_ThighTwist.rotation.controller.upnode_world = false
L_ThighTwist.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " Point L Thigh'"))
L_ThighTwist.rotation.controller.upnode_ctrl = 0
L_ThighTwist.rotation.controller.StoUP_axisFlip = true
L_ThighTwist.wirecolor = (color 10 10 10)
L_ThighTwist.boxmode = on
reactContL.reactTo $'ExposeTransform L'.localPosition.controller
)
if(((execute ("$'" + filterRootBoneName[1] + " R Thigh'")) != undefined) and ((execute ("$'" + filterRootBoneName[1] + " R Calf'")) != undefined)) do
(
-- 오른쪽 허벅지 트위스트 ExposeTM
ExposeTransformR = ExposeTransform()
ExposeTransformR.name = "ExposeTransform R"
ExposeTransformR.size = 1.5
ExposeTransformR.box = true
ExposeTransformR.cross = false
ExposeTransformR.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R Thigh'")) #rotation))
ExposeTransformR.pos = ((execute("$'"+filterRootBipName[1] + " R Thigh'")).transform.pos)
ExposeTransformR.parent = (execute ("$'" + filterRootBoneName[1] + " R Thigh'"))
ExposeTransformR.exposeNode = (execute ("$'" + filterRootBoneName[1] + " R Calf'"))
ExposeTransformR.useParent = false
ExposeTransformR.localReferenceNode = (execute ("$'" + filterRootBoneName[1] + " Pelvis'"))
ExposeTransformR.wirecolor = (color 10 10 10)
-- 오른쪽 허벅지 트위스트 더미
PointRThigh = point()
PointRThigh.name = filterRootBoneName[1] + " Point R Thigh"
PointRThigh.size = 1.0
PointRThigh.box = false
PointRThigh.cross = true
PointRThigh.pos = ((execute("$'"+filterRootBipName[1] + " Pelvis'")).transform.pos)
coordsys local move PointRThigh [-10,0,0]
PointRThigh.parent = ((execute ("$'" + filterRootBoneName[1] + " Pelvis'")))
reactContR = PointRThigh.pos.controller = Position_reactor()
PointRThigh.wirecolor = (color 10 10 10)
-- 오른쪽 허벅지 트위스트 본
R_ThighTwist = Bonesys.createBone[0,0,0][1,0,0][0,0,1]
R_ThighTwist.name = filterRootBoneName[1] + " R_ThighTwist"
R_ThighTwist.width = ((execute ("$'" + filterRootBoneName[1] + " R Thigh'")).width) * 0.8
R_ThighTwist.height = ((execute ("$'" + filterRootBoneName[1] + " R Thigh'")).height) * 0.8
R_ThighTwist.length = ((execute ("$'" + filterRootBoneName[1] + " R Thigh'")).length) / 4
R_ThighTwist.rotation = (inverse(biped.getTransform (execute("$'"+filterRootBipName[1] + " R Thigh'")) #rotation))
R_ThighTwist.pos = ((execute("$'"+filterRootBipName[1] + " R Thigh'")).transform.pos)
R_ThighTwist.parent = (execute ("$'" + filterRootBoneName[1] + " R Thigh'"))
R_ThighTwist.rotation.controller=LookAt_Constraint()
R_ThighTwist.rotation.controller.appendTarget (execute ("$'" + filterRootBoneName[1] + " R Calf'")) 50.0
R_ThighTwist.rotation.controller.viewline_length_abs = false
R_ThighTwist.rotation.controller.upnode_world = false
R_ThighTwist.rotation.controller.pickUpNode = (execute ("$'" + filterRootBoneName[1] + " Point R Thigh'"))
R_ThighTwist.rotation.controller.upnode_ctrl = 0
R_ThighTwist.wirecolor = (color 10 10 10)
R_ThighTwist.boxmode = on
reactContR.reactTo $'ExposeTransform R'.localPosition.controller
)
)
select bons
destroydialog bipMirrbone
)
)
createdialog bipMirrbone
)
================================================================================
아는 동생의 집에서 이 스크립트를 사용했는데 문제가 발생했다.
확인해 본 결과 종전의 맥스버전에서는 당연히 바이패드가 'Bip01'로 지정이 되는데
2012, 2013버전에서는 'Bip001'로 변경된것이다.
허거덩~~~~
물론 바이패드 이름을 'Bip01'로 변경해주면 되지만 그건 그거 나름대로 스크립트 작업자로서 거부감이 들어서 수정작업을 했다.
수정을 하면서 보니 트위스트 본에도 문제가 있다는것을 알았다.
조금더 확인 한다음에 올릴걸~~ㅠ,.ㅠ
아무튼 수정하여 올린다.
피드 구독하기:
글 (Atom)