• Editor
  • how to Export psd layers of every pose by script

I can export psd with each slot as a layer("outputType": "layers") if "exportType": "current"
I can't export psd with each slot as a layer("outputType": "layers") if "exportType": "animation"

I hope there is a "time" in the export.json, so i can use python to iterate every frame of an animation and output its layers.

    Related Discussions
    ...

    Based on the provided contexts, there isn't a direct solution or feature within Spine or its Photoshop scripts that supports exporting PSD layers for every pose of an animation directly through a script with the specific requirements you've mentioned (such as iterating every frame of an animation and outputting its layers with "outputType": "layers" and "exportType": "animation"). The Spine User Guide and forum discussions mainly cover exporting animations as image sequences, PSD exports for current poses, or using Photoshop scripts for preparing assets for Spine, but they do not detail a method for exporting PSD layers for every pose within an animation through scripting.

    However, a workaround could involve manually adjusting the animation to the desired frame in Spine and exporting the current pose as a PSD with layers, repeating this process for each frame you wish to export. This method is obviously more manual and time-consuming and doesn't utilize a script to automate the process across all frames of an animation.

    yukiyuna Basically, what you can do with the CLI is the same as what you can do with the Spine editor, and unfortunately, it is not possible with the editor either. I guess the export method you're hoping for is pretty unusual, so if you don't mind me asking, could you tell me what it's needed for?

    Is there any chance Spine become friendly to programmer like blender?

    What exactly do you mean by that? If you are looking like a plugin system, please refer to a section in the Spine FAQ that answers our thoughts on plugin system:
    https://esotericsoftware.com/support#Does-Spine-have-a-plugin-system%3F

      Misaki

      I'm trying to use stable diffusion to generate different clothes for a spine character. (The final goal is a fully automated pipeline)

      1. export psd & png of the restpose
      2. the png will be the inpainting input. with some tricks (using controlnet) stable diffusion can generate some new images that similar to the orinal one.
      3. process the psd I can get information about the "mask" of each slot, use this "mask" to extract the corresponding part in the generated new image

      what i acheived:

      I run a python script to do this and can get 100 new clothes in a night.
      But as you could imagine, there is a major problem: how to redraw the attachments that are overlayed by other attachment, so that when it animate and no longer overlayed by others, it remains ok.

      It can be very useful to export the current pose in the middle of an animation as layers in a PSD so you can more easily redraw attachment images for that pose.

      this is why i need to export it "outputType": "layers" and "exportType": "animation"
      I can ask stable diffusion to redraw attachment for every possible pose

        yukiyuna I see, that is an interesting use. Thank you for explaining it!
        At this time, there are probably not many users doing such processing, but I felt that the demand for it might increase in the future, so I created an issue ticket here: EsotericSoftware/spine-editor784
        You can subscribe to this issue ticket to receive notifications when there is any progress on this issue.

        yukiyuna The option has been changed for this issue in 4.2.48-beta:

        If you select File per frame in Output type, you will now have the option to export as Frame or Layers next to it, so you can get what you want by selecting Layers there.