Blockbench Reference Docs
    Preparing search index...

    Class Cube

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    allow_mirror_modeling?: boolean
    autouv: 0 | 1 | 2

    Auto UV setting, saved as an integer, where 0 means disabled, 1 means enabled, and 2 means relative auto UV (cube position affects UV)

    box_uv: boolean

    If the cube is using Box UV

    children?: OutlinerNode[]
    color: any
    export: boolean
    faces: { [fkey: string]: CubeFace }
    inflate: number

    Inflate adds an inflation value to all sides equally

    locked: boolean
    menu?: Menu
    mesh: Mesh<BufferGeometry, Material | Material[]> & {
        geometry: BufferGeometry & { faces: string[] };
        outline: Mesh;
    }
    mirror_uv: boolean

    UV mirror across the X axis when using Box UV

    name: string
    name_regex: (element?: OutlinerNode) => string | boolean
    old_name?: string
    origin: ArrayVector3
    parent: OutlinerNode & OutlinerNodeParentTraits | "root"
    preview_controller: NodePreviewController
    rescale?: boolean
    rotation: ArrayVector3
    rotation_axis: "x" | "y" | "z"
    selected: boolean
    shade: boolean

    Enable or disable shading based on face normal

    stretch: ArrayVector3
    type: string
    uuid: string
    uv_offset: ArrayVector2

    UV position for box UV mode

    visibility: boolean

    Visibility of the cube in the viewport

    all: Cube[]
    animator?: BoneAnimator
    behavior: Record<string, any>
    behavior_overrides: any[]
    hasAny: () => boolean

    Check if any elements of the type are in the project

    hasSelected: () => boolean

    Check if any elements of the type are currently selected

    isParent: false
    preview_controller: NodePreviewController
    properties: Record<string, Property<any>>
    selected: Cube[]
    types: Record<string, ElementTypeConstructor>
    uuids: { [uuid: string]: OutlinerNode }

    Accessors

    Methods

    • Create a unique name for the group or element by adding a number at the end or increasing it.

      Parameters

      • Optionalothers: OutlinerNode[]

      Returns string | false

    • Parameters

      • axis: number
      • center: number
      • OptionalskipUV: boolean

      Returns void

    • Checks of the group or element is a child of group.

      Parameters

      • node: OutlinerNode
      • max_levels: number

        The maximum number of generations that can be between the element and the group

      Returns boolean

    • Parameters

      • value: number
      • axis: number
      • negative: boolean
      • Optionalallow_negative: boolean
      • Optionalbidirectional: boolean

      Returns void

    • Rotate the cube around axis in 90 degree steps

      Parameters

      • axis: number

        Axis index

      • steps: number

        Number of steps

      • origin: ArrayVector3

        Rotation pivot

      Returns void

    • Transfer the origin to a new position, while updating from and to to keep the same visual position.

      Parameters

      Returns void