• Editor
  • How to set up two Spine environments for different versions?

  • Изменено

I’m currently working on two projects:

One - Spine version 4.2 for a pixel art project.
The other - Spine version 4.1 for another project.

Is there a way to set up two separate environments for Spine?

I can run two Spine, but the settings are not retained separately for each version.

Additionally, I currently have to close and reopen Spine every time I switch versions and reconfigure the environment settings, which slows down the workflow significantly.

Any advice or solutions would be greatly appreciated!

Related Discussions
...

To set up two separate environments for different Spine versions, you can use different OS user accounts. Each user account will have its own Spine settings, allowing you to maintain separate configurations for each version. This way, you can switch between user accounts to work on different projects without having to reconfigure settings each time. Alternatively, you can use scripts to manage the prefs.json file, which stores Spine settings. By creating scripts that copy the appropriate prefs.json for each version before launching Spine, you can automate the process of switching settings. The prefs.json file is located in the user folder:

  • Windows: <user home folder>\Spine\prefs.json
  • Mac: <user home folder>/Library/Application Support/Spine/prefs.json
  • Linux: <user home folder>/.spine/prefs.json

This approach allows you to quickly switch between environments without manually adjusting settings each time.

  • 11111 ответили на это сообщение.

    Spinebot This is not the answer I was looking for.
    I am an individual with one account, and I am working on two separate game projects.

    Dear Spinebot here interpreted environments a bit literally, please excuse it, it tried its best!

    Speaking of running different versions, you can simply launch Spine twiceif you need them open in parallel, and select the correct version from the launcher dropdown menu:
    https://esotericsoftware.com/spine-versioning#Choosing-a-Spine-editor-version
    https://esotericsoftware.com/spine-settings#Reuse-instance

    If instead what you're looking for is a quick shortcut to launch the right version for your project, (and you're on windows) you could create a little batch file next to your project files or on your desktop, named like the project and maybe also specifying the version you're launching, so that you can just double-click on it to launch the version you need for said project.

    To set it up you can create a new file in the notepad, write:

    cd C:\Program Files\Spine
    Spine -u 3.8.99

    where the directory on the first line has to be where Spine is installed, and the spine version at the second line matches the one you want to update and set Spine to.
    Then save the file and rename it to something like Spine-YourProject-3.8.99.bat (the naming is up to you but it has to end in .bat to work) double-click on it and enjoy!

    • 11111 ответили на это сообщение.

      Erika Different versions were executed separately using the method below, but unfortunately, the settings were not retained.
      The Pixel project is using a different viewport

      There's currently no way to have two instances of Spine use different preferences.

      If you want to use one set of preferences with one Spine version and another set of preferences with another (and don't run the two versions simultaniously), you could:

      1. Set up the preferences for the first version, copy prefs.json to e.g. prefs.4.1.json in the same folder
      2. Set up the preferences for the second version, copy prefs.json to e.g. prefs.4.2.json in the same folder
      3. Write a batch file for each version that will copy the prefs.x.y.json over to prefs.json, then starts Spine.

      Assuming you are working on Windows, and you created a prefs-4.2.39.json and a prefs-4.1.23.json file. here are two batch files that you can run:

      For 4.2.29

      @echo off
      REM Batch file to start Spine 4.2.39 with correct preferences
      
      REM Copy the correct preferences file
      copy /Y "%USERPROFILE%\Spine\prefs-4.2.39.json" "%USERPROFILE%\Spine\prefs.json"
      
      REM Change to Spine installation directory
      cd "C:\Program Files\Spine"
      
      REM Start Spine with specific version
      Spine -u 4.2.39
      
      pause

      For 4.1.23

      @echo off
      REM Batch file to start Spine 4.1.24 with correct preferences
      
      REM Copy the correct preferences file
      copy /Y "%USERPROFILE%\Spine\prefs-4.1.24.json" "%USERPROFILE%\Spine\prefs.json"
      
      REM Change to Spine installation directory
      cd "C:\Program Files\Spine"
      
      REM Start Spine with specific version
      Spine -u 4.1.24
      
      pause

      You can put those files anywhere, e.g. on your desktop, and double click them to start the specific Spine version with the respective preferences.

      Note: if you change the preferences in Spine, you will have to the prefs.json file over to prefs-x.y.z.json to update it!

      • Erika оценил это.

      Mario's answer is good, but a little extra info:

      prefs.json is used by Spine < 4.0. Spine >= 4.0 uses files in the settings folder. In that folder editor-1.json and views-1.json are used by Spine 4.0 and 4.1. editor-2.json and views-2.json are for Spine 4.2+. Everything else in that folder is Spine >= 4.0.

      We bump the version number of the settings files when we make changes that are incompatible with older versions, which isn't super often.

      Thank you for your help. Everything works well.

      • Erika оценил это.