Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function Dbg(...)
- Msg"[MatExt] "
- local res={}
- for k,obj in pairs({...}) do
- local add="ERR"
- if type(obj)=="IMaterial" then
- table.insert(res,"<MAT")
- if obj:IsError() then
- table.insert(res,"ERROR")
- end
- if obj:GetName() then
- table.insert(res,"'"..obj:GetName().."'")
- end
- if obj:GetShader() then
- table.insert(res,"'"..obj:GetShader().."'")
- end
- if obj:GetMaterialString("$basetexture")then
- table.insert(res,"'"..obj:GetMaterialString("$basetexture").."'")
- end
- local a=obj:GetMaterialTexture("$hdrbaseTexture")
- local b=obj:GetMaterialTexture("$hdrcompressedTexture")
- if a then
- table.insert(res,"HDR")
- end
- if b then
- table.insert(res,"COMPRESSED")
- end
- table.insert(res,">")
- elseif type(obj)=="ITexture" then
- table.insert(res,"<Tex")
- if obj:IsError() then
- table.insert(res,"ERROR")
- end
- if obj:GetName() then
- table.insert(res,"'"..obj:GetName().."'")
- end
- table.insert(res,">")
- elseif type(obj)=="string" then
- table.insert(res,obj)
- elseif type(obj)=="nil" then
- table.insert(res,tostring("<nil>"))
- else
- table.insert(res,tostring(obj))
- end
- end
- print(table.concat(res," "))
- end
Advertisement
Add Comment
Please, Sign In to add comment