3 Replies Latest reply: May 3, 2014 3:44 AM by SaniT RSS

    FileFormat-Plugin: Writing multi layer image

    SaniT Community Member

      Hi,

       

      I've another problem with a FileFormat-Plugin.

       

      I want to write multiple layers to a file.

      The plugin is correctly supporting format layers and is receiving the "writeLayerStart" event.

       

      There I can see the that PS is giving me the background layer and I'm writing it to the file.

      But after that I receive the "writeFinish" event.

       

      All other layers are ignored.

      Is there anything I should set in the FormatRecord so PS will give me the next layer?

       

      Thanks in advance,

      Christian

        • 1. Re: FileFormat-Plugin: Writing multi layer image
          Tom Ruark Adobe Employee

          Is the LayerFormat example working for you? I would diff that against your plugin. Are you possibly returning errors? Should go start, continue, finish for each layer and then a write finish for the entire document.

          • 2. Re: FileFormat-Plugin: Writing multi layer image
            SaniT Community Member

            thank you for answering...

             

            LayerFormat Example?!

            I have only 3dformat, simpleformat and textformat in the format folder of the sdk sample code.

             

            I have taken the simpleformat sample as a start.

            Added  FormatLayerSupport { doesSupportFormatLayers }, to the PiPL resource,

            added functions for the additional events (layerWriteStart, ...Continue, etc.) and put my write code into the

            writeLayerStart function.

            It is the code from the simpleformat writeStart function.

            So an error is not returned.

             


            • 3. Re: FileFormat-Plugin: Writing multi layer image
              SaniT Community Member

              Ok, I figured it out myself.

              Photoshop will stop writing, when the gFormatRecord->data is set to NULL.

              This is also true for writing layers.

              The simpleformat plugin must be changed to use the same pixel buffer all the time, not only in the writelayerstart.

               

              After this change the plugin got the "writeLayerStart, writeLayerContinue, writeLayerFinish" events for all layers as expected.