Class ToolsVisibility
Namespace: ValveResourceFormat.Renderer.Editor
Assembly: Renderer.dll
Which tools-only content is drawn: entities that only exist in the editor, tools materials such as triggers and clips, and collision. It decides each draw of a tools material the way Hammer decides each material of a mesh.
public sealed class ToolsVisibility : IDrawFilterInheritance
object ← ToolsVisibility
Implements
Properties
HiddenToolBrushGroups
Gets or sets the hidden groups of tools materials, see ToolBrushGroups. A hidden group stays hidden whatever else shows tools materials. A group with no entity class is hidden whole, and one with a class only on the brushes of entities of that class, see ToolBrushGroups.GetEntityClass(SceneNode). The set is replaced whole, so a frame being drawn never reads it half changed.
public IReadOnlySet<(string Group, string? EntityClass)> HiddenToolBrushGroups { get; set; }Property Value
IReadOnlySet<(string Group, string? EntityClass)>
OpaqueCollision
Gets or sets whether collision and the shapes of tools materials are drawn opaque, rather than as translucent fills and edge lines.
public bool OpaqueCollision { get; set; }Property Value
bool
ShowTools
Gets or sets whether tools-only content is drawn: entities that only exist in the editor and tools materials. Off, only the content the game shows is drawn.
public bool ShowTools { get; set; }Property Value
bool
ShownCollision
Gets or sets the collision labels that are drawn, see PhysSceneNode.CollisionLabels. Collision is drawn while any of its labels is. The set is replaced whole, so a frame being drawn never reads it half changed.
public IReadOnlySet<string> ShownCollision { get; set; }Property Value
IReadOnlySet<string>
Methods
ApplyCollisionVisibility(IEnumerable<SceneNode>)
Shows the collision nodes that ToolsVisibility.ShownCollision names, and draws them and the shapes of tools materials opaque or translucent as ToolsVisibility.OpaqueCollision says.
public void ApplyCollisionVisibility(IEnumerable<SceneNode> nodes)Parameters
nodes IEnumerable<SceneNode>
The nodes, of which only collision and the shapes of tools materials are changed.
FilterLayers(IEnumerable<WorldLayer>)
The chosen layers to enable. Tools-only layers are left out while ToolsVisibility.ShowTools is off, see WorldLayer.IsToolsOnly.
public HashSet<WorldLayer> FilterLayers(IEnumerable<WorldLayer> chosenLayers)Parameters
chosenLayers IEnumerable<WorldLayer>
The layers chosen to be shown.
Returns
GetCollisionLabels(IEnumerable<SceneNode>)
Gets the distinct collision labels of the nodes, sorted.
public static string[] GetCollisionLabels(IEnumerable<SceneNode> nodes)Parameters
nodes IEnumerable<SceneNode>
The nodes, of which only collision that shows no tools material is read.
Returns
string[]
The labels, see PhysSceneNode.CollisionLabels.
GetVisibility(SceneNode, RenderMaterial)
Gets how a node draws one of its materials.
public DrawVisibility GetVisibility(SceneNode node, RenderMaterial material)Parameters
node SceneNode
The node.
material RenderMaterial
The material being drawn.
Returns
The visibility of the material on the node.
SetSelectedNodes(IReadOnlyList<SceneNode>)
Sets the selected nodes. They draw their tools materials even while those are hidden.
public void SetSelectedNodes(IReadOnlyList<SceneNode> nodes)Parameters
nodes IReadOnlyList<SceneNode>
The selected nodes.

