So I’ve created a litte script to turn every body part into editable meshes.
local LocalPlayer = game:GetService("Players").LocalPlayer
local AssetService = game:GetService("AssetService")
local Aliases = {LeftArm = "Left Arm", RightArm = "Right Arm", LeftLeg = "Left Leg", RightLeg = "Right Leg"}
local BodyParts = {
Head = {
Default = "heads/head"
},
Torso = {
Default = "meshes/torso",
Clothing = "Shirt"
},
["Left Arm"] = {
Default = "meshes/leftarm",
Clothing = "Shirt"
},
["Right Arm"] = {
Default = "meshes/rightarm",
Clothing = "Shirt"
},
["Left Leg"] = {
Default = "meshes/leftleg",
Clothing = "Pants"
},
["Right Leg"] = {
Default = "meshes/rightleg",
Clothing = "Pants"
}
}
LocalPlayer.CharacterAdded:Connect(function(character)
local overrideMesh = {}
for _, characterMesh in pairs(character:GetChildren()) do
if characterMesh:IsA("CharacterMesh") then
local name = characterMesh.BodyPart.Name
if Aliases[name] then
name = Aliases[name]
end
overrideMesh[name] = "rbxassetid://"..characterMesh.MeshId
characterMesh:Destroy()
end
end
for name, value in pairs(BodyParts) do
local part : Part = character:WaitForChild(name)
part.Transparency = 1
local id = overrideMesh[name] or "rbxasset://avatar/"..value.Default..".mesh"
local textureId
if value.Clothing then
if value.Clothing == "Shirt" then
textureId = character:FindFirstChildWhichIsA("Shirt").ShirtTemplate
else
textureId = character:FindFirstChildWhichIsA("Pants").PantsTemplate
end
end
if name == "Head" then
local face = part:WaitForChild("face") :: Decal
face.Transparency = 1
textureId = face.Texture
end
local meshHolder = Instance.new("MeshPart")
meshHolder.Size = Vector3.new(1, 1, 1)
local weld = Instance.new("Weld")
weld.Part0 = part
weld.Part1 = meshHolder
weld.Parent = meshHolder
local mesh = AssetService:CreateEditableMeshAsync(id)
mesh.Parent = meshHolder
local texture = AssetService:CreateEditableImageAsync(textureId)
texture.Parent = meshHolder
meshHolder.Parent = workspace
end
end)
The meshes look normal, But all textures are in the wrong place:
Is there a way to convert Shirt/Pants Templates and Face into the actual character texture?