public record class SceneMenuItemA command the scene view's radial or context menu offers.
Remarks
The one registration behind both menus, and behind every mode's version of them. A mode is a set of verbs somebody uses constantly — extrude, bevel, sculpt, raise, paint — and doc 24's whole argument for modes is that a viewport cannot show every tool at once. A pie menu is the shape that answer takes: nothing on screen until it is asked for, and then four directions.
⚠ A command id rather than a delegate, and that is the same decision the toolbar and the menu bar already made. An entry that carried an action would be a second place a verb can live, with its own enablement and no keybinding — and the point of a command registry is that "Extrude" is one thing whether it is reached from a menu, a pie, a shortcut or the palette. What this adds is where, not what.
⚠ Mode is what makes it a per-mode menu rather than one long one. An entry naming a mode is offered only while that mode is active; one naming none is always offered. Without it every module's tools would be in every mode's pie, which is the wall of buttons modes exist to prevent — see IEditorMode.
context.Owns(registry.Add(new SceneMenuItem("blockout.extrude", SceneMenuSurface.Both) { Mode = "blockout", Art = IconArt.Of(MyIcons.Extrude) }));
Fields and properties (6)
public string CommandIdWhat it runs. Resolved when the menu opens, so enablement is current.
public SceneMenuSurface SurfaceWhich menu, or both.
public string? ModeWhich mode offers it, or for every mode.
public int OrderWhere it sits: lower comes first, and in a pie that means nearer the top.
public IconArt? ArtIts picture, or for a label alone.
public string LabelWhat it is called, or empty to take the command's own title.
Methods (1)
public SceneMenuItem(string CommandId, SceneMenuSurface Surface = Both)A command the scene view's radial or context menu offers.
Used by (2)
- EditorApplicationVixen.Editor.App
- SceneMenuTestsVixen.Editor.App.Tests