June 2, 2020

3ds Max Plugins

At this site I want to introduce some of my 3ds max old basic plugins. They are just basic examples how you can make plugins with max script and create your category in 3ds max. This max script plugins I made long time ago with max 9 as I was a student. You can visit me by script spot – todor.

List of some 3ds max plugins:

  1. Plane
  2. Segmented Plane
  3. Box
  4. Cylinder
  5. Sphere
  6. Haus
  7. Crone

Plane

This Plane is the first of my 3ds max plugins.

plugin simpleObject Plane
name:"Plane"
category:"#TVankov"
classID:#(0xe855567c, 0xbcd73b8b)
(
  parameters main rollout:params
 (
 width type:#float ui:width default:1
 hight type:#float ui:hight default:1
 )
 rollout params "Plane"
 (
 spinner width "Width" range:[0,90,1]
 spinner hight "Hight" range:[0,90,1]
 )
 
 
 
 
 on buildMesh do (
 
 vert_array = #()
 face_array = #()
 

 v1 = [ 1*width ,  1*hight , 0]
 v2 = [-1*width ,  1*hight , 0]
 v3 = [ 1*width , -1*hight , 0]
 v4 = [-1*width , -1*hight , 0]
 

 append vert_array v1
 append vert_array v2
 append vert_array v3
 append vert_array v4
 
 append face_array [1,2,3]
 append face_array [3,2,4]
 
 setMesh mesh   verts:vert_array   faces:face_array 
 )
 
 
 
 
 
 tool create
 (
 on mousePoint click do
 (
 case click of
 (
 1: coordsys grid (nodeTM.translation = gridPoint)
 )
 )
 
 on mouseMove click do 
 (
 case click of
 (
 2: ((width = abs(gridDist.x)) 
     (hight = abs(gridDist.y)))
 3: (#stop)
 )
 )
    ) 
)

Go UP | Back

Segmented Plane

Segmented Plane is the second of my 3ds max plugins.

plugin simpleObject SegmentedPlane 
name:"SegmentedPlane"
category:"#TVankov"
classID:#(0xe855567c, 0xbcd73b8b)
(
  parameters main rollout:params
 (
 seg_width type:#integer ui:seg_width default:3
 seg_hight type:#integer ui:seg_hight default:3
 width type:#float ui:width default:1
 hight type:#float ui:hight default:1
 )
 rollout params "SegmentedPlane"
 (
 spinner seg_hight "seg_hight" range:[2,100,10] type:#integer
 spinner seg_width "seg_width" range:[2,100,10] type:#integer
 spinner width "Width" range:[-1000,1000,1] type:#float 
 spinner hight "Hight" range:[-1000,1000,1] type:#float 
 )
 
 
 on buildMesh do (
 
 vert_array = #()
 face_array = #()

 for i=0 to seg_width  by 1 do
 (
 for j=0 to seg_hight  by 1 do
 (
 
 v = [ (i*width)/seg_width, (j*hight)/seg_hight  , 0  ] 
 print v 
 append vert_array v 
 )
 )
 


 if (width  >  0 and hight >  0) or (width  <  0 and hight <  0) then (
 
 for i=0 to seg_width-1 by 1 do
 (
 for j=1 to seg_hight  by 1 do
 (
 
 append face_array [i*(seg_hight+1)+j, (i+1)*(seg_hight+1)+j, (i+1)*(seg_hight+1)+j+1]
 append face_array [i*(seg_hight+1)+j, (i+1)*(seg_hight+1)+j+1, i*(seg_hight+1)+j+1]
 )
 )
 
 ) else (
 
 for i=0 to seg_width-1 by 1 do
 (
 for j=1 to seg_hight  by 1 do
 (
 append face_array [i*(seg_hight+1)+j, i*(seg_hight+1)+j+1, (i+1)*(seg_hight+1)+j+1]
 )
 )
 )
 
 
 setMesh mesh   verts:vert_array   faces:face_array 
 )
 
 tool create
 (
 on mousePoint click do
 (
 case click of
 (
 1: coordsys grid (nodeTM.translation = gridPoint)
 )
 )
 
 on mouseMove click do 
 (
 case click of
 (
 2: ( (width = gridDist.x)
    (hight = gridDist.y) )
 3: (#stop)
 )
 )
    )
)

Go UP | Back

Box

This box is the 3th of my 3ds max plugins.

plugin simpleObject NewBox
name:"Box"
category:"#TVankov"
classID:#(0x4ef2985b, 0x5eda3ff0)
(
  parameters main rollout:params
 (
 width type:#float ui:width default:1
 hight type:#float ui:hight default:1
 lenght type:#float ui:lenght default:1
 )
 rollout params "Box"
 (
 spinner width "Width" range:[0,90,1]
 spinner hight "Hight" range:[0,90,1]
 spinner lenght "Lenght" range:[-90,90,1]
 )
 
 
 
 
 on buildMesh do (
 
 vert_array = #()
 face_array = #()
 

 v1 = [ 1*width ,  1*hight , 0]
 v2 = [-1*width ,  1*hight , 0]
 v3 = [ 1*width , -1*hight , 0]
 v4 = [-1*width , -1*hight , 0]
 v5 = [ 1*width ,  1*hight , 1*lenght]
 v6 = [-1*width ,  1*hight , 1*lenght]
 v7 = [ 1*width , -1*hight , 1*lenght]
 v8 = [-1*width , -1*hight , 1*lenght]
 

 append vert_array v1
 append vert_array v2
 append vert_array v3
 append vert_array v4
 append vert_array v5
 append vert_array v6
 append vert_array v7
 append vert_array v8
 
 if lenght > 0 then (
 append face_array [2,1,3]
 append face_array [2,3,4]
 append face_array [3,7,4]--
 append face_array [8,4,7]--
 append face_array [7,3,1]
 append face_array [5,7,1]
 append face_array [5,6,8]--
 append face_array [5,8,7]--
 append face_array [2,5,6]
 append face_array [1,2,5]
 append face_array [4,8,6]--
 append face_array [2,4,6]--
 ) else (
 append face_array [1,2,3]
 append face_array [3,2,4]
 append face_array [7,3,4]--
 append face_array [4,8,7]--
 append face_array [3,7,1]
 append face_array [7,5,1]
 append face_array [6,5,8]--
 append face_array [8,5,7]--
 append face_array [5,2,6]
 append face_array [2,1,5]
 append face_array [8,4,6]--
 append face_array [4,2,6]--
 )
 
 
 
 setMesh mesh   verts:vert_array   faces:face_array 
 )
 
 
 
 
 
 tool create
 (
 on mousePoint click do
 (
 case click of
 (
 1: coordsys grid (nodeTM.translation = gridPoint)
 )
 )
 
 on mouseMove click do 
 (
 case click of
 (
 2: ((width = abs(gridDist.x)) 
     (hight = abs(gridDist.y)))
 3: ( lenght = gridDist.z )
 4: (#stop)
 )
 )
    ) 
)

Go UP | Back

Cylinder

This Cylinder is the 4th of my 3ds max plugins.

plugin simpleObject Cylinder 
name:"Cylinder"
category:"#TVankov"
classID:#(0xeb2ad4f, 0x190a419f)
(
  parameters main rollout:params
 (
 segments type:#integer ui:segments default:5
 radius type:#float ui:radius default:1.0
 height type:#float ui:height default:1.0
 )
 rollout params "Zilinder"
 (
 spinner segments "Segments " range:[2,500,10] type:#integer
 spinner height "height " range:[-100,100,0] type:#float 
 spinner radius "Radius " range:[0,100,0] type:#float
 )
 
 
 on buildMesh do (
 
 segm = segments + 1
 
 vert_array = #()
 face_array = #()
 
 for i=0 to 1 by 1 do( 

 append vert_array [0, i*height , 0]  
 
 for j=0 to segments by 1 do( 
 
 winkel = (j * (360.01 / segments) )
                
            vx = cos(winkel) * radius 
                
            vy = i*height 
                
            vz = sin(winkel) * radius 
 
 append vert_array [vx, vy, vz]  
 ) 
 )
 
 if  height > 0 then (
 
     for i=1 to segments by 1 do(
 append face_array[1,i+1,i+2 ] 
 )
 
 for i=1 to segments by 1 do(
 append face_array[i+1, i+segments+3, i+2 ]
 append face_array[i+2, i+segments+3, i+segments+4 ] 
 )
 
 for i=1 to segments by 1 do(
 append face_array[segments + i + 3, segments + 3 , segments + i + 4 ] 
 )
 ) else (
 for i=1 to segments by 1 do(
 append face_array[i+1,1,i+2 ] 
 )
 
 for i=1 to segments by 1 do(
 append face_array[i+segments+3, i+1, i+2 ]
 append face_array[i+segments+3, i+2, i+segments+4 ] 
 )
 
 for i=1 to segments by 1 do(
 append face_array[segments + 3, segments + i + 3 , segments + i + 4 ] 
 ) 
 )
 

 
 setMesh mesh   verts:vert_array   faces:face_array  
 )
 
 
 tool create
 (
 on mousePoint click do
 (
 case click of
 (
 1: coordsys grid (nodeTM.translation = gridPoint)
 )
 )
 
 on mouseMove click do 
 (
 case click of
 (
 2: (radius = gridDist.x)
 3: (height = gridDist.y)
 4: (#stop)
 )
 )
 )
)

Go UP | Back

Sphere

This Sphere is the 5th of my 3ds max plugins.

plugin simpleObject Bal
name:"Bal"
category:"#TVankov"
classID:#(0xeb2ad4f, 0x190a419f)
(
  parameters main rollout:params
 (
 segments type:#integer ui:segments default:5
 radius type:#float ui:radius default:1
 rings type:#integer ui:rings default:4
 )
 rollout params "Ball"
 (
 spinner segments "Segments " range:[3,500,10] type:#integer
 spinner rings "Rings " range:[3,10000,0] type:#integer 
 spinner radius "Radius " range:[0,10000,0] type:#float
 )
 
 
 on buildMesh do (
 
 
 segm = segments + 1
 
 if segm > 2 then (
 
 vert_array = #()
 face_array = #()
 anzahlPunkte = segments * rings

 for i=0 to rings - 1 by 1 do(
 
 
      ringRadius = sin(i * 180 / (rings - 1)) * radius
        
        ringY =cos(i * 180 / (rings - 1)) * radius
 
 for j=0 to segm - 1 by 1 do(
 
 winkel = (j * 360) / (segm - 1)
                
            vx =cos(winkel) * ringRadius
                
            vy = ringY
                
            vz = sin(winkel) * ringRadius
 
 append vert_array [vx, vy, vz]  
 ) 
 )

 
 for i=1 to rings-1 by 1 do(
 
 ring = 0   
 seg = 0
 
   for j=1 to segm - 1 by 1 do(
                             
         if i == rings - 1 then (
                 ring = 0
         ) else (
                  ring = i
         )
                
         
          if j == segm then (
                seg = 0
          ) else (
                  seg = j
         )
 
 append face_array[ ring*segm+seg,(ring+1)*segm+seg+1, (ring+1)*segm+seg]
 append face_array[ ring*segm+seg,ring*segm+seg+1,(ring+1)*segm+seg+1]
 )
 )
 
 
 for i=0 to rings by 1 do(
 
 for j=0 to segments by 1 do(
 
 ring = 0                               
        if i == rings - 1 then (
                 ring = 0
        ) else (
                 ring = i
        )
                
        seg = 0
        if j == segments  - 1 then (
                 seg = 0
        ) else (
                 seg = j
        )
 

 
 )
 )
 )


 setMesh mesh   verts:vert_array   faces:face_array  
 )
 
 tool create
 (
 on mousePoint click do
 (
 case click of
 (
 1: coordsys grid (nodeTM.translation = gridPoint)
 )
 )
 
 on mouseMove click do 
 (
 case click of
 (
 2: (radius = abs(gridDist.x))
 3: (#stop)
 )
 )
 )
)

Go UP | Back

Haus

This Haus is the 6th of my 3ds max plugins.

plugin simpleObject Hasus
name:"Haus"
category:"#TVankov"
classID:#(0x3e2cb992, 0x65416766)
(
  parameters main rollout:params
 (

 width type:#float ui:width default:1
 hight type:#float ui:hight default:1
 lenght type:#float ui:lenght default:1
 dach type:#float ui:dach default:1
 )
 rollout params "Haus"
 (
 spinner width "Width" range:[0,90,1]
 spinner hight "Hight" range:[0,90,1]
 spinner lenght "Lenght " range:[0,90,1]
 spinner dach "Dach " range:[0,90,1]
 )
 
 
 on buildMesh do (
 
 vert_array = #()
 face_array = #()

 v1 = [ 1*width,  1*hight, -1*lenght]
 v2 = [-1*width,  1*hight, -1*lenght]
 v3 = [-1*width,  1*hight,  1*lenght]
 v4 = [ 1*width,  1*hight,  1*lenght]
 v5 = [ 1*width, -1*hight, -1*lenght]
 v6 = [-1*width, -1*hight, -1*lenght]
 v7 = [-1*width, -1*hight,  1*lenght]
 v8 = [ 1*width, -1*hight,  1*lenght]
 v9 = [       0,       0 ,  2*lenght]
 

 append vert_array v1
 append vert_array v2
 append vert_array v3
 append vert_array v4
 append vert_array v5
 append vert_array v6
 append vert_array v7
 append vert_array v8
 append vert_array v9
 
 append face_array [1,2,3]
 append face_array [3,4,1]
 append face_array [1,2,6]
 append face_array [1,6,5]
 append face_array [1,4,5]
 append face_array [5,4,8]
 append face_array [3,6,2]--
 append face_array [3,7,6]--
 append face_array [6,5,7]
 append face_array [7,5,8]
 append face_array [7,4,3]
 append face_array [8,4,7]
 --dach
 append face_array [1,2,9]
 append face_array [2,3,9]
 append face_array [3,4,9]
 append face_array [4,1,9]


 setMesh mesh   verts:vert_array   faces:face_array 
 )
 
 tool create
 (
 on mousePoint click do
 (
 case click of
 (
 1: coordsys grid (nodeTM.translation = gridPoint)
 )
 )
 
 on mouseMove click do 
 (
 case click of
 (
 2: (width = abs(gridDist.x))
 3: (hight = abs(gridDist.y))
 4: (lenght = abs(gridDist.z))
 5: (#stop)
 )
 )
 )
)

Go UP | Back

Crone

This Crone is the 6th of my 3ds max plugins.

plugin simpleObject  Crone 
name:"Crone"
category:"#TVankov"
classID:#(0xeb2ad4f, 0x190a419f)
(
  parameters main rollout:params
 (
 segments type:#integer ui:segments default:5
 radius type:#float ui:radius default:1
 rings type:#integer ui:rings default:4
 )
 rollout params "Crone"
 (
 spinner segments "Segments " range:[2,500,10] type:#integer
 spinner rings "Rings " range:[0,10000,0] type:#integer 
 spinner radius "Radius " range:[0,10000,0] type:#float
 )
 
 
 on buildMesh do (
 
 vert_array = #()
 face_array = #()
 anzahlPunkte = segments * rings

 for i=0 to rings - 1 by 1 do(
 
      ringRadius = sin(i * 180 / (rings - 1)) * radius
        
        ringY =cos(i * 180 / (rings - 1)) * radius
 
 for j=0 to segments - 1 by 1 do(
 
 winkel = (j * 360) / (segments - 1)
                
            vx =cos(winkel) * ringRadius
                
            vy = ringY
                
            vz = sin(winkel) * ringRadius
 
 append vert_array [vx, vy, vz]  
 )
 
 )
 
    for i=0 to segments - 1 by 1 do(
 
 if i == segments  - 1 then (
                 seg = segments+1
        ) else (
                 seg = segments+i+2
        )
 
 )
 for i=1 to 1 by 1 do(
 
 ring = 0   
 seg = 0
 
   for j=1 to segments - 1 by 1 do(
 print i 
 print j
                             
         if i == rings - 1 then (
                 ring = 0
         ) else (
                  ring = i
         )
                
         
          if j == segments then (
                seg = 0
          ) else (
                  seg = j
         )
 
 append face_array[ ring*segments+seg,(ring+1)*segments+seg,(ring+1)*segments+seg+1]
 )
 ) 
 
 for i=0 to rings by 1 do(
 
 for j=0 to segments by 1 do(
 
 ring = 0                               
        if i == rings - 1 then (
                 ring = 0
        ) else (
                 ring = i
        )
                
        seg = 0
        if j == segments  - 1 then (
                 seg = 0
        ) else (
                 seg = j
        )
 
 
 
 )
 )


 

 setMesh mesh   verts:vert_array   faces:face_array  
 )
 
 tool create
 (
 on mousePoint click do
 (
 case click of
 (
 1: coordsys grid (nodeTM.translation = gridPoint)
 )
 )
 
 on mouseMove click do 
 (
 case click of
 (
 2: (radius = abs(gridDist.x))
 3: (#stop)
 )
 )
 )
)

Go UP | Back

Leave a Reply

Your email address will not be published. Required fields are marked *