- Düzenlendi
포토샵 스크립트 수정 요청합니다.
기존 Photoshop-LayersToPNG 를 사용했었는데 포토샵을 CC 2018에서 2022 버전으로 올리면서 사용할수 없게 되어
새 버전인 PhotoshopToSpine를 사용했습니다.
이미지를 json으로 추출했는데 첨부 이미지에서 처럼 좌표가 다르게 나옵니다.
ruler를 사용해서 캔버스 왼쪽 하단으로 0.0 좌표를 변경해서 추출해도 정확히 맞지가 않았습니다.
이제는 포토샵 2022버전을 사용해야돼서 PhotoshopToSpine를 Photoshop-LayersToPNG를 사용했을 때 처럼 이미지의 좌표를 같게 수정 요청합니다.
스파인 파일과 스크립트도 같이 첨부 합니다.
폐를 끼쳐서 죄송합니다. 유감스럽게도, 저는 당신이 설명한 문제를 재현할 수 없었습니다. 첨부해 주신 zip의 스크립트로도 정확한 좌표로 내보낼 수 있었지만 PhotoshopToSpine v4.9는 꽤 오래된 버전이기 때문에 최신 스크립트(v7.17)를 사용해 주시면 감사하겠습니다.
https://github.com/EsotericSoftware/spine-scripts
최신 스크립트에서 동일한 문제가 발생한다면 알려주시기 바랍니다.
Sorry for the trouble. Unfortunately, I could not reproduce the problem you described. I was able to export with the correct coordinates even with the script in the zip you attached, but PhotoshopToSpine v4.9 is quite an old version, so I would appreciate it if you could try the latest script (v7.17):
https://github.com/EsotericSoftware/spine-scripts
Please let us know if the same problem occurs with the latest script.
최신 스크립트(v7.17)으로 해도 동일한 문제가 발생합니다.
Thank you for confirming with the latest script. I have recorded a video of the exporting flow on my end, so could you please check to see if there is anything different from your operation?
Sorry if it is hard to understand since the UI is partly in Japanese. I am using Photoshop 2022 and Spine 3.8.99 in the video.
추출 작업 방식은 동일합니다.
ruler를 사용했을 때 좌표값은 아래와 같이 나옵니다.
PhotoshopToSpine -> "Layer 2": { "x": 1000, "y": 1160, "width": 224, "height": 242 }
Photoshop-LayersToPNG -> "Layer 2": { "x": 1005, "y": 1165, "width": 232, "height": 250 }
결과 값을 보면 ruler를 사용했을 때 5픽셀의 오차가 있습니다.
ruler를 사용했을 때와 안했을 때 모두 2번(Photoshop-LayersToPNG )과 같은 결과값이 나오도록 부탁드립니다.
저도 Photoshop 2022와 Spine 3.8.99를 사용하고 있습니다.
자세한 답변 감사합니다! 이제 새로운 스크립트와 이전 스크립트 사이에서 5px 오프셋이 발생한다는 것을 알게 되었습니다. 저는 이 문제에 대해 알아보겠습니다만, 기본적으로 PhotoshopToSpine의 현재 버전이 가장 최신이고 올바른 버전이며, 반대로 PhotoshopToSpine의 향후 버전이 결과에서 5px를 뺀 값을 내보내게 된다면 현재 사용하고 있는 사용자에게 문제없이 부정적인 영향을 미칠 것입니다. 따라서 이에 가장 적합한 솔루션이 무엇인지 잠시 생각해 볼 시간을 주시면 감사하겠습니다.
Thank you for the detailed reply! Now I understand that the problem is that a 5px offset occurs between the new and old scripts. I'll investigate this issue, but basically I think that the current version of PhotoshopToSpine is the latest and correct version, and conversely, if the future version of PhotoshopToSpine were to export results minus 5px, it would have a negative impact on users who are currently using it without problems. Therefore, we would appreciate a little time to think about what solutions would be best for this.
제 생각도 이번 수정 요청드린 부분은 정식버전으로 올리는건 아닌거 같습니다.
저희 프로젝트에만 해당되는 문제인거 같아서 저희만 사용할 수 있도록 수정해주시면 감사하겠습니다.
PhotoshopToSpine 스크립트에서 생성된 값을 5픽셀만큼 오프셋하는 원하는 효과를 얻으려면 다음 단계를 수행하십시오.
1.) 아직 다운로드하지 않았다면 여기 Github 페이지에서 PhotoshoptoSpine 스크립트의 최신 버전을 다운로드하십시오.
https://github.com/EsotericSoftware/spine-scripts/tree/master/photoshop
2.) 텍스트 또는 코드 편집기에서 PhotoshopToSpine.jsx 스크립트를 엽니다. 저는 Visual Studio Code를 사용했지만 Notepad, Notepad++, Sublime Text 등을 사용할 수 있습니다.
3.) 다음 코드가 포함된 51행을 찾습니다.
var xOffSet = RulerOrigin("H"), yOffSet = RulerOrigin("V");
4.) 51행을 다음과 같이 수정합니다.
var xOffSet = (rulerOrigin("H") - 5), yOffSet = (rulerOrigin("V") - 5);
5.) PhotoshopToSpine.jsx 스크립트를 저장하고 닫습니다.
6.) Photoshop의 파일 > 스크립트 메뉴에서 수정된 PhotoshopToSpine.jsx를 실행하고 출력되는 JSON을 다시 확인합니다.
이제 JSON이 예상한 출력과 일치해야 합니다.
To achieve your intended effect of offsetting the values produced by the PhotoshopToSpine script by 5 pixels, please perform the following steps:
1.) If you have not done so, download the latest version of our PhotoshoptoSpine script from our Github page here:
https://github.com/EsotericSoftware/spine-scripts/tree/master/photoshop
2.) Open the PhotoshopToSpine.jsx script in a text or code editor. I used Visual Studio Code, but you can use Notepad, Notepad++, Sublime Text, etc.
3.) Look for line 51, that contains the following code:
var xOffSet = rulerOrigin("H"), yOffSet = rulerOrigin("V");
4.) Modify line 51 to read like the following:
var xOffSet = (rulerOrigin("H") - 5), yOffSet = (rulerOrigin("V") - 5);
5.) Save and close the PhotoshopToSpine.jsx script.
6.) Run your modified PhotoshopToSpine.jsx from Photoshop's File > Scripts menu, and double-check the JSON that is output.
The JSON should now be consistent with the output you were expecting.
감사합니다.
ruler를 사용했을 떼 기존 스크립트를 사용했을 때와 같은 위치에 출력됩니다.
yoffset은 -5가 아니라+5를 해야되네요.
안녕하세요,
yOffSet이 -5 대신 +5가 되어야 하는 경우 51행에서 yOffSet에 대한 변수를 다음과 같이 수정할 수 있습니다.
yOffSet = (rulerOrigin("V") + 5);
Hello,
Should you need the yOffSet to be +5 instead of -5, you can modify the variable for yOffSet in line 51 to read like the following:
yOffSet = (rulerOrigin("V") + 5);