ParentType: Difference between revisions

From FiguraMC
PenguinEncounter (talk | contribs)
Move incomplete notice
Tag: 2017 source edit
PenguinEncounter (talk | contribs)
m give me a (paragraph) break
Tag: 2017 source edit
 
Line 89: Line 89:
----
----
{{aliases|RIGHT_LEG}}
{{aliases|RIGHT_LEG}}
Mimics the transformations of the vanilla player's right leg.
Mimics the transformations of the vanilla player's right leg.


Line 94: Line 95:
----
----
{{aliases|LEFT_LEG}}
{{aliases|LEFT_LEG}}
Mimics the transformations of the vanilla player's left leg.
Mimics the transformations of the vanilla player's left leg.


Line 99: Line 101:
----
----
{{aliases|RIGHT_ELYTRA|RightElytron|RIGHT_ELYTRON}}
{{aliases|RIGHT_ELYTRA|RightElytron|RIGHT_ELYTRON}}
Mimics the transformations of the vanilla player's right Elytra wing. Only rendered when the player has an Elytra equipped.
Mimics the transformations of the vanilla player's right Elytra wing. Only rendered when the player has an Elytra equipped.


Line 104: Line 107:
----
----
{{aliases|LEFT_ELYTRA|LeftElytron|LEFT_ELYTRON}}
{{aliases|LEFT_ELYTRA|LeftElytron|LEFT_ELYTRON}}
Mimics the transformations of the vanilla player's left Elytra wing. Only rendered when the player has an Elytra equipped.
Mimics the transformations of the vanilla player's left Elytra wing. Only rendered when the player has an Elytra equipped.


Line 109: Line 113:
----
----
{{aliases|CAPE}}
{{aliases|CAPE}}
Mimics the transformations of the vanilla player's cape, even if the player doesn't own a cape{{tag|verify}}.
Mimics the transformations of the vanilla player's cape, even if the player doesn't own a cape{{tag|verify}}.


Line 117: Line 122:
----
----
{{aliases|WORLD}}
{{aliases|WORLD}}
The ModelPart will be attached to the world, instead of your player.
The ModelPart will be attached to the world, instead of your player.


Line 128: Line 134:
----
----
{{aliases|HUD|HeadsUpDisplay|Gui|GUI|GraphicalUserInterface|JraficalUserInterface}}
{{aliases|HUD|HeadsUpDisplay|Gui|GUI|GraphicalUserInterface|JraficalUserInterface}}
The ModelPart will be rendered on your HUD, instead of in the world or attached to your model. Only the avatar owner and players spectating the owner, will be able to see the HUD ModelParts.
The ModelPart will be rendered on your HUD, instead of in the world or attached to your model. Only the avatar owner and players spectating the owner, will be able to see the HUD ModelParts.


Line 137: Line 144:
----
----
{{aliases|CAMERA|Billboard|BILLBOARD}}
{{aliases|CAMERA|Billboard|BILLBOARD}}
The ModelPart will always face the camera, like nameplates or particles in vanilla. This rendering mode is also called 'Billboard rendering.'
The ModelPart will always face the camera, like nameplates or particles in vanilla. This rendering mode is also called 'Billboard rendering.'


Line 142: Line 150:
----
----
{{aliases|SKULL|☠}} <!-- why -->
{{aliases|SKULL|☠}} <!-- why -->
The ModelPart will replace the vanilla Skull (placed player head blocks.)
The ModelPart will replace the vanilla Skull (placed player head blocks.)


Line 147: Line 156:
----
----
{{aliases|PORTRAIT}}
{{aliases|PORTRAIT}}
The ModelPart will be used to render the player icon in the player list (also called the TAB list.)
The ModelPart will be used to render the player icon in the player list (also called the TAB list.)


Line 154: Line 164:
----
----
{{aliases|ARROW}}
{{aliases|ARROW}}
The ModelPart will be used to replace arrows that are fired by the avatar owner. The ModelPart's pivot point has no effect on this ParentType. (0, 0, 0) is the point on the vanilla arrow's shaft just before the head of the arrow.
The ModelPart will be used to replace arrows that are fired by the avatar owner. The ModelPart's pivot point has no effect on this ParentType. (0, 0, 0) is the point on the vanilla arrow's shaft just before the head of the arrow.


Line 159: Line 170:
----
----
{{aliases|TRIDENT}}
{{aliases|TRIDENT}}
The ModelPart will be used to replace tridents that are thrown by the avatar owner. The ModelPart's pivot point has no effect on this ParentType. <!-- do we have a reference point for this? -->
The ModelPart will be used to replace tridents that are thrown by the avatar owner. The ModelPart's pivot point has no effect on this ParentType. <!-- do we have a reference point for this? -->


Line 164: Line 176:
----
----
{{aliases|ITEM}}
{{aliases|ITEM}}
This ParentType designates a custom item model that can be used with the [[Events/ITEM RENDER|<code>ITEM_RENDER</code> event]] to display a custom item.
This ParentType designates a custom item model that can be used with the [[Events/ITEM RENDER|<code>ITEM_RENDER</code> event]] to display a custom item.



Latest revision as of 03:23, 29 September 2024

This page is a stub. You can help this wiki by expanding it

ParentTypes dictate how Figura positions and renders parts in your model. For example, some (like Head or LeftLeg) cause the part to mimic the motions of a part of the standard Minecraft player model. Others (like LeftItemPivot) control the positioning of special parts like the player's currently held item, armor, and parrots. Finally, ParentTypes like World change the way the part is positioned entirely. Each ParentType has one or more names associated with them.

In Blockbench

In Blockbench, groups (and only groups, not cubes or meshes) can be assigned ParentTypes by starting the name of the group with one of the names below.

ⓘ Note

Keywords are case-sensitive. This means that changing the capitalization might make a keyword non-functional.

For example, all of the following group names will assign the ParentType of Head, which will cause the part to move and rotate like the vanilla player's head.

  • Head
  • HEAD
  • Head2
  • Headphones (be careful of assigning ParentTypes by accident!)

The following will not assign the ParentType of Head:

  • head ('head' isn't a ParentType name; capitalization matters)
  • BigHead (doesn't start with the ParentType)
  • HeAd ('HeAd' isn't a ParentType name)
ⓘ Warning

Watch out for English words that incidentally start with ParentType names, like Guitar, which assigns a ParentType of Hud (through its alias 'Gui'!)

Via Scripting

Calling setParentType on any ModelPart (including cubes and meshes) will override its ParentType.

Simply access the ModelPart and call setParentType on it, passing the ParentType as a string. For example:

local head = models.model.root.Head
head:setParentType("RightArm") -- make the part act like the vanilla player's right arm

To remove the ParentType from a ModelPart, use "None":

local head = models.model.root.Head
head:setParentType("None") -- remove the ParentType

ModelParts don't remember their original ParentType! If you need to reference the original ParentType of a ModelPart, get (getParentType) and store it in a variable and use it later:

local head = models.model.root.Head
local headParentType = head:getParentType() -- store the current ParentType for later
head:setParentType("None") -- clear the ParentType

List of ParentTypes

Vanilla model mimicry

None


Aliases: NONE, Model, MODEL

No special properties[verify]. The default behavior.

Head


Aliases: HEAD

Mimics the transformations of the vanilla player's head. Additionally, if there are no Skull ModelParts, Head ModelParts will be used to replace the vanilla skull[verify].

Body


Aliases: BODY

Mimics the transformations of the vanilla player's body (torso.)

RightArm


Aliases: RIGHT_ARM

Mimics the transformations of the vanilla player's right arm. Parts with this ParentType will be rendered in first-person view if the vanilla player's right arm would be visible (e.g. not holding any item.)

LeftArm


Aliases: LEFT_ARM

Mimics the transformations of the vanilla player's right arm. Parts with this ParentType will be rendered in first-person view if the vanilla player's left arm would be visible (e.g. not holding any item, and left-handed.)

RightLeg


Aliases: RIGHT_LEG

Mimics the transformations of the vanilla player's right leg.

LeftLeg


Aliases: LEFT_LEG

Mimics the transformations of the vanilla player's left leg.

RightElytra


Aliases: RIGHT_ELYTRA, RightElytron, RIGHT_ELYTRON

Mimics the transformations of the vanilla player's right Elytra wing. Only rendered when the player has an Elytra equipped.

LeftElytra


Aliases: LEFT_ELYTRA, LeftElytron, LEFT_ELYTRON

Mimics the transformations of the vanilla player's left Elytra wing. Only rendered when the player has an Elytra equipped.

Cape


Aliases: CAPE

Mimics the transformations of the vanilla player's cape, even if the player doesn't own a cape[verify].

Special rendering modes

These ParentTypes provide access to rendering functionality that might not be otherwise possible.

World


Aliases: WORLD

The ModelPart will be attached to the world, instead of your player.

World parts' position reflect their X/Y/Z coordinates in the world, relative to (0, 0, 0). 1 block is equivalent to 16 ModelPart units; to convert between world coordinates and ModelPart coordinates, scale each axis by a factor of 16 (or 1⁄16.)

A World ModelPart with rotation (0, 0, 0) faces south in the world, which is the opposite of Blockbench's North indicator.

World ModelParts are always visible in first-person view.

Hud


Aliases: HUD, HeadsUpDisplay, Gui, GUI, GraphicalUserInterface, JraficalUserInterface

The ModelPart will be rendered on your HUD, instead of in the world or attached to your model. Only the avatar owner and players spectating the owner, will be able to see the HUD ModelParts.

The top-left of the screen is (0, 0, 0); 1 ModelPart unit is equivalent to 1 GUI unit, which scales with the GUI Scale Minecraft option.

Decreasing the X coordinate (-X) will move the ModelPart to the right, and decreasing the Y coordinate (-Y) will move the ModelPart down. The Z axis determines the rendering order of parts, with lower Z values (including negative) rendering closer to the screen.

Camera


Aliases: CAMERA, Billboard, BILLBOARD

The ModelPart will always face the camera, like nameplates or particles in vanilla. This rendering mode is also called 'Billboard rendering.'

Skull


Aliases: SKULL,

The ModelPart will replace the vanilla Skull (placed player head blocks.)

Portrait


Aliases: PORTRAIT

The ModelPart will be used to render the player icon in the player list (also called the TAB list.)

(0, 0, 0) is the bottom center point on the icon, and the rendering area extends 4 units on the X axis in each direction (-4 to +4) and 8 units on the Y axis (0 to 8.)

Arrow


Aliases: ARROW

The ModelPart will be used to replace arrows that are fired by the avatar owner. The ModelPart's pivot point has no effect on this ParentType. (0, 0, 0) is the point on the vanilla arrow's shaft just before the head of the arrow.

Trident


Aliases: TRIDENT

The ModelPart will be used to replace tridents that are thrown by the avatar owner. The ModelPart's pivot point has no effect on this ParentType.

Item


Aliases: ITEM

This ParentType designates a custom item model that can be used with the ITEM_RENDER event to display a custom item.

This page is not complete! TODO: add pivots