Skip to content

Commit 1ba48d7

Browse files
committed
📦 Update model meta display configuration
1 parent 3285fe1 commit 1ba48d7

File tree

2 files changed

+59
-19
lines changed

2 files changed

+59
-19
lines changed

docs/custom-backpack/model-metadata.mdx

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@ For clarification, the directory is named `backpacked` and not `backpack`. This
2222

2323
In the model meta directory, as created in the previous section, create a new JSON file with name of your backpack. The name must be the same as when you [registered the backpack](./register-the-backpack.md#registering), e.g. `<your_backpack_name>.json`.
2424

25-
Inside the newly created file, copy and paste in the following contents:
25+
Inside the newly created file, copy and paste in the following contents. The will act as a template for your backpack.
2626
```json title="<your_backpack_name>.json"
2727
{
2828
"shelf_offset": [0, 0, 0],
29-
"gui_display": {
30-
"rotation": [0, 0, 0],
31-
"translation": [0, 0, 0],
32-
"scale": [1.0, 1.0, 1.0]
29+
"display": {
30+
...
3331
}
3432
}
3533
```
@@ -51,33 +49,75 @@ Inside the newly created file, copy and paste in the following contents:
5149

5250
<div className="code-block">
5351

54-
### Property: `gui_display`
52+
### Property: `display`
5553

56-
This is an object that holds a GUI transform. This is applied when rendering the backpack model in list of available cosmetics.
57-
- `rotation` is an array that contains a local XYZ rotation for the model
58-
- `translation` is an array that contains a local XYZ translation for the model.
59-
- `scale` is an array that contains an XYZ scale for the model.
54+
This is an object that holds the display transforms for the model. This is used when rendering the backpack in the customisation menu and when rendering the backpack as an item. Luckily this is very easy to configure since it is exactly the same as configuring the display transforms for an item.
6055

6156
![Test](/img/breakdown_gui_display.png)
6257

6358
#### How to Configure
6459

65-
Open Blocbench and load the project for your backpack model. Disable the visibility of the `Straps` and `Player Model`, so only the `Backpack` elements are visible. Navigate to the **Display** tab at the top right, and under the **Slot** in the left sidebar, click the **GUI** icon. Configure your backpack to fit nicely into the GUI slot preview. Try to fill it without going outside the slot borders and set the `X` and `Y` rotation to `30` for convention. Then simply copy the values shown in Bloclbench to the `gui_display` property as shown below.
60+
Open Blocbench and load the project for your backpack model. Disable the visibility of the `Straps` and `Player Model`, so only the `Backpack` elements are visible. Navigate to the **Display** tab at the top right, and you will see a **Slot** section in the leftside bar. This section contains different scenarios where the backpack may be drawn. If you're using the backpack template, this will come preconfigured with default settings. Go through all the different slot options (**Thirdperson Right**, **Ground**, **GUI**, etc) and tweak them as you need.
6661

67-
These display settings:
62+
:::info
63+
It is not necessary to configure the **Thridperson Left** and **Firstperson Left** as these slots will be automatically inferred by the **Thridperson Right** and **Firstperson Right** slots. To ensure they are not configured, press the reset button for each transform (Rotation, Translation, and Scale) while selected on **Thridperson Left** slot, and repeat for the **Firstperson Left** slot. The backpack template will not have these slots configured by default.
64+
:::
6865

69-
![Test](/img/display_settings.png)
66+
![Test](/img/configured_displays.png)
7067

71-
Converts into:
72-
```json
68+
Once you've configured all your display transforms, export your model as a `Block/Item Model` to a temporary file (this can be deleted afterwards). Open the newly exported file (which should be a JSON file), and locate the `display` object. Copy the entire `display` object and replace the `display` object in your backpacks meta file.
69+
70+
Before replacing:
71+
```json title="<your_backpack_name>.json"
7372
{
74-
"gui_display": {
75-
"rotation": [30, 30, 0],
76-
"translation": [-1.75, 5.25, 0],
77-
"scale": [1.4, 1.4, 1.4]
73+
"shelf_offset": [0, 0, 0],
74+
"display": {
75+
...
7876
}
7977
}
8078
```
79+
80+
After replacing (your values may be different):
81+
```json title="<your_backpack_name>.json"
82+
{
83+
"shelf_offset": [0, 0, 0],
84+
"display": {
85+
"thirdperson_righthand": {
86+
"rotation": [75, -45, 0],
87+
"translation": [0.75, 5.75, 3.25]
88+
},
89+
"firstperson_righthand": {
90+
"rotation": [0, -45, 0],
91+
"translation": [-0.5, 4.5, 0.5],
92+
"scale": [0.5, 0.5, 0.5]
93+
},
94+
"ground": {
95+
"translation": [0, 4.75, -2]
96+
},
97+
"gui": {
98+
"rotation": [30, 35, 0],
99+
"translation": [-1.25, 4.25, 0],
100+
"scale": [1.1, 1.1, 1.1]
101+
},
102+
"head": {
103+
"rotation": [0, -180, 0],
104+
"translation": [0, 14.5, 2.5]
105+
},
106+
"fixed": {
107+
"rotation": [0, -180, 0],
108+
"translation": [0, 3.5, 1]
109+
},
110+
"on_shelf": {
111+
"translation": [0, 1.25, -4]
112+
}
113+
}
114+
}
115+
```
116+
117+
:::note
118+
Please note that `on_shelf` property is only applicable for addons in Minecraft 1.21.9 or above; however it can be safely left in the file even if on a lower version.
119+
:::
120+
81121
</div>
82122

83123
## Advanced Rendering

static/img/configured_displays.png

98.3 KB
Loading

0 commit comments

Comments
 (0)