Garry's Mod Wiki

matproxy

A library that allows implementing custom material proxies for materials.

Material proxies allow programmatically setting specific .vmt shader parameters on a per-entity basis, rather being global across all instances of a material.

Fields

table matproxy.ActiveList
This is used internally - although you're able to use it you probably shouldn't. A list of all active material proxies.
table matproxy.ProxyList
A list of all material proxies registered with matproxy. Add.

Methods

matproxy.Add( table matProxyData )
Register a material proxy. See matproxy for more general explanation of what they are.
matproxy.Call( string uname, IMaterial mat, Entity ent )
This is used internally - although you're able to use it you probably shouldn't. Called by the engine from OnBind. Calls bind method of the Lua material proxy.
matproxy.Init( string name, string uname, IMaterial mat, table values )
This is used internally - although you're able to use it you probably shouldn't. Called by the engine from OnBind. Calls init method of the Lua material proxy.
This is used internally - although you're able to use it you probably shouldn't. Called by engine to determine if a certain material proxy is registered in Lua.