Vixen
feb85697
csharp
public interface ITexturing

Doc 48's texturing verbs, as a service: what the Tools menu runs and a plugin can call.

Read the guide page for this →

Remarks

Doc 50 § D2 one level down (#1306). The verbs were private methods of TexturingModule that only its commands could reach — so a plugin that wanted "bake the open stack the way the menu does" could not have it, and a test had to run a command by id. They are the module's public methods now, each command is a name for one of them, and the module publishes itself under this contract with PluginContext.Publish, so context.Services.Require<ITexturing>() reaches the same behaviour and is withdrawn when the module unloads.

⚠ Each verb acts on what the module has open and answers in a notification. The graph is the one OpenGraph opened and the stack the one OpenStack opened; with nothing open the verb says so on the shell's notification list rather than throwing, which is what a command run from a palette with nothing open has always done.

⚠ The service is the module itself rather than a class beside it. Blockout's verbs read dials a mode owns and moved out into BlockoutVerbs; these read the open documents, the baker, the brush and the armed force-bake, which are the module's state — doc 50 § D2's "the state moves with the verb" — so the verbs stayed where that state is and moved into a file of their own (TexturingVerbs.cs) rather than into a second object that would reach back for every field.

Methods (10)

  • void OpenGraph()

    Opens the .vxtexgraph selected in the Project panel on the Texture Graph canvas.

  • void OpenStack()

    Opens the .vxlayers or .vxsmartmat selected in the Project panel in the layers panel.

  • void TogglePaint()

    Swaps the pointer between selecting and painting, and opens the paint pane when painting.

  • void BakeMaterial()

    Turns the open graph into a material in the project.

  • void BakeParallaxMaterial()

    Turns the open graph into a material that marches its own height map.

  • void BakeStackMaterial()

    Turns the open layer stack into one material per texture set.

  • void BakeSplatMap()

    Packs the open stack's layer weights into a splat map and binds it onto the material.

  • void BakeForced()

    Re-runs the last bake a painted-over map refused, and does nothing when none was.

  • void SaveSmartMaterial()

    Saves the open stack's chosen texture set onto the shelf as a .vxsmartmat.

  • void ApplySmartMaterial()

    Puts the .vxsmartmat selected in the Project panel on top of the open stack's chosen set.

Used by (4)

  • LayerStackEditingTestsVixen.Editor.Texturing.Tests
  • TexturingModuleVixen.Editor.Texturing
  • TexturingModuleReachTestsVixen.Editor.App.Tests
  • TexturingServiceTestsVixen.Editor.Texturing.Tests