Get RAPTOR

RaptorModelStorageSlots

Slots a model provider fills to replace Save, Save & unload, Load and Rename.

NamespaceAssemblyKindStability
Raptor.EditorToolsRaptor.Editorclasspreview, since 0.1.0

A model provider in another assembly can fill these slots on load, following the RaptorPropTool.CatalogProvider pattern. A filled slot replaces that whole action. A null slot uses RAPTOR's built-in store (RaptorModelStore). When the project's Model storage setting is "Provider only" (RaptorModelStore.ProviderOnly), a null slot refuses its action with "No provider".

public static class RaptorModelStorageSlots

Fields

BakeReplacesAnother

public static System.Func<RaptorModel, bool> BakeReplacesAnother;

Whether baking the model would overwrite the meshes of a different model saved under the same name. Baked meshes are keyed by name, and the provider decides how its saves link to their scene copies. When null, the built-in store's link is used.

One provider at a time. The last assignment wins, and null restores the built-in handler.

LightState

public static LightOp LightState;

Gets the lighting state shown for a model. When null, as with the built-in store, no lighting chip is shown.

One provider at a time. The last assignment wins, and null restores the built-in handler.

Load

public static LoadOp Load;

Loads a saved model.

One provider at a time. The last assignment wins, and null restores the built-in handler.

ModelsRoot

public static string ModelsRoot;

The folder for saved sources, stored as <root>/<name>/<name>.prefab. A provider can change it. Defaults to RaptorPaths.Data("Models").

One provider at a time. The last assignment wins.

Rename

public static RenameOp Rename;

Renames a saved model everywhere its name is used as a key.

One provider at a time. The last assignment wins, and null restores the built-in handler.

RenameRefusal

public static System.Func<string, string, string> RenameRefusal;

Gets the reason a rename would be refused, or null when it would succeed. The rename prompt checks it as the user types.

One provider at a time. The last assignment wins, and null restores the built-in handler.

Save

public static ModelOp Save;

Saves a model.

One provider at a time. The last assignment wins, and null restores the built-in handler.

SaveAndUnload

public static ModelOp SaveAndUnload;

Saves a model and removes the scene copy.

One provider at a time. The last assignment wins, and null restores the built-in handler.

Methods

SavedModels

public static List<(string name, string path)> SavedModels()

Gets the saved sources on disk, sorted by name. It queries the asset database, so avoid calling it on every repaint.

Returns: The name and prefab path of each.