JannisX11 / blockbench

Blockbench - A low poly 3D model editor
https://www.blockbench.net
GNU General Public License v3.0
3.29k stars 286 forks source link

`scale` property on CEM groups is not parsed #2246

Closed GeForceLegend closed 4 months ago

GeForceLegend commented 6 months ago

What are you trying to do, and what do you expect to happen?

Optifine's custom entity models support scale property for groups, for example, a shield jem generated from CEM template loader with scale changed on plate group:

{
    "textureSize": [64, 64],
    "models": [
        {
            "part": "plate",
            "id": "plate",
            "invertAxis": "xy",
            "translate": [0, -11, 1],
            "scale": 0.25,
            "boxes": [
                {
                    "coordinates": [-6, 0, -3, 12, 22, 1],
                    "uvNorth": [1, 1, 13, 23],
                    "uvEast": [0, 1, 1, 23],
                    "uvSouth": [14, 1, 26, 23],
                    "uvWest": [13, 1, 14, 23],
                    "uvUp": [13, 1, 1, 0],
                    "uvDown": [25, 0, 13, 1]
                }
            ]
        },
        {
            "part": "handle",
            "id": "handle",
            "invertAxis": "xy",
            "translate": [0, -11, 1],
            "boxes": [
                {
                    "coordinates": [-1, 8, -2, 2, 6, 6],
                    "uvNorth": [32, 6, 34, 12],
                    "uvEast": [26, 6, 32, 12],
                    "uvSouth": [40, 6, 42, 12],
                    "uvWest": [34, 6, 40, 12],
                    "uvUp": [34, 6, 32, 0],
                    "uvDown": [36, 0, 34, 6]
                }
            ]
        }
    ]
}

In game, the plate of shield model becomes small as expected, we expect this also happens in BlockBench. 2024-03-24_14 14 42

What happens instead?

Blockbench ignores scale property on groups, no place for adjusting it, and even throws this property away when saving this model. 20240324141918

Model format in which the issue occurs

Optifine entity model

Blockbench variant

Program

Blockbench version

4.9.4

Operating System

Windows10 Home 22H2 19045.4170

Installed Blockbench plugins

CEM Template Loader, Optimize (still happens on web variant without plugins)

ewanhowell5195 commented 6 months ago

for now i would suggest using animations to scale elements instead

GeForceLegend commented 6 months ago

for now i would suggest using animations to scale elements instead

Just found subgroups look do not support scales without animation, so animations is the better way for sure. But BlockBench should support this as it is documented in Optifine's doc.

ewanhowell5195 commented 6 months ago

blockbench should not delete the property from the model, but i do not think it should actually display it or have an option to change the value, since that will get confusing for the end user. There is nothing else like it in blockbench, so having a separate scale setting will just end up confusing people.

GeForceLegend commented 6 months ago

The sizeAdd property for elements works similar (but not all same) to the scale, I'm not sure if scale of root groups can be placed here.

image

And for deleting the value, blockbench may want to store the extra unnecessary things that are not parsed, as if blockbench keeps deleting properties not parsed, when optifine supports some new properties, blockbench will keep igoring them until next version (or even later), making content creators confused.