Hammerclass
Methods9
Showing 9 methods
public static void AssignAssetToSelection(Editor.Asset asset)
Assigns the asset to the current selection.
| Parameter | Type | Description |
|---|---|---|
| asset | Asset | — |
void—public static bool BuildMap(Editor.MapEditor.MapBuildPreset preset = 0, bool loadInEngine = False)
Compile the active map, as if the user pressed Build in the Build Map dialog with this preset. The dialog shows the progress. Never prompts to save - save first, the build compiles what's on disk. Returns false if the build couldn't start; `Editor.MapEditor.Hammer.BuildStatus` says why.
| Parameter | Type | Description |
|---|---|---|
| preset = 0 | MapBuildPreset | What to build. |
| loadInEngine = False | bool | Load the map in engine when it's built, if the dialog is set to. |
bool—public static void ReloadFromFile()
Reloads the active editor session from file with user prompt
void—public static bool RunCommand(string name)
Run a Hammer command by name on the active map, exactly as if its key binding was pressed. Returns false if no command has that name. See `Editor.MapEditor.Hammer.Commands` for what exists.
| Parameter | Type | Description |
|---|---|---|
| name | string | — |
bool—public static bool Save()
Save the active map to its file. Never prompts - returns false if the map has never been saved, so has no file to save to, or the save failed.
bool—public static void SelectFacesUsingMaterial(Editor.Asset asset)
Selects all faces using the asset, forces `Editor.MapEditor.Selection.SelectMode` to `Editor.MapEditor.SelectMode.Faces`
| Parameter | Type | Description |
|---|---|---|
| asset | Asset | — |
void—public static void SelectObjectsUsingAsset(Editor.Asset asset)
Selects all map nodes using the asset, appending them to the current selection.
| Parameter | Type | Description |
|---|---|---|
| asset | Asset | — |
void—No results match this filter.
Properties13
Showing 13 properties
public static Editor.MapDoc.MapDocument Editor.MapEditor.Hammer.ActiveMap { get; set; }
The active editor session's map document.
public static Editor.MapEditor.MapView Editor.MapEditor.Hammer.ActiveMapView { get; set; }
The view of the active map the user interacted with most recently.
public static string Editor.MapEditor.Hammer.BuildLog { get; set; }
Everything the last map compile printed.
string—public static string Editor.MapEditor.Hammer.BuildStatus { get; set; }
The Build Map dialog's status line - "Done", "Failed - Exit Code 1" and so on. Empty if no build has run.
string—public static System.Collections.Generic.IReadOnlyList`1<string> Editor.MapEditor.Hammer.Commands { get; set; }
Names of every Hammer command `Editor.MapEditor.Hammer.RunCommand(System.String)` can run - the same commands key bindings and menus trigger, like "Undo", "GroupSelection" or "FrameAllViews".
IReadOnlyList<string>—public static string Editor.MapEditor.Hammer.CompiledMapPath { get; set; }
Where the active map compiles to - its .vpk next to the .vmap. Null for a map that has never been saved.
string—public static Sandbox.Material Editor.MapEditor.Hammer.CurrentMaterial { get; set; }
Current Material - you can set this programmatically with `Editor.MapEditor.Hammer.SetCurrentMaterial(Editor.Asset)`
public static bool Editor.MapEditor.Hammer.HasUnsavedChanges { get; set; }
Whether the active map has changes that haven't been saved.
bool—public static bool Editor.MapEditor.Hammer.IsBuildingMap { get; set; }
Whether a map compile is running.
bool—public static System.Collections.Generic.IEnumerable`1<Editor.MapEditor.MapView> Editor.MapEditor.Hammer.MapViews { get; set; }
Every view of the active map, 2D and 3D.
No results match this filter.