Nikita Kruglickiy 09be0ea795 UPDATE
2023-05-22 19:06:26 +03:00

203 lines
9.8 KiB
Plaintext

-- @shared
-- @name Audi A6 2012
-- @author Opti1337, DarkSupah
-- @include /koptilnya/mesh_loader/builder.txt
require("/koptilnya/mesh_loader/builder.txt")
DEBUG_MODE = true
local LINK = "https://raw.githubusercontent.com/koptilnya/gmod-data/main/a6.obj"
local SCALE = Vector(1)
local Materials =
{
Body = "models/debug/debugwhite",
Doors = {
basetexture = "https://i.imgur.com/VfIk2D6.png",
options = {
flags = 134219776,
color = Vector(0.7969166636467, 0.7969166636467, 0.73720490932465),
envmap = "env_cubemap",
envmaptint = Vector(0.069727085530758, 0.069727085530758, 0.069727085530758),
envmapsaturation = 0.69999998807907,
phong = 1,
phongexponent = 10.0,
}
},
BonnetLivery = {
basetexture = "https://i.imgur.com/MR4z42U.png",
options = {
flags = 0x0100,
baseLayout = {
x = 170,
y = 575,
w = 200,
h = 200
}
}
},
Shadow = "models/debug/debugwhite",
Grille = "models/shiny",
WindowsOutline = "models/debug/debugwhite",
Badge = "models/shiny",
Bottom = "models/debug/debugwhite",
ExhaustPipe = "models/debug/debugwhite",
ExhaustTip = "models/shiny",
RearLightsBase = "models/debug/debugwhite",
StopLights = "models/debug/debugwhite",
ReverseLights = "models/debug/debugwhite",
RearLightsGlass = "models/debug/debugwhite",
FrontLightsBase = "models/debug/debugwhite",
FrontLights = "models/debug/debugwhite",
FrontLightsGlass = "models/debug/debugwhite",
Floor = "models/debug/debugwhite",
Dashboard = "models/debug/debugwhite",
SteeringColumn = "models/debug/debugwhite",
InteriorChrome = "models/shiny",
Interior = "models/debug/debugwhite",
DoorPanels = "models/debug/debugwhite",
DoorPanelsLines = "models/debug/debugwhite",
DoorHandles = "models/shiny",
Seats = "models/debug/debugwhite",
Torpedo = "models/debug/debugwhite",
ShifterOutline = "models/shiny",
Mirrors = "debug/env_cubemap_model",
InteriorSheet = "https://i.imgur.com/qCRlK2o.jpeg",
Arrow = "models/debug/debugwhite",
DashDials = "https://i.imgur.com/hQVDw7M.png",
Seatbelts = "models/debug/debugwhite",
SeatbeltsCaps = "models/debug/debugwhite",
SeatbeltsLocks = "models/shiny",
SeatbeltLockButtons = "models/debug/debugwhite"
}
local Colors =
{
Body = Color(230,230,222),
Shadow = Color(25,25,25),
Grille = Color(130,130,130),
WindowsOutline = Color(30,30,30),
Badge = Color(130,130,130),
Bottom = Color(0,0,0),
ExhaustPipe = Color(40,40,40),
ExhaustTip = Color(130,130,130),
RearLightsBase = Color(40,40,40),
StopLights = Color(160,50,50),
ReverseLights = Color(120,120,120),
RearLightsGlass = Color(150,40,40),
FrontLightsBase = Color(30,30,30),
FrontLights = Color(50,50,50),
FrontLightsGlass = Color(140,140,140),
Floor = Color(50,50,50),
Dashboard = Color(50,50,50),
SteeringColumn = Color(50,50,50),
InteriorChrome = Color(130,130,130),
Interior = Color(50,50,50),
DoorPanels = Color(50,50,50),
DoorPanelsLines = Color(90,90,90),
DoorHandles = Color(140,140,140),
Seats = Color(50,50,50),
Torpedo = Color(50,50,50),
ShifterOutline = Color(130,130,130),
Mirrors = Color(255,255,255),
InteriorSheet = Color(255,255,255),
Arrow = Color(80,80,80),
DashDials = Color(255,255,255),
Seatbelts = Color(25,25,25),
SeatbeltsCaps = Color(35,35,35),
SeatbeltsLocks = Color(130,130,130),
SeatbeltLockButtons = Color(160,40,40)
}
local builder = {}
if SERVER then
builder = MeshBuilder:new(LINK)
local this = chip()
// Body group
builder:build("Body", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("Bonnet", Vector(0), Angle(0), SCALE + Vector(0.002), Color(255, 255, 255), Materials.BonnetLivery, this, this)
builder:build("Bonnet", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("Trunk", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("Doors", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Doors, this, this)
builder:build("FrontBumper", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("BodyMirrors", Vector(0), Angle(0), SCALE, Colors.Body, Materials.Body, this, this)
builder:build("FrontShadows", Vector(0), Angle(0), SCALE, Colors.Shadow, Materials.Shadow, this, this)
builder:build("RearShadow", Vector(0), Angle(0), SCALE, Colors.Shadow, Materials.Shadow, this, this)
builder:build("Bottom", Vector(0), Angle(0), SCALE, Colors.Shadow, Materials.Shadow, this, this)
builder:build("GrillOutline", Vector(0), Angle(0), SCALE, Colors.Grille, Materials.Grille, this, this)
builder:build("WindowsOutline", Vector(0), Angle(0), SCALE, Colors.WindowsOutline, Materials.WindowsOutline, this, this)
// Badges and stuff
builder:build("Badge", Vector(0), Angle(0), SCALE, Colors.Badge, Materials.Badge, this, this)
builder:build("RearBadges", Vector(0), Angle(0), SCALE, Colors.Badge, Materials.Badge, this, this)
builder:build("ExhaustPipes", Vector(0), Angle(0), SCALE, Colors.ExhaustPipe, Materials.ExhaustPipe, this, this)
builder:build("ExhaustTips", Vector(0), Angle(0), SCALE, Colors.ExhaustTip, Materials.ExhaustTip, this, this)
// Rear lights
builder:build("RearLightsBase", Vector(0), Angle(0), SCALE, Colors.RearLightsBase, Materials.RearLightsBase, this, this)
local stopLights = builder:build("StopLights", Vector(0), Angle(0), SCALE, Colors.StopLights, Materials.StopLights, this, this)
stopLights:suppressEngineLighting(true)
local revLights = builder:build("ReverseLights", Vector(0), Angle(0), SCALE, Colors.ReverseLights, Materials.ReverseLights, this, this)
revLights:suppressEngineLighting(true)
//builder:build("RearLightsGlass", Vector(0), Angle(0), SCALE, Colors.RearLightsGlass, Materials.RearLightsGlass, this, this)
// Front lights
builder:build("FrontLightsShadow", Vector(0), Angle(0), SCALE, Colors.FrontLightsBase, Materials.FrontLightsBase, this, this)
//builder:build("FrontLightsGlass", Vector(0), Angle(0), SCALE, Colors.FrontLightsGlass, Materials.FrontLightsGlass, this, this)
local frontLights = builder:build("FrontLights", Vector(0), Angle(0), SCALE, Colors.FrontLights, Materials.FrontLights, this, this)
frontLights:suppressEngineLighting(true)
// Interior
builder:build("Floor", Vector(0), Angle(0), SCALE, Colors.Floor, Materials.Floor, this, this)
builder:build("Dashboard", Vector(0), Angle(0), SCALE, Colors.Dashboard, Materials.Dashboard, this, this)
builder:build("TachoArrow", Vector(0), Angle(0), SCALE, Colors.Arrow, Materials.Arrow, this, this)
builder:build("SpeedArrow", Vector(0), Angle(0), SCALE, Colors.Arrow, Materials.Arrow, this, this)
builder:build("SteeringColumn", Vector(0), Angle(0), SCALE, Colors.SteeringColumn, Materials.SteeringColumn, this, this)
builder:build("InteriorChrome", Vector(0), Angle(0), SCALE, Colors.InteriorChrome, Materials.InteriorChrome, this, this)
builder:build("Interior", Vector(0), Angle(0), SCALE, Colors.Interior, Materials.Interior, this, this)
builder:build("DoorPanels", Vector(0), Angle(0), SCALE, Colors.DoorPanels, Materials.DoorPanels, this, this)
builder:build("DoorPanelsWood", Vector(0), Angle(0), SCALE, Colors.DoorPanelsLines, Materials.DoorPanelsLines, this, this)
builder:build("DoorHandles", Vector(0), Angle(0), SCALE, Colors.DoorHandles, Materials.DoorHandles, this, this)
builder:build("Seats", Vector(0), Angle(0), SCALE, Colors.Seats, Materials.Seats, this, this)
builder:build("RearSeats", Vector(0), Angle(0), SCALE, Colors.Seats, Materials.Seats, this, this)
builder:build("Torpedo", Vector(0), Angle(0), SCALE, Colors.Seats, Materials.Seats, this, this)
builder:build("ShifterOutline", Vector(0), Angle(0), SCALE, Colors.ShifterOutline, Materials.ShifterOutline, this, this)
builder:build("Mirrors", Vector(0), Angle(0), SCALE, Colors.Mirrors, Materials.Mirrors, this, this)
builder:build("ProfilesButtons", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("WindowControls", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("WindowLocks", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("Vents", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("ShifterDecals", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("TopControls", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("Multimedia", Vector(0), Angle(0), SCALE, Colors.InteriorSheet, Materials.InteriorSheet, this, this)
builder:build("Seatbelts", Vector(0), Angle(0), SCALE, Colors.Seatbelts, Materials.Seatbelts, this, this)
builder:build("SeatbeltsCaps", Vector(0), Angle(0), SCALE, Colors.SeatbeltsCaps, Materials.SeatbeltsCaps, this, this)
builder:build("SeatbeltsLocks", Vector(0), Angle(0), SCALE, Colors.SeatbeltsLocks, Materials.SeatbeltsLocks, this, this)
builder:build("RearSeatsChrome", Vector(0), Angle(0), SCALE, Colors.Interior, Materials.Interior, this, this)
builder:build("SeatbeltLockButtons", Vector(0), Angle(0), SCALE, Colors.SeatbeltLockButtons, Materials.SeatbeltLockButtons, this, this)
builder:build("DashDials", Vector(0), Angle(0), SCALE, Colors.DashDials, Materials.DashDials, this, this)
local result = builder:getResult()
else
PERMA.onPermissionsGained = function()
builder = MeshBuilder:new(LINK)
end
PERMA.build()
end