texture packer


texture packer Image


texture packer files Unity Import


Ex. Spine file successfully imported

=====================================
I am newbie to Spine.
I am developing a Unity mobile game.
I asked a forum how to optimize draw calls and batches, and as an answer at the time,
I got an answer to use texture packer.

Therefore, using the texture packer, the monsters appearing in the game
I've integrated it into one image and atlas, but I'm not sure how to do it even if I check the guide for this next sequence. SkeletonData in Unity
How can I get the json file needed to generate it?
Also, do I need to do anything further after that?

I'm sorry I didn't understand even though I checked the guide ; |


저는 스파인 초보자입니다.
유니티 모바일게임을 개발중인데
드로우콜, batches 최적화를 위해 포럼에 질문했었고 당시 답변으로
텍스처패커를 사용하라는 답변을 받았습니다.

이에 텍스처패커를 사용해서 게임에서 등장하는 몬스터들을
하나의 이미지와 아틀라스로 통합했는데, 이후 방법을 가이드를 확인해도 방법을 잘 모르겠습니다 .유니티에서 SkeletonData 를
생성하기 위해 필요한 json파일은 어떻게 얻을 수 있습니까?
또한 이후 추가적인 작업이 무언가 필요하나요?

가이드를 확인해도 내가 이해하지못해서 미안해

    Related Discussions
    ...

    ant5033 드로우콜, batches 최적화를 위해 포럼에 질문했었고 당시 답변으로
    텍스처패커를 사용하라는 답변을 받았습니다.

    일반적으로 각각의 권장 사항을 받은 포럼 게시물을 항상 링크하십시오. 그렇지 않으면 컨텍스트를 알기 위해 모든 게시물을 검색해야 합니다. 이 게시물을 의미한다고 가정합니다.
    https://esotericsoftware.com/forum/d/24068-optimizing-the-spine-spriteatlas/12

    귀하의 스크린샷에서 나는 귀하가 별도로 내보낸 Atlas 자산을 사용하는 방법을 모른다고 가정합니다. 여기서 스켈레톤은 함께 내보내지지 않습니다(따라서 같은 디렉토리에 내보낸 .json 또는 .skel.bytes 파일이 없습니다) ). Unity 프로젝트의 별도 디렉토리에 스켈레톤 및 아틀라스 파일을 배치할 때 여전히 atlas.txt 파일에 대해 Unity는 _Atlas 자산(AtlasAsset)을 자동으로 생성하고 skeleton.json(또는 skeleton.skel.bytes) 파일은 _SkeletonData 자산(SkeletonDataAsset)을 생성합니다. 이제 Atlas - Atlas Assets 섹션의 SkeletonDataAssetAtlasAsset을 할당하기만 하면 됩니다.

    ==============================================================================

    I asked a forum how to optimize draw calls and batches, and as an answer at the time,
    I got an answer to use texture packer.

    In general please always link the forum posting where you received the respective recommendation, otherwise searching through all your postings is required to know the context. I assume that you mean this posting here:
    https://esotericsoftware.com/forum/d/24068-optimizing-the-spine-spriteatlas/12

    From your screenshots I assume that you just don't know how to use the separately exported Atlas assets, where no skeleton is exported along with it (thus no .json or .skel.bytes file was exported in the same directory). When placing the skeleton and atlas files in separate directories in your Unity project, still for the atlas.txt file Unity will automatically generate an _Atlas asset (the AtlasAsset), and for your skeleton.json (or skeleton.skel.bytes) file it will generate a _SkeletonData asset (the SkeletonDataAsset). Now you just have to assign the AtlasAsset at your SkeletonDataAsset in the Atlas - Atlas Assets section:

    [See images above]

    • ant5033 님이 이 게시물을 좋아합니다..

    ant5033 스파인 메뉴를 통해 스파인의 텍스처 패커를 실행하여 텍스처 아틀라스를 패킹했죠?
    JSON 또는 바이너리 형식으로 스켈레톤 데이터 파일을 내보내려면 Spine 메뉴에서 내보내기를 선택한 후 원하는 형식으로 스켈레톤을 내보냅니다. 첨부한 스크린샷에 확장자가 .skel인 스켈레톤 데이터 파일이 표시되어 있으므로 스켈레톤을 바이너리 형식으로 내보내고 싶을 것입니다. 바이너리 형식으로 내보내려면 내보내기 창의 왼쪽 메뉴에서 바이너리를 선택하고 확장자 필드를 .skel.bytes로 설정한 후 내보내기를 실행합니다.

    그런 다음 익스포트한 .skel.bytes 파일, .atlas.txt 파일, 패킹된 .png 파일을 Unity 프로젝트로 임포트합니다. 이 작업은 동시에 드래그 앤 드롭하면 됩니다. 문제가 발생하면 알려주세요.


    Let me make sure, you packed the texture atlas by running Spine's Texture Packer via the Spine menu, right? To export a skeleton data file in JSON or binary format, select Export from the Spine menu and export your skeleton in your desired format. Since the screenshot you attached shows a skeleton data file with a .skel extension, you probably want to export your skeleton in binary format. To export in binary format, select Binary from the menu on the left side of the Export window, set the Extension field to `.skel.bytes' and run the export.

    Then, import the exported .skel.bytes file, .atlas.txt file, and the packed .png file into your Unity project. This can be done by dragging and dropping them at the same time. Please let us know if you run into any trouble.

    • ant5033님이 이에 답장했습니다.
    • ant5033 님이 이 게시물을 좋아합니다..

      죄송합니다. 이전에 .json 또는 .skel.bytes 파일을 내보내는 방법에 대한 질문을 간과했습니다. @Misaki의 답변에 감사드립니다.

      @ant5033 Misaki는 단일 아틀라스(.atlas.txt 및 하나 이상의 .png 파일)를 여러 스켈레톤(a 각 스켈레톤에 대한 .json 또는 .skel.bytes 파일).

      이 공유 아틀라스의 경우 (a) 모두 동일한 디렉토리에 배치하거나 (b) 각각 별도의 디렉토리에 배치하고 이전 게시물에서 위에서 설명한 대로 나중에 'AtlasAsset'을 할당할 수 있습니다.

      (a)를 선택하고 _AtlasAsset과 동일한 디렉토리에 모든 스켈레톤을 배치하면 새 스켈레톤 .json(또는 .skel.bytes) 파일을 가져올 때 아틀라스가 자동으로 검색됩니다. 단점은 단일 디렉토리에 많은 파일이 있어 더 많은 스켈레톤을 추가할수록 혼란스러울 수 있다는 것입니다.



      Sorry, I overlooked the question on how to export the .json or .skel.bytes file earlier, thanks @Misaki for answering.

      @ant5033 please note that Misaki probably does not know the context information (of the other thread) that you want to be sharing a single atlas (.atlas.txt and one or multiple .png files) with multiple skeletons (a .json or .skel.bytes file for each skeleton).

      In this shared-atlas case you could (a) place them all in the same directory, or (b) you could place each in a separate directory and assign the AtlasAsset later as I described above in the previous posting.

      If you choose (a) and place all skeletons in the same directory as the _AtlasAsset, the atlas will be found automatically when importing the new skeleton .json (or .skel.bytes) file. The drawback is that you then have a lot of files in a single directory, which might get confusing the more skeletons you add.

      • ant5033님이 이에 답장했습니다.
      • Misakiant5033 님이 이 게시물을 좋아합니다..

        Misaki

        Failed... T.T

        I took a video and uploaded it to YouTube for accurate delivery.
        Can you figure out what the problem is after watching?
        Is the file name of the image files important?

        1.

        2.

        Harald

        failed T.T ...
        Please watch the video above
        Can you figure out the problem ?

        @ant5033 Sorry to hear that the problem persists! Unfortunately it's hard to tell from a video. Could you please share the exported combined atlas asset (which can be seen in your first video at time 1:23) with us? Please share both the .png file and the atlas.txt file. And could you please also share one of the skeleton asset exported as .json (instead of .skel.bytes) with us? You can either attach the assets to a forum posting here, or send us an email to contact@esotericsoftware.com, briefly mentioning this forum thread URL so that we know the context. Then we can have a look at why it does not import in Unity as desired.

        • ant5033님이 이에 답장했습니다.
        • ant5033 님이 이 게시물을 좋아합니다..
          7일 후

          Harald

          Hello, sorry for the late reply.
          I took a break due to the coronavirus.

          I compressed the file you mentioned and the monster spine files, but the capacity is
          I sent it by e-mail because it was not enough!

          Mail subject: Unity texture packer json ? (Attached file for troubleshooting)
          Sent ID: ant5033@naver.com

          @ant5033 Thanks for sending the reproduction assets. The problem is that the folder structure of the attachment images does not match.

          You exported the skeleton monster 01 having the monster 01/images directory set as Images directory in the Spine project. When you export the skeleton with Texture atlas: pack enabled, the badan attachment image will be exported just as the path badan. This is what the skeleton .skel.bytes file has stored and is looking up when searching an atlas file for its required attachment regions.

          With your combined atlas however, the directory structure is exporting using two directories above, leading to the following path being stored in the combined monsters.atlas.txt:
          monster 01/images/badan
          So when loading the skeleton, it searches for badan but does not find this in the atlas, monster 01/images/badan, monster 02/images/badan or monster 03/images/badan do not count as equal. And even if it did count them as a match, which of these should it use then?

          While there is an option Flatten paths for this problem, your image names are all the same and not unique, so this is not an option. The solution for your problem is to use the same directory structure when exporting the skeleton as when exporting the atlas. Likely it's easiest to rename the images dir in each of your Spine projects to a unique name, e.g. monster-01-images. So you would change the directory Monster03SpineProject/images to Monster03SpineProject/monster-03-images .

          Then you could use a simple copy batch script which copies your directories over to your atlas packaging directory, e.g. to a structure like this:

          combined-atlas      // pack this directory
          - monster-01-images
          -- badan, etc
          - monster-02-images
          -- badan, etc
          - monster-03-images
          -- badan, etc

          Then the resulting image paths should match up properly, like e.g. monster-03-images/badan. A side note: you can open the .atlas.txt files using a normal text editor to quickly check what image path names have been exported.

          • ant5033님이 이에 답장했습니다.
          • ant5033 님이 이 게시물을 좋아합니다..
            4일 후

            Harald

            As you said, I understand the cause!

            When using the texture packer, I understood that the problem was caused by the fact that the folder names of the image folder of Monster No. 1 and the image folder of Monster No. 2 had the same folder name, and the image files inside had the same file name as well.

            I also understood what the solution meant. Are you saying that the directory path including the monster name in the folder name should not be duplicated?

            However, I can't understand the copy batch script part... Sorry! ; )
            Does the copy batch script mean something like the link below?

            If you simply change the" images" folder name, the connection will be lost when you run Spine. Can you tell us more about your copy batch script!?

            • Harald님이 이에 답장했습니다.

              ant5033 However, I can't understand the copy batch script part... Sorry! ; )
              Does the copy batch script mean something like the link below?

              No need to apologize! Yes, this is what I meant. If you are using Windows, you could use batch scripting (a .bat file). When you have e.g. "git for Windows" or cygwin installed, you could write a shell (or bash) script with extension .sh instead which is basically compatible with Linux and MacOS. On Linux or MacOS you would always use a shell script.

              • ant5033 님이 이 게시물을 좋아합니다..

              ant5033 If you simply change the" images" folder name, the connection will be lost when you run Spine.

              You first change the image folder name in your filesystem from e.g. images to monster03-images, then in the Spine project you have to change the Images setting accordingly as well to point to the renamed directory.

              Can you tell us more about your copy batch script!?

              For example, we use the following shell script to copy previously exported skeleton assets from the export directory to the runtimes directories:
              https://github.com/EsotericSoftware/spine-runtimes/blob/4.1/examples/export/runtimes.sh
              Your copy batch or shell script could e.g. copy the image files from

              spineproject-monster-01/monster-01-images/*.png

              to

              combined-atlas/monster-01-images/

              To get this structure in the end:

              combined-atlas      // pack this directory
              - monster-01-images
              -- badan, etc
              - monster-02-images
              -- badan, etc
              - monster-03-images
              -- badan, etc
              • ant5033 님이 이 게시물을 좋아합니다..
              일 년 후