Table of Contents

Class CompositeShape

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

Holds shape data to create 3D representations of objects. Also allows shapes to be overlayed on top of one another recursively.

[DocumentAsJson]
public class CompositeShape
Inheritance
CompositeShape

Examples

"shape": { "base": "block/basic/cube" },
"shapeInventory": {
 	"base": "block/plant/bamboo/{color}/{part}-1",
 	"overlays": [ { "base": "block/plant/bamboo/{color}/{part}lod0-1" } ]
},

Fields

Base (Recommended) (Default: None)

The path to this shape file.

[DocumentAsJson]
public AssetLocation Base

Field Value

AssetLocation

Alternates (Optional) (Default: None)

The block shape may consists of any amount of alternatives, one of which will be randomly chosen when the shape is chosen.

[DocumentAsJson]
public CompositeShape[] Alternates

Field Value

CompositeShape[]

Format (Optional) (Default: VintageStory)

The format/filetype of this shape.

[DocumentAsJson]
public EnumShapeFormat Format

Field Value

EnumShapeFormat

InsertBakedTextures (Optional) (Default: false)

Whether or not to insert baked in textures for mesh formats such as gltf into the texture atlas.

[DocumentAsJson]
public bool InsertBakedTextures

Field Value

bool

offsetX (Optional) (Default: 0)

How much should this shape be offset on X axis?

[DocumentAsJson]
public float offsetX

Field Value

float

offsetY (Optional) (Default: 0)

How much should this shape be offset on Y axis?

[DocumentAsJson]
public float offsetY

Field Value

float

offsetZ (Optional) (Default: 0)

How much should this shape be offset on Z axis?

[DocumentAsJson]
public float offsetZ

Field Value

float

Overlays (Optional) (Default: None)

The shape will render all overlays on top of this shape. Can be used to group multiple shapes into one composite shape.

[DocumentAsJson]
public CompositeShape[] Overlays

Field Value

CompositeShape[]

QuantityElements (Optional) (Default: None)

If non zero will only tesselate the first n elements of the shape

[DocumentAsJson]
public int? QuantityElements

Field Value

int?

rotateX (Optional) (Default: 0)

How much, in degrees, should this shape be rotated around the X axis?

[DocumentAsJson]
public float rotateX

Field Value

float

rotateY (Optional) (Default: 0)

How much, in degrees, should this shape be rotated around the Y axis?

[DocumentAsJson]
public float rotateY

Field Value

float

rotateZ (Optional) (Default: 0)

How much, in degrees, should this shape be rotated around the Z axis?

[DocumentAsJson]
public float rotateZ

Field Value

float

Scale (Optional) (Default: 1)

The scale of this shape on all axes.

[DocumentAsJson]
public float Scale

Field Value

float

SelectiveElements (Optional) (Default: None)

If set will only tesselate elements with given name

[DocumentAsJson]
public string[] SelectiveElements

Field Value

string[]

VoxelizeTexture (Optional) (Default: false)

If true, the shape is created from a voxelized version of the first defined texture

[DocumentAsJson]
public bool VoxelizeTexture

Field Value

bool