Scripting API

Scripting API

ModelDescription

Record in Abyss.Core.Scenes, from Abyss.Core.

What an import says of a model besides its meshes — its nodes, materials and textures — read from the description the engine writes beside them; see ModelImporter.DescriptionOf.

public record ModelDescription

Constructors

ModelDescription

public ModelDescription(string? Scene, IReadOnlyList<int> Roots, IReadOnlyList<ModelNode> Nodes, IReadOnlyList<ModelMesh> Meshes, IReadOnlyList<ModelMaterial> Materials, IReadOnlyList<ModelTexture> Textures)

What an import says of a model besides its meshes — its nodes, materials and textures — read from the description the engine writes beside them; see ModelImporter.DescriptionOf.

Parameters

  • Scene: The name of the scene the file spawns, if it gives one.
  • Roots: The nodes at that scene's top, by index into Nodes.
  • Nodes: Every node of the file, in its order.
  • Meshes: Every mesh of the file, in its order.
  • Materials: Every material of the file, in its order.
  • Textures: Every texture of the file, in its order.

Properties

Scene

public string? Scene { get; init; }

The name of the scene the file spawns, if it gives one.

Roots

public IReadOnlyList<int> Roots { get; init; }

The nodes at that scene's top, by index into Nodes.

Nodes

public IReadOnlyList<ModelNode> Nodes { get; init; }

Every node of the file, in its order.

Meshes

public IReadOnlyList<ModelMesh> Meshes { get; init; }

Every mesh of the file, in its order.

Materials

public IReadOnlyList<ModelMaterial> Materials { get; init; }

Every material of the file, in its order.

Textures

public IReadOnlyList<ModelTexture> Textures { get; init; }

Every texture of the file, in its order.

Clips

public IReadOnlyList<ModelClip> Clips { get; init; }

Its clips, in the file's order; none for a model with none, or whose clips are left out.

Skins

public IReadOnlyList<ModelSkin> Skins { get; init; }

Its skins, in the file's order.

MorphChannels

public int MorphChannels { get; init; }

How many of its animations' channels moved a morph target's weights, which are not imported.

Paths

public IReadOnlyList<IReadOnlyList<string>> Paths { get; init; }

Each node's path of names below its prefab's root, by its place in ModelDescription.Nodes: what a clip names it by, the root's none. None from a model imported before they were written down.

Animated

public bool Animated { get; }

Whether its prefab has an animator: it has clips, or a skin to play another model's on.

Methods

Read

public static ModelDescription Read(string file)

Reads a description the engine wrote.

Parameters

  • file: The description, its whole path.

Exceptions

  • IOException: It cannot be read.
  • InvalidDataException: It is not a description this build reads.

Parse

public static ModelDescription Parse(string json)

Reads a description from its text.

Parameters

  • json

Exceptions

  • InvalidDataException: It is not a description this build reads.