Created
October 27, 2016 06:19
-
-
Save Hoikohroh/42699cf08a16efb1414b0d461fed2bce to your computer and use it in GitHub Desktop.
Maxscript:XForm TypeIn for English
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
XForm TypeIn | |
for English | |
2016 10/27 | |
v001 | |
*/ | |
-- functions | |
function AddXformMod obj =( | |
xformMod = xform() | |
xformMod.name = "XForm TypeIn" | |
addModifier obj xformMod | |
xformMod | |
) | |
function AddCutomAttr obj = ( | |
XForm_CA = attributes "XForm_CA"( | |
parameters main rollout:params( | |
x_pos type:#float default:0 ui:x_pos_UI | |
y_pos type:#float default:0 ui:y_pos_UI | |
z_pos type:#float default:0 ui:z_pos_UI | |
x_rot type:#float default:0 ui:x_rot_UI | |
y_rot type:#float default:0 ui:y_rot_UI | |
z_rot type:#float default:0 ui:z_rot_UI | |
x_scale type:#float default:100.0 ui:x_scale_UI | |
y_scale type:#float default:100.0 ui:y_scale_UI | |
z_scale type:#float default:100.0 ui:z_scale_UI | |
) | |
rollout params "Parameters"( | |
group "Position"( | |
spinner x_pos_UI "x"range:[-100000,100000,0] | |
spinner y_pos_UI "y"range:[-100000,100000,0] | |
spinner z_pos_UI "z"range:[-100000,100000,0] | |
) | |
group "Rotation"( | |
spinner x_rot_UI "x"range:[-100000,100000,0] | |
spinner y_rot_UI "y"range:[-100000,100000,0] | |
spinner z_rot_UI "z"range:[-100000,100000,0] | |
) | |
group "Scale"( | |
spinner x_scale_UI "x"range:[-100000,100000,100.0] | |
spinner y_scale_UI "y"range:[-100000,100000,100.0] | |
spinner z_scale_UI "z"range:[-100000,100000,100.0] | |
) | |
) | |
) | |
custAttributes.add obj XForm_CA | |
) | |
-- exectute | |
myType = #(GeometryClass,shape) | |
for i in selection do( | |
if (findItem myType (superclassof i)) != 0 then( | |
mymod = AddXformMod i | |
AddCutomAttr mymod | |
paramWire.connect2Way mymod.gizmo[#Position][#X_Position] mymod.custAttributes[#XForm_CA][#x_pos] "x_pos" "X_Position" | |
paramWire.connect2Way mymod.gizmo[#Position][#Y_Position] mymod.custAttributes[#XForm_CA][#y_pos] "y_pos" "Y_Position" | |
paramWire.connect2Way mymod.gizmo[#Position][#Z_Position] mymod.custAttributes[#XForm_CA][#z_pos] "z_pos" "Z_Position" | |
paramWire.connect2Way mymod.gizmo[#Rotation][#X_Rotation] mymod.custAttributes[#XForm_CA][#x_rot] "degToRad x_rot" "radToDeg X_Rotation" | |
paramWire.connect2Way mymod.gizmo[#Rotation][#Y_Rotation] mymod.custAttributes[#XForm_CA][#y_rot] "degToRad y_rot" "radToDeg Y_Rotation" | |
paramWire.connect2Way mymod.gizmo[#Rotation][#Z_Rotation] mymod.custAttributes[#XForm_CA][#z_rot] "degToRad z_rot" "radToDeg Z_Rotation" | |
mymod.gizmo.scale.controller = ScaleXYZ () | |
paramWire.connect2Way mymod.gizmo[#Scale][#X_Scale] mymod.custAttributes[#XForm_CA][#x_scale] "x_scale /100.0" "X_Scale *100.0" | |
paramWire.connect2Way mymod.gizmo[#Scale][#Y_Scale] mymod.custAttributes[#XForm_CA][#y_scale] "y_scale /100.0" "Y_Scale *100.0" | |
paramWire.connect2Way mymod.gizmo[#Scale][#Z_Scale] mymod.custAttributes[#XForm_CA][#z_scale] "z_scale /100.0" "Z_Scale *100.0" | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment