Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 05:48, 25 January 2025 by PenguinEncounter (talk | contribs)

This page is a draft, and is not complete.

When Figura loads your avatar, all the model files in your avatar are organized into a tree. The starting point of this tree is called models. All of the parts of your model, including cubes, meshes, and groups from your Blockbench models, as well as folders in your avatar and the model files themselves are converted to ModelParts and part of this tree.

The name models does not refer to any specific model file in your avatar. Instead, model files are created as children of the models folder. If your Blockbench model is inside a subfolder of your avatar, that folder becomes a child of models, and the model file becomes a child of the subfolder.

model.bbmodel
root
Head
Head
HeadLayer
RightArm
RightArm
RightArmLayer
Cool Name

To access a child part, index the parent part with the name of the child part.

There are two ways to index something in Lua. The first way is by using brackets and quotes:

models["model"]["Head"]

This code sample first gets the model part (a file named model.bbmodel) and then the Head group inside it. The name of the cube, mesh, group, folder, or file needs to be within the quotes. To access deeper parts (for example, a Hat cube within the Head group), add more indexing:

models["model"]["Head"]["Hat"]

The second way to index is shorter, and uses a . to separate the names.

This method only works if the name consists only of letters, numbers, and underscores and the first character isn't a number. If the name of a ModelPart contains characters not in that list, or if the name contains any spaces, you must use the first method to index that name.

For example, the following is equivalent to the code above for getting the Hat ModelPart.

models.model.Head.Hat