Here you go! Handy one liner to use in the console:
l=Instance.new('LineHandleAdornment'); l.Thickness=1; function handle(i,p,c,len) l1=l:Clone(); l1.CFrame=p; l1.Length=len; l1.Color3=c; l1.Adornee=i; l1.Parent=i; end v3=Vector3.new; ps={v3(0.5,0.5,0.5),v3(0.5,-0.5,0.5),v3(-0.5,0.5,0.5),v3(-0.5,-0.5,0.5),v3(-0.5,0.5,-0.5),v3(-0.5,-0.5,-0.5),v3(0.5,0.5,-0.5),v3(0.5,-0.5,-0.5)}; for i,v in workspace:GetDescendants() do if v:IsA('BasePart') then c=v.Color; c=v3(c.R,c.G,c.B); c*=0.5; c=Color3.new(c.x,c.y,c.z); s=v.Size; for i=1,4 do p=CFrame.new(ps[i]*s); handle(v,p,c,s.Z) end for i=3,6 do p=CFrame.new(ps[i]*s,ps[i]*s+v3(1,0,0)); handle(v,p,c,s.X) end for i=2,9,2 do p=CFrame.new(ps[i]*s,ps[i]*s+v3(0,1,0)); handle(v,p,c,s.Y) end end end
…
Fine, I’ll format it.
function handle(part, position, color, length)
local line = Instance.new('LineHandleAdornment')
line.Thickness = 1
line.CFrame = position
line.Length = length
line.Color3 = color
line.Adornee = part
line.Parent = part
end
local v3 = Vector3.new
local positions =
{v3(0.5,0.5,0.5),
v3(0.5,-0.5,0.5),
v3(-0.5,0.5,0.5),
v3(-0.5,-0.5,0.5),
v3(-0.5,0.5,-0.5),
v3(-0.5,-0.5,-0.5),
v3(0.5,0.5,-0.5),
v3(0.5,-0.5,-0.5)}
for i,part in workspace:GetDescendants() do
if not part:IsA('BasePart') or part.ClassName == 'Terrain' then continue end
local color = part.Color
color = v3(color.R, color.G, color.B)
color *= 0.5
color = Color3.new(color.X, color.Y, color.Z)
local size = part.Size
for i = 1, 4 do
pos = CFrame.new(positions[i] * size)
handle(part, pos, color, size.Z)
end
for i = 3, 6 do
pos=CFrame.new(positions[i] * size, positions[i] * size + v3(1,0,0))
handle(part, pos, color, size.X)
end
for i = 2, 9, 2 do
pos=CFrame.new(positions[i] * size, positions[i] * size + v3(0,1,0))
handle(part, pos, color, size.Y)
end
end
I don’t know if i’d reccomend this method though, just for the fact it spawns 12 LineHandles for every single part. It’s incredibly laggy with just 8 classic houses (4.5k parts)
Maybe you can optimize this with occlusion culling, I don’t want to add it.
It also seems to not work great in shadow, as charlie said.