Class ToolsMaterials
Namespace: ValveResourceFormat.IO
Assembly: ValveResourceFormat.dll
Hammer's tools materials, with the attributes that decide what their faces compile to. The collision of a tools material is known without the game that has it, and compiled collision can be traced back to the material.
public static class ToolsMaterialsInheritance
object ← ToolsMaterials
Fields
Nodraw
The material of faces that are not drawn, and of collision no other tools material is found for.
public const string Nodraw = "materials/tools/toolsnodraw.vmat"Field Value
string
Occluder
The material of occluders.
public const string Occluder = "materials/tools/toolsoccluder.vmat"Field Value
string
Trigger
The material volumes of entities are built from, unless their class applies another.
public const string Trigger = "materials/tools/toolstrigger.vmat"Field Value
string
Methods
GetCollision(string)
Gets the collision faces with a tools material compile to.
public static MaterialCollision? GetCollision(string material)Parameters
material string
The path of the material.
Returns
The collision, or null when it is not a tools material whose collision differs from that of other materials.
GetCollisionLabel(KVObject)
Gets the generated texture of collision that no tools material compiles to, see ToolsMaterials.GetForCollision(KVObject, string?), which names the layers it interacts as.
public static ToolsMaterials.TextureLabel? GetCollisionLabel(KVObject collisionAttributes)Parameters
collisionAttributes KVObject
Collision attributes of compiled physics, see PhysAggregateData.CollisionAttributes.
Returns
The label, or null when the collision interacts as no layer.
GetForCollision(KVObject, string?)
Gets the tools material whose faces compile to the given collision. Collision in the default group with no layers of its own is not traced back, as faces with any other material compile to it too.
public static string? GetForCollision(KVObject collisionAttributes, string? surfaceProperty = null)Parameters
collisionAttributes KVObject
Collision attributes of compiled physics, see PhysAggregateData.CollisionAttributes.
surfaceProperty string?
The surface property of the collision, which picks between materials that compile to the same attributes.
Returns
string?
The path of the material, or null when no tools material compiles to that collision.
GetForEntity(string?, IFileLoader)
Gets the tools material the volume of an entity is built from: the one its class applies, or ToolsMaterials.Trigger where it applies none.
public static string? GetForEntity(string? entityClassName, IFileLoader fileLoader)Parameters
entityClassName string?
The class of the entity.
fileLoader IFileLoader
The file loader of the map, which decides the game whose classes are used.
Returns
string?
The path of the material, or null when no class is given.
GetForModelCollision(KVObject, bool)
Gets the tools material whose faces compile to the collision of a model, see ToolsMaterials.GetForCollision(KVObject, string?). The collision of a prop compiles to the same attributes as a tools material of the default group that excludes a layer, so a model that draws meshes only traces back collision in a layer of its own.
public static string? GetForModelCollision(KVObject collisionAttributes, bool drawsMeshes)Parameters
collisionAttributes KVObject
Collision attributes of compiled physics, see PhysAggregateData.CollisionAttributes.
drawsMeshes bool
Whether the model draws meshes, rather than being only collision.
Returns
string?
The path of the material, or null when no tools material compiles to that collision.
GetToolsLabel(string)
Gets the generated texture that names a tools material, filled with the color of its texture.
public static ToolsMaterials.TextureLabel? GetToolsLabel(string material)Parameters
material string
The path of the material.
Returns
The label, or null when the material is not known.
GetTriggerLabel(string)
Gets the generated texture the volumes of entities of a class built from ToolsMaterials.Trigger are shown with, so that volumes of different classes can be told apart.
public static ToolsMaterials.TextureLabel GetTriggerLabel(string entityClassName)Parameters
entityClassName string
The class of the entity.
Returns
The label, the same for a class wherever it is shown.

