Outliner
Outliner management
OutlinerElement()
Parent of all groups and elements in the outliner. All properties and methods can be used on groups and elements.
title
Title used for the hover tooltiptype
Type of the group or elementmenu
Context menu of the group or element type.selected
Array (or single object in case of group) or the selected elements of this typeall
Array of all groups or elements of this type
OutlinerElement#init()
Initializes the element so it can be used in the outliner.
OutlinerElement#addTo( destination )
Adds the element to a specific place in the outliner.
* destination
Can be a group, element or undefined for the outliner root.
OutlinerElement#sortInBefore( destination, index_mod )
Sorts the element in before another element.
* destination
Reference group or element
* index_mod
Modifier for the index. If 1, the element will be placed after (below) the destination.
OutlinerElement#getParentArray()
Returns the children array of the parent that the group or element is in.
OutlinerElement#showInOutliner()
Unfolds the outliner and scrolls up or down if necessary to show the group or element.
OutlinerElement#updateElement()
Updates the Vue node of the element. This is only necessary in some rare situations
OutlinerElement#remove()
Removes the element.
OutlinerElement#rename()
Marks the name of the group or element in the outliner for renaming.
OutlinerElement#saveName()
Saves the changed name of the element by creating an undo point and making the name unique if necessary.
OutlinerElement#createUniqueName()
Create a unique name for the group or element by adding a number at the end or increasing it.
OutlinerElement#isChildOf( group, max_levels )
Checks of the group or element is a child of group
.
* group
A group
* max_levels
The maximum number of generations that can be between the element and group
.
OutlinerElement#showContextMenu( event )
Displays the context menu of the element
* event
. Mouse event, determines where the context menu spawns.
Group
new Group( data )
data
Objectname
Group namechildren
Array of the groups contentorigin
Array of the group pivot pointrotation
Array of the group rotationreset
If a bone, whether to reset the informations of inherited bones in bedrock edition.shade
Whether to shade the contents of the groupselected
Whether the group is selectedvisibility
Whether the group is visibleexport
Whether to export the entire groupautouv
Auto UV setting for the children. Can be 0, 1 or 2.parent
Parent group or'root'
isOpen
Whether the group is currently opened in the outlinermesh
3D representation of the group when using bone rig
Group.selected
Static variable to get the currently selected groups. Note that children groups of this group can also have selected
to make them appear selected in the outliner, but will not be treated as the primary selected group
Group#extend( data )
Modify data of the group.
* data
Object of properties to apply to the group
Group#selectChildren( event )
Select the children of the group
Group#selectLow( highlight )
Select the group and its children without marking it the selected group.
* highlight: Boolean
Whether to highlight the group in the selection color in the outliner. Default is true.
Group#unselect()
Unselects the group
Group#matchesSelection()
Returns true if the content of the group matches the current selection.
Group#openUp()
Opens the group and all of its ancestor groups.
Group#remove( undo )
Removes the group
* undo
If true, an undo point will be created.
Group#resolve()
Remove the group and leave all of its children in the parent array.
Group#transferOrigin( origin )
Move the origin of a bone to a specific location without visually affecting the position of it's content.
* origin: Array
Position of the new 3D origin
Group#sortContent()
Sort the content of the group alphabetically. This will automatically create an undo point.
Group#duplicate()
Duplicate the group
Group#getSaveCopy()
Returns a copy of the group that can be used to save the group to a JSON file.
Group#getChildlessCopy()
Returns a copy of the group without the children. Internally used by the duplicate function.
Group#compile( undo )
Generates a copy of the group that can be used for undo points or to save in block model files.
* undo
Make the copy work for undo points.
Group#forEachChild( callback, type, for_self )
Run a funtion for each child of the group recursively.
* callback
Function to run for each child. First argument is the child.
* type
For which type to run the function. Can be Group
, NonGroup
, Cube
etc. or undefined.
* for_self
Whether to also run the function on itself.
Cube
Cubes represent regular cubes in the outliner. Cubes inherit all properties and methods from OutlinerElement and NonGroup.
new Cube( data ).init()
Creates a new cube and initializes it.
name: String
from: Array
First corner of the cube, relative to cube spaceto: Array
Second corner of the cubeorigin: Array
Cube pivot pointrotation: Array
Cube rotationinflate: Number
Inflate valueuv_offset: Array[2]
Box UV offset coordinatesvisibility: Boolean
autouv: Number
Auto UV setting. Can be 0, 1 or 2.export: Boolean
Whether to include the cube in exported files.mirror_uv: Boolean
Mirrors the UV on the X axis if using box UVshade: Boolean
-
color: Number
Base cube color as shown when untextured or in the outliner. Number between 0 and 7 mapping to the 8 colors.0.
Light Blue1.
Yellow2.
Orange4.
Red4.
Purple5.
Blue6.
Green7.
Lime
-
parent: String
faces: Object
Cube#extend( data: Object )
Copies properties from data to the cube.
Cube#size( axis: Number, floored: Boolean )
Returns the size of the cube on a specific axis or as an array.
floored: Boolean
If true, the size will be floored to get the assumed size to calculate box UV.
Cube#rotationAxis()
Returns the first axis that the cube is rotated around. Useful if the format only supports one axis of rotation.
Cube#getMesh()
Returns the ThreeJS mesh instance of the cube.
Cube#remove()
Removes the cube.
Cube#getUndoCopy( aspects )
Returns a copy of the cube like it is used in Undo saves.
Cube#getUndoCopy( aspects )
Returns a copy of the cube like it is used in .bbmodel files.
Cube#roll( axis, steps, origin)
Rolls the Cube around an axis by steps of 90 degrees.
axis: Integer
Rotation axissteps: Integer
Rotation steps. Each step is +90 degrees.origin: Array
Origin for the rotation. Defaults to the cube's origin.
Cube#flip( axis, center, skipUV )
Flips the cube.
axis: Integer
Flip axiscenter: Float
Coordinate of the flipping centerskipUV: Boolean
If true, the UV mapping of the cube won't be flipped.
Cube#transferOrigin( origin )
Move the origin of a bone to a specific location without visually affecting the position of it's content.
origin: Array
Position of the new 3D origin
Cube#getWorldCenter()
Returns the actual center of the cube in world space. Returns a ThreeJS Vector3.
Cube#setColor( index )
Assigns a marker color to the cube, out of 8 possible colors.
index: Integer
Index of default marker colors (ight_blue, yellow, orange, red, purple, blue, green, lime)
Cube#applyTexture( texture, faces )
Applies a texture to the cube.
texture: Texture
faces: Array|Boolean
Faces to assign the texture to. If true, the texture is applied to all 6 faces. If omitted, the texture is applied to the currently selected face.
Cube#mapAutoUV()
Automatically map the UV of the cube depending on its current auto UV mode.
Cube#move( value, axis, move_origin )
Moves the cube by an amount on the specified axis.
value: Float
Distance to move the cubeaxis: Integer
Axis to move the cube onmove_origin: Boolean
Whether to move the origin along with the element
Cube#moveVector( value, axis )
Move the cube by a specific vector in the cube's local space.
value: Vector3|Float
Movement distanceaxis: Integer
Ifvalue
is specified as a number, this is the movement axis.
Cube#resize( value, axis, negative, allow_negative )
Resizes the cube by a specified amount
value: Float
Resize valueaxis: Integer
Resize axisnegative: Boolean
If true, the object is resized in the negative direction on the specified axis.allow_negative: Boolean
If true, the function will allow negative cube sizes.
Locator
new Cube( data ).init()
Creates a new locator and initializes it.
name: String
from: Array
Position of the locator in local spaceexport: Boolean
Whether to include the locator in exported files.
Cube#extend( data: Object )
Copies properties from data to the locator.
Locator#getUndoCopy( aspects )
Returns a copy of the locator like it is used in Undo saves.
Locator#getUndoCopy( aspects )
Returns a copy of the locator like it is used in .bbmodel files.
Locator#flip( axis, center)
Flips the locator.
axis: Integer
Flip axiscenter: Float
Coordinate of the flipping center
Locator.getWorldCenter()
Returns the position of the locator in world space as a ThreeJS Vector3.
Locator.move( value, axis )
Moves the locator by a specified amounted axis.
value: Float
Movement distanceaxis: Integer
Movement axis