zsmolnar79

Our folder structure is something like this (with more than 2 items of course)
- Graphics
- Ships
- ShipA
- ShipB
- Weapons
- Weapon1
- Weapon2
Each ship have their body built up from images that have the same name but are in their own folders. For example ShipA/body.png and ShipB/body.png, or slash.png

Both ships use both weapons, and have the same skeleton so it would be possible in theory to copy animations between them. But currently the Images root folder is set to Graphics so that they can access the shared Weapons folder. This means the slots store the relative path to their images, so ShipA's body slot stores Ships/ShipA/slash, ShipB stores Ships/ShipB/slash.
When we want to copy the anim_slash from ShipA to ShipB (by exporting ShipA to json and importing the anim to ShipB), if the anim is referencing the slash slot, it won't find it in ShipB because the path is different.

One solution could be to set the Images root for the Ships as their own folder (eg.Graphics/Ships/ShipA), that means the slots only store slash as the image file name which are correct and point to each ship's own slash.png. But then the shared Weapons folder becomes inaccessible to both ships. Even if we manually edit the path of the image in the editor to ../Weapons/Weapon1, it doesn't find these files.

We use a custom loader in our games so this would be no problem for it but we still need to be able to see these in the editor. Even if we have to manually enter the image paths that would be fine.

Or if there is another good solution to the above described problem, we'd be happy to try that as well :)

Thanks
zsmolnar79
  • Bài viết: 4

Nate

You could use Find and Replace to fix up attachment names after importing the animation.
Tree - Spine User Guide: Find and Replace

You could have the same weapons images in 2 places. The atlas will only contain them once (if you enable alias) but it may be a pain to remember to put the images in both places (or more if there are more ships). Likely the best solution is using the Graphics folder as the images folder for both skeletons.

FWIW, if you had a structure like ShipA/images1 and ShipB/image2, you can set the tree to not show the skeleton prefixes:
Hình đại diện của thành viên
Nate

Nate
  • Bài viết: 9835


Quay về Editor