Catch material.load error

This commit is contained in:
Nikita Kruglickiy 2021-09-20 00:05:56 +06:00
parent a47d2b43f7
commit 844f9ed217

View File

@ -62,7 +62,11 @@ function MeshBuilder:initialize(link)
if (isURL(mat.basetexture)) then if (isURL(mat.basetexture)) then
mat = self:_createMaterial(mat.shader, mat.basetexture, mat.bumpmap, mat.options) mat = self:_createMaterial(mat.shader, mat.basetexture, mat.bumpmap, mat.options)
else else
mat = material.load(mat.basetexture) hasErr, mat = pcall(material.load, mat.basetexture)
if not hasErr then
mat = material.load("models/debug/debugwhite")
end
end end
local object = {name = name, mat = mat, holo = holo} local object = {name = name, mat = mat, holo = holo}