This just recently became a issue where you cannot make a SurfaceAppearance us a thumbnail texture endpoint. (rbxthumb) This feature was useful for compressing textures. It appears that ROBLOX uses these endpoints or something in the software to switch the textures if the player is on a low-memory device. You can use these textures on a SpecialMesh, but no longer can use it. I was running this code on a few directories in the command line and up until a few months ago this no longer works. It cannot be done during runtime because of SurfaceAppearance ColorMap read permissions which is normal but just to clarify the context.
function extractAssetId(url)
local assetId
assetId = url:match("rbxassetid://(%d+)")
if assetId then return assetId end
assetId = url:match("rbxthumb://type=Asset&id=(%d+)&w=")
if assetId then return assetId end
return nil
end
local prefix="rbxassetid://"
local prefix="rbxthumb://type=Asset&id="
local size="&w=150&h=150"
local function compression(v)
if (v.ClassName=="Decal" or v.ClassName=="Texture") then
local id=extractAssetId(v.Texture)
if id then
v.Texture=prefix..id..size
end
elseif v.ClassName=="SpecialMesh" and v.TextureId~="" then
local id=extractAssetId(v.TextureId)
if id then
v.TextureId=prefix..id..size
end
elseif v.ClassName=="MeshPart" then
if v.TextureID~="" and v:FindFirstChildOfClass("SurfaceAppearance") then
v.TextureID=""
elseif v:FindFirstChildOfClass("SurfaceAppearance")==nil then
if v.Size.X<5 and v.Size.Z<5 then
local id=extractAssetId(v.TextureID)
if id then
v.TextureID=prefix..id..size
end
elseif v.Size.X<40 and v.Size.Z<40 then
local id=extractAssetId(v.TextureID)
if id then
v.TextureID=prefix..id..size
end
end
end
elseif v.ClassName=="SurfaceAppearance" and v.ColorMap~="" then
local id=extractAssetId(v.ColorMap)
if id then
if v.Parent.ClassName=="MeshPart" then
if v.Parent.Size.X<5 and v.Parent.Size.Z<5 then
v.ColorMap=prefix..id..size
elseif v.Parent.Size.X<40 and v.Parent.Size.Z<40 then
v.ColorMap=prefix..id..size
end
else
v.ColorMap=prefix..id..size
end
end
elseif v.ClassName=="ImageLabel" then
local id=extractAssetId(v.Image)
if id then
v.Image=prefix..id..size
end
elseif v.ClassName=="Tool" then
local id=extractAssetId(v.TextureId)
if id then
v.TextureId=prefix..id..size
end
end
end
So the gist is that you use to be able to use rbxthumb endpoints for surfaceappearances and meshparts but this is no longer possible for some reason.
Expected behavior
I expect that when I use a rbxthumb texture on a meshpart or surfaceappearance I can load the texture like any normal texture.