• RuntimesBugs
  • Scale skeleton root bone through CLI

We are trying to export the .json animation with a different scale through CLI. We can export textures with different resolutions and scales, but the root bone of the skeleton is not getting scaled. Can the scale of the root bone be changed and exported through CLI?

We tried with the below command but it didn't work.
Spine [-i <path>] [-m] [-o <path>] -s [scale] -e json[+pack]|binary[+pack]

    Related Discussions
    ...

    Unfortunately, it is not possible to directly scale the root bone of a skeleton through the Spine CLI during export. The scale parameter in the CLI is not applicable for scaling the skeleton's root bone during export. Instead, you can scale the skeleton data at runtime by setting the scale of the root bone after loading the data. Alternatively, you can export the project to JSON, import it back into Spine with a specified scale, and then export it again. This method allows you to scale the entire skeleton, including the root bone, before exporting.

    abhishek4693

    -s is not a valid parameter for the export CLI command.

    As Spinebot said, scaling bones is not possible during export. That is not possible either when exporting using the editor. The scale value that you can find in the JSON export file is used to scale the textures.

    Scaling bones is done while loading the skeleton data as explained in here.

    From 4.2, the scale setting used to scale textures is stored in the .atlas file. You could automate the process of scaling the skeleton during import by parsing this field and passing it to the skeleton reader.