Skip to content

Instantly share code, notes, and snippets.

@Hoikohroh
Created October 27, 2016 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hoikohroh/6deb68386dce48102fcd6cac9e85afb4 to your computer and use it in GitHub Desktop.
Save Hoikohroh/6deb68386dce48102fcd6cac9e85afb4 to your computer and use it in GitHub Desktop.
Maxscript:XForm TypeIn for Japanese
/*
XForm TypeIn
for Japanese
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_位置"
paramWire.connect2Way mymod.gizmo[#Position][#Y_Position] mymod.custAttributes[#XForm_CA][#y_pos] "y_pos" "Y_位置"
paramWire.connect2Way mymod.gizmo[#Position][#Z_Position] mymod.custAttributes[#XForm_CA][#z_pos] "z_pos" "Z_位置"
paramWire.connect2Way mymod.gizmo[#Rotation][#X_Rotation] mymod.custAttributes[#XForm_CA][#x_rot] "degToRad x_rot" "radToDeg X_回転"
paramWire.connect2Way mymod.gizmo[#Rotation][#Y_Rotation] mymod.custAttributes[#XForm_CA][#y_rot] "degToRad y_rot" "radToDeg Y_回転"
paramWire.connect2Way mymod.gizmo[#Rotation][#Z_Rotation] mymod.custAttributes[#XForm_CA][#z_rot] "degToRad z_rot" "radToDeg Z_回転"
mymod.gizmo.scale.controller = ScaleXYZ ()
paramWire.connect2Way mymod.gizmo[#Scale][#X_Scale] mymod.custAttributes[#XForm_CA][#x_scale] "x_scale /100.0" "X_スケール *100.0"
paramWire.connect2Way mymod.gizmo[#Scale][#Y_Scale] mymod.custAttributes[#XForm_CA][#y_scale] "y_scale /100.0" "Y_スケール *100.0"
paramWire.connect2Way mymod.gizmo[#Scale][#Z_Scale] mymod.custAttributes[#XForm_CA][#z_scale] "z_scale /100.0" "Z_スケール *100.0"
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment