• Editor
  • JSON data problem

Related Discussions
...

Hello

I am working on a project with several skins and different textures. Decided to try JSON to make it faster instead of making puzzle from hundreds of single textures in each skin.
The problem I have is when I imported data with JSON, it was fine, created one skin but when I wanted to make another skin with another textures, imported JSON with those textures and when I started connect them with skin placeholders, started to see MISSING or textures from the other skin, when they had same names.

I have different folder for each textures, but how can I fix that ? Is there any way?
It would speed up my work a lot.

I have to throw all hundreds of textures into one folder to be fine ? ;_;

Why didn't you duplicate the skin instead of importing Json to a new file? Are you splitting skins in different files?

So, if I understood correctly, you would like a warning that tells you to open the images folder, after you imported a Json? :think:
To check if you didn't copy the images that are in the new Json's path?


Oh, it seems like you changed the question while I was answering.

You can keep your textures in separate folders, make sure the Path matches the images location, you can easily select them and change the path through Find and Replace Tree - Spine User Guide: Find and Replace if you have Tree selection as Scope and Path as Field

Om well I am doing:

  1. Got project where I would like to have several characters
  2. Each character naturally has his own textures and JSON made in GIMP
  3. Each character's textures are in their own folder

In my project have skins like: Character 1, Character 2 etc. I though that I can import data and Spine will automatically connect their textures with source folders but it doesnt :/ instead, Spine connect entire project to the last used folder with textures and leaves missing regions for all textures which are not in this file.
When I set source to the folder in which I have folders with textures I got missing from all textures.
What is important, when I import JSON from GIMP or Photoshop, images dont have destination folder's path in the name but just same without it.

When I set all textures manually its fine, because Spine writes each texture's destination folder's name but it takes a lot of time to puzzle so much elements.


Ya, sorry for that, I changed it because was sure it works but it didnt after I changed skin :/

Does your folder structure look something like this?

Images
├── skin-2
│   ├── head.png
│   ├── body.png
│   ├── left-arm.png
│   ├── right-arm.png
│   └── weapon.png
├── skin-2
│   ├── head.png
│   ├── body.png
│   ├── left-arm.png
│   ├── right-arm.png
│   └── weapon.png
└── skin-3
    ├── head.png
    ├── body.png
    ├── left-arm.png
    ├── right-arm.png
    └── weapon.png

Or are your folder images scattered in different places?

Yes, they look almost same, only difference is that I have separated skins for heads and all heads are in the one folder. But generally it looks same.

Basically, you could do this:

  1. Duplicate the skin
  2. Select find and replace
  3. Check First occurence so it doesn't insert everything twice for path and name
  4. Check Regular expression as this trick is possible thanks to it, (if you click on the question mark you can see more options and suggestions)
  5. set the Scope to Current Skin
  6. set the Field to Path (Field has to be Path, but you can also select both Path and Name)
  7. Types: Region and Mesh so the slots or any other part of your skeleton doesn't accidentally get changed.
  8. Find: (.*)
  9. write the new name of the folder in Replace, plus $1 (e.g. Skin2/$1 )
  10. click Replace
    and you should see the new correct images.

Here's an image with the settings on the goblin example, where in "find" I've also added goblin/(.*) because it already had a folder path and it had to be replaced:

There's also a video at the end of this page showing a different way of doing it:
Skins - Spine User Guide

Thank you for your answer but images on the video or tutorial, have their path in the name for example: goblingirl/head and it isnt problem to change this path for the another name for example: goblinfamilly/head.

 My problem is that after I export textures from Photoshop or Gimp in JSON and then open it in my spine I got textures like: hand, head, body, spear etc without "foldername/" before the texture name. Even when I click Find and Replace I have textures with another name and I have to replace them one by one adding "foldername/". 

@Erikari Look on this video: Spine - Run animation tutorial - YouTube
it is about spineboy run animation but what is important, look on the right side where is tree, textures dont have "foldername/" in their names. I have same, just raw pictures without path

This is why you need to select Path as Field (:
I usually have them the same as you, so I know it will work. If after you tried, you're still unsure, you can send your project to contact@esotericsoftware.com linking to this topic and pointing out which skin to copy and what new folder you want to have and I can have a brief look at it. But you should do fine if you follow the above steps.

Decided to add here a little detail which helped me a lot!

In this case, when someone cant find raw images to change their path in the "Find and replace" tool, like me, just type (.*) in the "Find" bar and you will see all raw images in the place you selected.
Then just write in the "Replace" bar folder/$1 (where $1 will put your raw images names in this place) and then you will be able to add path to your raw images 😉

Good idea! I've edited the comment I wrote earlier to include a screenshot and the exact steps (: