95 lines
2.8 KiB
Plaintext
Executable File
95 lines
2.8 KiB
Plaintext
Executable File
-- Scripted object plugin - generated by Plug-O-Matic v1.1 (martin@breidt.net)
|
|
--
|
|
-- Run this script or place it script in the $scripts\startup directory.
|
|
-- This will create a new object under Geometry>Plug-O-Matic
|
|
-- Click and drag to create a new object. Hold Ctrl do constrain the new object
|
|
-- to the original proportions.
|
|
--
|
|
-- Export options used: Material IDs - false Smoothing Groups - true Edge Visibility - true
|
|
|
|
plugin simpleObject glue_mid
|
|
name:"glue_mid"
|
|
category:"GTA Building blocks"
|
|
classID:#(14416111,1363518818)
|
|
(
|
|
parameters main rollout:params (
|
|
length type:#float ui:length default:1.77393
|
|
width type:#float ui:width default:2.96753
|
|
height type:#float ui:height default:0.824215
|
|
)
|
|
rollout params "glue_mid Parameters" (
|
|
spinner length "Length" range:[0,10000,1.77393] align:#right fieldwidth:60
|
|
spinner width "Width" range:[0,10000,2.96753] align:#right fieldwidth:60
|
|
spinner height "Height" range:[0,10000,0.824215] align:#right fieldwidth:60
|
|
)
|
|
on buildMesh do
|
|
(
|
|
vp = #()
|
|
fl = #()
|
|
fs = #()
|
|
fe = #()
|
|
-- Vertex data ---------------------------
|
|
append vp [-1.48389,-0.783447,-0.412109]
|
|
append vp [-1.48389,0.886963,-0.412109]
|
|
append vp [-1.48389,-0.886963,-0.318798]
|
|
append vp [-1.48389,-0.886963,0.412106]
|
|
append vp [1.48364,-0.783447,-0.412109]
|
|
append vp [1.48364,0.886963,-0.412109]
|
|
append vp [1.48364,-0.886963,-0.318798]
|
|
append vp [1.48364,-0.886963,0.412106]
|
|
for i = 1 to 8 do (
|
|
oldpos = vp[i]
|
|
vp[i] = point3 (oldpos.x * (width/2.96753)) (oldpos.y * (length/1.77393)) (oldpos.z * (height/0.824215))
|
|
)
|
|
-- Face data ---------------------------
|
|
append fl [5,6,2]
|
|
append fl [2,1,5]
|
|
append fl [7,5,1]
|
|
append fl [1,3,7]
|
|
append fl [8,7,3]
|
|
append fl [3,4,8]
|
|
append fs 1
|
|
append fs 1
|
|
append fs 1
|
|
append fs 1
|
|
append fs 1
|
|
append fs 1
|
|
append fe #(true, true, false)
|
|
append fe #(true, true, false)
|
|
append fe #(true, true, false)
|
|
append fe #(true, true, false)
|
|
append fe #(true, true, false)
|
|
append fe #(true, true, false)
|
|
|
|
setMesh mesh vertices:vp faces:fl
|
|
for i = 1 to 6 do setFaceSmoothGroup mesh i fs[i]
|
|
for i = 1 to 6 do (
|
|
for j = 1 to 3 do (setEdgeVis mesh i j fe[i][j]))
|
|
) -- end on buildmesh
|
|
|
|
tool create prompt:"Click and drag to begin creation process. Hold Ctrl for original object proportions." (
|
|
on mousePoint click do (
|
|
case click of (
|
|
1: nodeTM.translation = gridPoint
|
|
3: #stop
|
|
)
|
|
)
|
|
on mouseMove click do (
|
|
case click of (
|
|
2: (
|
|
if not ctrlKey then (
|
|
width = 2.96753
|
|
length = 1.77393
|
|
) else (
|
|
old_width = 2.96753
|
|
width = 2.96753
|
|
length = 1.77393
|
|
height = 0.824215
|
|
)
|
|
)
|
|
3: if not ctrlKey then height = 0.824215
|
|
) -- end on case
|
|
) -- end on mouseMove
|
|
) -- end create tool
|
|
) -- end plugin
|