Modding:CompositeShape: Difference between revisions

From Vintage Story Wiki
m (fix typo)
(Fix API link)
 
Line 1: Line 1:
[https://apidocs.vintagestory.at/api/Vintagestory.API.Client.CompositeShape.html CompositeShape] is the type of the json object stored in the <code>shape</code> property of blocks, items, and entities. It primarily points to a shape file through the '''base''' field, but it also supports several post processing options.
[https://apidocs.vintagestory.at/api/Vintagestory.API.Common.CompositeShape.html CompositeShape] is the type of the json object stored in the <code>shape</code> property of blocks, items, and entities. It primarily points to a shape file through the '''base''' field, but it also supports several post processing options.


For example, linen.json rotates the shape file based on the rotation of the block.
For example, linen.json rotates the shape file based on the rotation of the block.

Latest revision as of 23:28, 4 October 2024

CompositeShape is the type of the json object stored in the shape property of blocks, items, and entities. It primarily points to a shape file through the base field, but it also supports several post processing options.

For example, linen.json rotates the shape file based on the rotation of the block.

	shapebytype: {
		"*-down": { base: "block/basic/layers/1voxel" },
		"*-up": { base: "block/basic/layers/1voxel", rotateX: 180 },
		"*-north": { base: "block/basic/layers/1voxel", rotateX: 90 },
		"*-east": { base: "block/basic/layers/1voxel", rotateX: 90, rotateY: 180, rotateZ: 270 },
		"*-west": { base: "block/basic/layers/1voxel", rotateX: 90, rotateY: 0, rotateZ: 270 },
		"*-south": { base: "block/basic/layers/1voxel", rotateX: 270 },
	},

Properties

Property Type Default Usage Reference
CompositeShape
base
string required The asset location of the main shape file. Any block
format
string "vintageStory" The format of the shape file pointed to by the base field. The valid formats are:
  • vintageStory
  • obj
  • gltfEmbedded (maybe broken? gltftest is disabled)
slopetestobj
insertbakedtextures
bool false This is only used for GLTF shapes. When true, the textures are imported from the shape and stored in the texture atlas. -
rotatex
angle in degrees 0 Rotates the shape around the [Coordinates x axis]. cobblestonestairs
rotatey
angle in degrees 0 Rotates the shape around the [Coordinates y axis]. cobblestonestairs
rotatez
angle in degrees 0 Rotates the shape around the [Coordinates z axis]. cobblestonestairs
offsetx
angle in degrees 0 Translates the shape along the [Coordinates x axis]. drycarcass-humanoid2
offsety
angle in degrees 0 Translates the shape along the [Coordinates y axis]. drycarcass-humanoid2
offsetz
angle in degrees 0 Translates the shape along the [Coordinates z axis]. drycarcass-humanoid2
scale
decimal number 1.0 The shape size is multiplied by this number. For example, setting this to 2.0 doubles the sides of the shape. rushmap
overlays
array of composite shapes empty Combines the overlay shapes with the base shape. archimedesscrew
alternates
array of composite shapes empty If alternates are present, then blocks choose one of these based on the block position. The alternates inherit the parent base field if it is unset in the alternate. looseboulders
voxelizetexture
bool false Only applies to blocks. If true, the inventory shape is generated from the first texture in the textures array of the block. When false, the inventory shape is the same as this shape. -
quantityelements
integer or null null When set, only this many cuboids are drawn from the shape. bunchocandles - to show a subset of the candles
selectiveelements
string array null When set, only render these subshapes from the shapes file. smallberrybush - to hide the fruit in the empty variant
ignoreelements
string array null When set, only hide these subshapes from the shapes file. boat
Icon Sign.png

Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.

Modding
Modding Introduction Getting Started Theme Pack
Content Modding Content Mods Developing a Content Mod Basic Tutorials Intermediate Tutorials Advanced Tutorials Content Mod Concepts
Code Modding Code Mods Setting up your Development Environment
Property Overview ItemEntityBlockBlock BehaviorsBlock ClassesBlock EntitiesBlock Entity BehaviorsWorld properties
Workflows & Infrastructure Modding Efficiency TipsMod-engine compatibilityMod ExtensibilityVS Engine
Additional Resources Community Resources Modding API Updates Programming Languages List of server commandsList of client commandsClient startup parametersServer startup parameters
Example ModsAPI DocsGitHub Repository