Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --MAXSCRIPT RANDOMIZER
- --Author: Brad Applebaum
- --20170201
- try (closeRolloutFloater RolloutFloaterTemplate) catch()
- rollout RolloutTemplate "Randomizer"
- (
- checkbox rotCkBx "Rotation" checked:true tristate:0 align: #left pos:[20,10]
- checkbox scaleCkBx "Scale" checked:true tristate:0 align:#right pos:[120,10]
- checkbox xAxisCkBx "X Axis" checked:true tristate:0 pos:[15,55]
- checkbox yAxisCkBx "Y Axis" checked:true tristate:0 pos:[70,55]
- checkbox zAxisCkBx "Z Axis" checked:true tristate:0 pos:[125,55]
- button randomizeBtn "Randomize" pos:[60,80]
- label rotAxis "Rotation Axis" pos:[60,35]
- --mySelect = $ as array
- on randomizeBtn pressed do
- (
- mySelect = selection as array
- --mySelect = #(S)
- if mySelect.count < 1 then print "Error! Make a selection first."
- print mySelect
- myX = 0
- myY = 0
- myZ = 0
- if xAxisCkBx.checked do(myX = 1)
- if yAxisCkBx.checked do(myY = 1)
- if zAxisCkBx.checked do(myZ = 1)
- if rotCkBx.checked do
- (
- rotMin = 0
- rotMax = 360
- for i in mySelect do
- (
- myRotRNG = random rotMin rotMax
- print myRotRNG
- rotate i (angleaxis myRotRNG [myX,myY,myZ])
- )
- )
- if scaleCkBx.checked do
- (
- scaleMin = 0.5
- scaleMax = 1.5
- myScaleRNG = random scaleMin scaleMax
- for i in mySelect do
- (
- myScaleRNG = random scaleMin scaleMax
- print myScaleRNG
- i.scale = [myScaleRNG,myScaleRNG,myScaleRNG]
- )
- )
- )
- )
- RolloutFloaterTemplate = newrolloutfloater "Randomizer" 200 140
- addrollout RolloutTemplate RolloutFloaterTemplate
Add Comment
Please, Sign In to add comment