- Изменено
crash trying to copy slot to another skeleton.
I was trying to merge new stuff to an existing scene project. Editor crash right after trying to move slot across skeleton.
A second skeleton was imported on top of existing project and I was moving new slots to old skeleton.
To reproduce the crash:
1.Open the project in latest non-beta editor.
(note that I didn't try it on beta version because I have no plan on upgrading v4 in the near future)
- Select "RoomSign_L" and "RoomSign_R" on 1st skeleton
- Press P to trigger set parent state
- Select the root bone on the 2nd skeleton as the new parent.
It will crash right away
Nate написалDo you know how you managed to give the same name to two attachments under the same slot?
I guess I dragged it out from the skin placeholder. I probably was trying to move/clone the attachment for different skins.
Doing that should have renamed the region attachment to RoomSign_L2
. Any other ideas? We can fix the crash, but if there is a way to name two attachments under the same slot with the same name, that's what we really want to fix. It's invalid and could cause different problems elsewhere.
Could it be you imported JSON data to get the invalid attachment names? If not then there's some action in Spine that is not enforcing the name uniqueness.
Note the workaround so you aren't blocked is to rename one of the attachments for each slot with this problem, then the drag will succeed.
Yes, you are right. I create a new project to import the json. It is already structured like that. The image attachment is under the skin placeholder AND under the slot at the same time for 3F skin. I uploaded the json file in case you want to debug run the import code.
Here is the structure of the layers. There isn't anything special about it.
My initial guess it that the code added RoomSign_L twice because both root image folder and skin folder have "RoomSign_L.png" inside. The one from the root folder is a leftover copy from old export.
In 4.0.44-beta data import will give an error if JSON data has multiple attachments under the same slot with the same name.
I'd like to fix the Photoshop script so it gives an error for such a setup, but I can't see how you generated this JSON:
"3F": {
"RoomSign_L": {
"RoomSign_L": { "name": "3F/RoomSign_L", "x": 954.5, "y": -903.5, "width": 201, "height": 259 }
},
The line that writes name
for a skin attachment is here:
https://github.com/EsotericSoftware/spine-scripts/blob/master/photoshop/PhotoshopToSpine.jsx#L335
if (attachmentName != placeholderName) json += '"name": ' + quote(attachmentName) + ', ';
Buuut attachmentName
and placeholderName
are always the same value. They are set to the same value and not set elsewhere:
https://github.com/EsotericSoftware/spine-scripts/blob/master/photoshop/PhotoshopToSpine.jsx#L284
var placeholderName = layer.attachmentName, attachmentName = placeholderName, attachmentPath = layer.attachmentPath;
Are you using the latest script? Maybe you modified the script?
I was using 5.1. I did a quick compare between version 5.1 and newest 5.4. The old version does seem could produce different names for attachment and placeholder. Maybe this is what you are looking for?
Note that I don't know what exactly the code is doing but I saw it could assign a different name to attachmentName if skin is not the default one.
Anyway, if using the latest script could prevent the same issue happen, then problem solved.
Thank you.
hmmm... I was looking at that mentioned change and wondering.
Is the recent changes no longer set full path for attachment with skin / folder and enforcing unique name for ALL attachment files?
If this is the case, it could break a lots of things.
For example. I have character with different folders (happy, sad) storing same name attachments (eyes, mouth) and also basic part (arm, leg,etc) for different job skins. If attachment names are no longer identified unique with file path, some other users and I who make use of skin and folder could be in great trouble. I hope my observation is wrong.
Nick написалI was using 5.1. I did a quick compare between version 5.1 and newest 5.4. The old version does seem could produce different names for attachment and placeholder.
You can use look at the commit history on github. I'll start putting the version number in the commit message to make browsing it a bit nicer. Here is the diff for the commit going 5.1->5.2. The commit message has a link to a thread discussing why the change was made:
Treat skin tags like folder tags, rather than having the skin always at the root.
[PhotoshopToSpine] weird nesting of [folder] tag
The changes make the [skin] tag work like the [folder] tag when attachment names are built. This allows you to have eg:
something [folder]
purple [skin]
hat
The resulting attachment path is something/purple/hat
. Previously folder tags did not affect the path and it would be purple/hat
.
As a side effect, the changes in 5.1->5.2 mean the name for skin attachments always uses the path, eg skin/attachment
. In 5.1 it would use the name attachment
and set the path to skin/attachment
. I think the 5.2+ behavior is better because you can tell at a glance which image is used, eg purple/hat
instead of just hat
. Also, the "Hide skin names" setting in the tree gives the best of both worlds, if you don't care to see the path it would give you …hat
instead of purple/hat
.
Note that skin attachment names have no restrictions for uniqueness because they are under a skin placeholder, not directly under a slot. Only attachments not in a skin and skin placeholders need to have unique names for the slot they are under.
I don't believe there is a problem with the latest script for your project, though you may want to give it a try to be sure the output works for you.