Notifications
Clear all
[Closed] Problem With skin_morph
Nov 16, 2006 3:41 pm
Hi,everyone.
I have an idea to do “mirror morpher target” by use skin_morph function,
and it works !
mirrorboneLeft = bonesys.createBone $.pos ([$.max.x,$.pos.y,$.pos.z]) [0,0,1]
mirrorboneRight = bonesys.createBone $.pos ([$.min.x,$.pos.y,$.pos.z]) [0,0,1]
hide mirrorboneLeft
hide mirrorboneRight
addModifier $ (Skin_Morph ())
$.modifiers[#Skin_Morph].skinMorphOps.addBone mirrorboneLeft
$.modifiers[#Skin_Morph].skinMorphOps.addBone mirrorboneRight
$.modifiers[#Skin_Morph].skinMorphOps.createMorph mirrorboneLeft
$.modifiers[#Skin_Morph].skinMorphOps.setExternalNode mirrorboneLeft "Morph 0" $head04
$.modifiers[#Skin_Morph].skinMorphOps.mirrorPaste mirrorboneLeft
$.modifiers[#Skin_Morph].skinMorphOps.boneSetMorphEnabled mirrorboneLeft 1 false
update $
maxOps.CollapseNode $ off
delete mirrorboneLeft
delete mirrorboneRight
you can replace “$head04” with your target object, and get a mirror morpher target.
I tried it with 150000 polygons model and it works correctly !
But now I have a big problem about have a UI for this,
rollout unnamedRollout "Untitled" width:162 height:190
(
button btn1 "Button" pos:[34,42] width:93 height:27
on btn1 pressed do
(
mirrorboneLeft = bonesys.createBone $.pos ([$.max.x,$.pos.y,$.pos.z]) [0,0,1]
mirrorboneRight = bonesys.createBone $.pos ([$.min.x,$.pos.y,$.pos.z]) [0,0,1]
hide mirrorboneLeft
hide mirrorboneRight
addModifier $ (Skin_Morph ())
$.modifiers[#Skin_Morph].skinMorphOps.addBone mirrorboneLeft
$.modifiers[#Skin_Morph].skinMorphOps.addBone mirrorboneRight
$.modifiers[#Skin_Morph].skinMorphOps.createMorph mirrorboneLeft
$.modifiers[#Skin_Morph].skinMorphOps.setExternalNode mirrorboneLeft "Morph 0" $head04
$.modifiers[#Skin_Morph].skinMorphOps.mirrorPaste mirrorboneLeft
$.modifiers[#Skin_Morph].skinMorphOps.boneSetMorphEnabled mirrorboneLeft 1 false
update $
maxOps.CollapseNode $ off
delete mirrorboneLeft
delete mirrorboneRight
)
)
createDialog unnamedRollout 200 200
I made a simple UI,and do the same with “on button pressed do”,
And it not work !!
I think there is something different between run script directly and run by button,
or maybe maxscript’s bug…
Thanks to any help~