Blockbench Reference Docs
    Preparing search index...

    Class Cube

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _static: { properties: any; temp_data: Record<string, any> }
    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
    origin: ArrayVector3
    preview_controller: NodePreviewController
    rescale?: boolean
    rotation: ArrayVector3
    rotation_axis: "x" | "y" | "z"
    scope: number
    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

    • get scene_object(): Object3D

      Returns Object3D

    • get temp_data(): Record<string, any>

      Returns Record<string, any>

    Methods

    • Parameters

      Returns this

    • Parameters

      • event: any
      • Optionaloutliner_click: boolean

      Returns void

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

      Parameters

      Returns string | false

    • Returns OutlinerElement

    • Parameters

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

      Returns void

    • Parameters

      • fc: (element: OutlinerElement) => void
      • Optionalundo_tag: string
      • Optionalselection_method: "all_selected" | "all_in_group"

      Returns OutlinerElement[]

    • Returns OutlinerNode[]

    • Returns number

    • Returns OutlinerNode[]

    • Parameters

      • flag: string

      Returns any

    • Parameters

      • Optionalaspects: any

      Returns any

    • Initializes the node. This should always be called when creating nodes that will be used in the outliner.

      Returns this

    • 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

      • toggle: any

      Returns true

    • Mark the element as selected

      Parameters

      • Optionalselect_children: boolean

      Returns this

    • Parameters

      • search_term_lowercase: string

      Returns boolean

    • Removes the node.

      Returns this

    • Returns this

    • Marks the name of the group or element in the outliner for renaming.

      Returns this

    • 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

    • Returns string

    • Saves the changed name of the element by creating an undo point and making the name unique if necessary.

      Parameters

      • Optionalsave: boolean

      Returns this

    • Parameters

      • Optionalevent: Event
      • Optionalis_outliner_click: boolean

      Returns false | Cube

    • Displays the context menu of the element

      Parameters

      • event: HTMLElement | Event

        Mouse event, determines where the context menu spawns.

      Returns this

    • Parameters

      • event: MouseEvent

      Returns this

    • Unfolds the outliner and scrolls up or down if necessary to show the group or element.

      Returns void

    • Parameters

      Returns this

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

      Parameters

      Returns void

    • Parameters

      • Optionalunselect_parent: boolean

      Returns this

    • Updates the Vue node of the element. This is only necessary in some rare situations

      Returns this

    • Parameters

      • override_options: {
            behavior: Record<string, any>;
            condition: ConditionResolvable;
            priority?: number;
        }

      Returns Deletable

    • Parameters

      • obj: any
      • Optionalkeep_uuid: boolean

      Returns OutlinerElement

    • Parameters

      • type: string

      Returns boolean

    • Parameters

      Returns void