2021-01-20 17:05:59 -06:00
|
|
|
%module helpers
|
|
|
|
|
|
|
|
%luacode {
|
|
|
|
function couch.TexturedMesh(meshfile, ...)
|
|
|
|
local mesh = couch.Mesh.FromFile(meshfile)
|
|
|
|
for i, texturefile in ipairs({...}) do
|
2021-01-22 18:44:43 -06:00
|
|
|
local material = mesh:GetMaterial(i - 1)
|
2021-01-20 17:05:59 -06:00
|
|
|
material.usesTex = true
|
|
|
|
material.tex = couch.Texture.FromFile(texturefile)
|
|
|
|
mesh:SetMaterial(i - 1, material)
|
|
|
|
end
|
|
|
|
return mesh
|
|
|
|
end
|
|
|
|
|
|
|
|
} // luacode
|
|
|
|
|
|
|
|
// Local Variables:
|
|
|
|
// mode: poly-swig
|
|
|
|
// End:
|