SpecialMesh.MeshType=Enum.MeshType.Torso will be deprecated soon

As we’re developing our technology further, we are forced to reevaluate decisions made years ago in terms of behavior of specific objects to develop performance-oriented features.

As part of this, we will deprecate the Torso MeshType for SpecialMesh objects; after this change the behavior will be identical to that of a Brick.
If you are using SpecialMesh objects with MeshType Torso, the recommendation is to switch to using a Union operation instead.

This change will ship in the coming weeks.

36 Likes

Out of curiosity, how does deprecating a mesh type that no one uses improve performance?

3 Likes

It allows us to ship a new rendering system that improves performance without making a special case for this type.

29 Likes

So long, you weird trapezoidal thing you.

15 Likes

RIP to the roof models that are using this, lol.

7 Likes

If you’re wondering if your game has any Torso meshes, here’s a command you can run:

for _, name in pairs({"Workspace", "ServerScriptService", "ReplicatedFirst", "Lighting", "ServerStorage", "ReplicatedStorage", "StarterPlayer", "StarterGui", "StarterPack"}) do
	local service = game:FindService(name)
	local list = service and service:GetDescendants() or {}
	for i = 1, #list do
		if list[i].ClassName == "SpecialMesh" and list[i].MeshType == Enum.MeshType.Torso then
			print("Found", list[i]:GetFullName())
		end
	end
end

Turns out my game uses a few to create symmetrical wedges in this door model:


I should probably convert it to MeshParts anyways. (and fix the woodgrain lol)

12 Likes

Ah crud, I think I used it in my bomber to create tapered round fuselage sections.
Guess that’ll have to change!

Really, 303 of them? Thanks for the script Tomarty!

Was thinking of redoing parts of it anyway due to the fact that I saw a real B-25 at our airport last summer and took a bunch of pics of the areas I couldn’t find pictures of while building it.

I think it’s funny that you mention converting the Torso meshes to Union operations because CSG V2 can’t handle Torso meshes. Fortunately, CSG V1 can.

4 Likes

For anyone with large amounts of Torso meshes in their games, here’s some code to convert them to parts+wedges:

local properties = {
	"Size","CFrame","Color","Material","Anchored","Locked","CanCollide",
	"Transparency","Reflectance","Archivable","CollisionGroupId",
	"CustomPhysicalProperties","TopSurface","BottomSurface","LeftSurface",
	"RightSurface","FrontSurface","BackSurface"
}
function copyApperance(part1, part2)
	for _,property in pairs(properties) do
		part2[property] = part1[property]
	end
end

function convertTorsoMeshToPart(torso)
	local middle = Instance.new("Part")
	local wedge1,wedge2 = Instance.new("WedgePart"), Instance.new("WedgePart")
	copyApperance(torso, middle)
	copyApperance(torso, wedge1)
	copyApperance(torso, wedge2)
	
	local middleWidth = torso.Size.X - torso.Size.Z*0.6
	middle.CFrame = torso.CFrame
	middle.Size = Vector3.new(torso.Size.X - torso.Size.Z*0.6, torso.Size.Y, torso.Size.Z)
	wedge1.Size = Vector3.new(torso.Size.Z,torso.Size.Y,torso.Size.Z*0.3)
	wedge1.CFrame = torso.CFrame * CFrame.Angles(0,math.pi/2,0) * CFrame.new(0,0,-(middle.Size.X/2+wedge1.Size.Z/2))
	wedge2.Size = Vector3.new(torso.Size.Z,torso.Size.Y,torso.Size.Z*0.3)
	wedge2.CFrame = torso.CFrame * CFrame.Angles(0,-math.pi/2,0) * CFrame.new(0,0,-(middle.Size.X/2+wedge2.Size.Z/2))
	middle.Parent = torso.Parent
	wedge1.Parent = torso.Parent
	wedge2.Parent = torso.Parent
	
	torso:Destroy()
end

print("Starting")
for _,v in pairs(game:GetDescendants()) do
	pcall(function()
		if v:IsA("SpecialMesh") and v.MeshType == Enum.MeshType.Torso then
			convertTorsoMeshToPart(v.Parent)
		end
	end)
end
print("Done")

This can be ran by opening the command bar with the Command Bar button in the View tab, pasting the code into the command bar, and pressing enter. If you have torso meshes that are welded to anything, you’ll need to modify this to re-weld them (you can get the joints for parts with part:GetJoints()) or manually re-connect them.

33 Likes

lots of the laser tanks models I built in 2009 are still using the torso mesh. guess I’ll have to switch.

I use(d) it for CSG…

Oh noes, I use this mesh for roofs.

Used these types of meshes in a really old rig, thank you so much for the script!

Sorry, what I meant is that you can get a similarly looking shape by using CSG, not that you can just union the old object (although it appears you can with v1!)

3 Likes