6 Replies Latest reply on Aug 3, 2018 12:15 PM by Lanigraphy

    JS - loading a color Lookup adjustment layer

    y0ta Level 1

      Photoshop CC2015

       

      Hi,

       

      Iḿ looking to create a script to load as an adjustment layer a color lookup with a loaded file...  I manage to have a the adjustment layer created by scriptListener... but it does not record the loading process.. I was expecting to change the path to my own variable....

      I tried to find some infos inside of the Javascript Ref, no success.... even in the layerKind... the color Lookup does not seems to be here.

       

      Anybody knows how I can do this or where I should focus?

      Thx a lot.

       

      Romain

        • 1. Re: JS - loading a color Lookup adjustment layer
          JJMack Most Valuable Participant

          If you add adjustment layers how it get added may be effected by how the user has the adjustment Panels fly-out options set Add Layer mask and clip to layer.  If set from Adobe default settings to add layer mask and not clip,  These option can cause incorrect operation. Script and Actions.  How the action and scripts that add adjustment layers works may change.  Do not change these option settings. 

          • 2. Re: JS - loading a color Lookup adjustment layer
            y0ta Level 1

            Hi JJMack,

            Thx for taking time to answer.. I appreciate. The thing I'm not sure to understand it. Probably I was not clear myself in my question. I would like to create an adjustment layer "color lookup" and load inside a .cube file, all done in Javascript.

            I don't see how layer mask or clip to layer are coming in... unless, which is really possible, I'm missing something in your answer. Would you mind to explain it ?

             

            Thx a lot

            Romain

            • 3. Re: JS - loading a color Lookup adjustment layer
              y0ta Level 1

              Any suggestions about how I can load a 3DLut inside the colorLookup adjustment layer ? Will be really appreciate.

               

              Cheers

              R.

              • 4. Re: JS - loading a color Lookup adjustment layer
                jp_spp

                I'm trying to do the same thing with PS CS6.

                 

                I'm using this to create the adjustment layer, which works (IDs is an Object we have setup with predefined type IDs):

                 

                function NewColorLookupLayer() 
                {
                      var desc0 = new ActionDescriptor();
                      var ref0 = new ActionReference();
                      ref0.putClass( IDs.AdjL );
                      desc0.putReference( IDs.null, ref0 );
                      var desc1 = new ActionDescriptor();
                      desc1.putClass( IDs.Type, IDs.colorLookup );
                      desc0.putObject( IDs.Usng, IDs.AdjL, desc1 );
                      executeAction( IDs.Make, desc0, DialogModes.NO );
                }

                 

                However, when I set the LUT, it appears to be pre-processing it into a binary blob and storing it as a "profile". Here's a cleaned-up version with ??? for the binary blob. (strCubeData is just the contents of the .cube file.)

                 

                function SetColorLut(strCubePath, strCubeData) 
                {
                      var desc0 = new ActionDescriptor();
                      var ref0 = new ActionReference();
                      ref0.putEnumerated(IDs.AdjL, IDs.Ordn, IDs.Trgt);
                      desc0.putReference(IDs.null, ref0);
                      var desc1 = new ActionDescriptor();
                      desc1.putEnumerated(IDs.lookupType, IDs.colorLookupType, IDs.threeDLUT);
                      desc1.putString(IDs.Name, strCubePath);

                      desc1.putData(IDs.profile, String.fromCharCode(???)); // Binary blob with encoded LUT data

                      desc1.putEnumerated(IDs.LUTFormat, IDs.LUTFormatType, IDs.LUTFormatCUBE);
                      desc1.putData(IDs.LUTthreeDFileData, strCubeData);
                      desc1.putString(IDs.LUTthreeDFileName, strCubePath);
                      desc0.putObject(IDs.T, IDs.colorLookup, desc1);
                      executeAction(IDs.Set, desc0, DialogModes.NO);
                }

                 

                Parts of the binary blob are fairly easy to decode, but I'm unsure about the meaning of several parts of the data. Would it be possible to get the format for this data?

                • 5. Re: JS - loading a color Lookup adjustment layer
                  pi3s2isz

                  Does anybody have any more information about the binary blob data being loaded to the profile?

                  • 6. Re: JS - loading a color Lookup adjustment layer
                    Lanigraphy

                    Did you ever manage to solve this? I am stuck at pretty much the same point at the moment. Any help would be highly appreciated