A MAXScript programozási nyelv

Példaprogramok

Saját geometriát előállító szkript:

radius1 = 100 radius2 = 10 width = 10 vert_array = #() face_array = #() vert_count = 0 num_faces = 10 for a = 0 to 360 by 360/num_faces do ( v1 = [radius1*cos(a+width),radius1*sin(a+width),0] v2 = [radius1*cos(a-width),radius1*sin(a-width),0] v3 = [radius2*cos(a),radius2*sin(a),0] append vert_array v1 append vert_array v2 append vert_array v3 append face_array [vert_count+1,vert_count+3,vert_count+2] vert_count += 3 ) m = mesh vertices:vert_array faces:face_array

Pöttyös textúrát előállító szkript:

plugin textureMap Dalmatian name:"Dalmatian" classID:#(0x7f14579d, 0x5caf6eb8) extends:Cellular replaceUI:true ( parameters main rollout:params ( DColor1 type:#color default:(color 255 255 255) ui:color1 DColor2 type:#color default:(color 0 0 0) ui:color2 Dsize type:#float default:30.0 ui:dot_size Dspread type:#float default:10.0 ui:dot_spread Dsmooth type:#float default:20.0 ui:dot_smooth on DColor1 set val do delegate.divColor1 = delegate.divColor2 = val on DColor2 set val do delegate.cellColor = val on DSize set val do delegate.size = val on DSpread set val do delegate.spread = val/100.0 on DSmooth set val do ( delegate.lowthresh = 1.0-(val/50.0) delegate.midthresh = 1.0-(val/100.0) delegate.highthresh = 1.0 ) )--end params rollout params "Dalmatian Map Parameters" ( colorpicker color1 "Base Color" align:#right fieldwidth:48 colorpicker color2 "Dots Color" align:#right fieldwidth:48 spinner dot_smooth "Smoothing" range:[0,100,20] \ align:#left fieldwidth:40 across:3 spinner dot_spread "Spread" range:[0,100,10] align:#center fieldwidth:40 spinner dot_size "Dot Size" range:[0,100,30] align:#right fieldwidth:40 )--end rollout )--end plugin