Skip navigation
Currently Being Moderated

Problem Getting Gradient Overlay Parameters Making GetObject from known PutObject

Jun 21, 2012 12:23 AM

Tags: #plug-in #layers #sdk #automation #photshop

Hi folks,

 

I am trying to get multicolor and multitranspatent settings for frame (stroke, outline) and gradient overlay, from layer descriptor.

 

So far I had no problem getting settings for stroke (color list, transparency list, color and transparency stop points, its locations RGB values and midpoints).

 

To my knowledge it should be similar for gradient overlay but I am stuck at one place.

 

Here is hierarchy that I have found from Getter (I have give the names to descriptors to ease me code reading)

//============================================================

        sPSActionDescriptor->Make(&descLAYER);

             sPSActionDescriptor->Make(&descEFFECTS);

                  sPSActionDescriptor->Make(&descGRADIENT_OVERLAY);

                       sPSActionDescriptor->Make(&descGRAD_FILL);

                   

                       //This one should contain lists for color stop

                  

//=============================================================

However I can not find a way to get descGRADIENT_OVERLAY from descEFFECTS.

 

Corresponding PutObject from getter looks like:

 

     error=sPSActionDescriptor->PutObject(descEFFECTS,'GrFl','GrFl',descGR ADIENT_OVERLAY);


 

the ‘GrFl’ i had found browsing headers stands for enumGradientFill:


#define enumGradientFill   'GrFl' // typeFrameFill FROM LIBRARY

 

Isuppose that I shoul use some kind of conversion. I have tried something like

 

     error = sPSActionControl->StringIDToTypeID('GrFl', &runtimeClassID);

 

but I am getting nowhere.  Am I missing something.When I worked with stroke effect  this was the situation:Descriptor hierarchy

//==============================================================

     sPSActionDescriptor->Make(&descLAYER);

          sPSActionDescriptor->Make(&descEFFECTS);

              sPSActionDescriptor->Make(&descSTROKE);

                   sPSActionDescriptor->Make(&descGRAD_FILL);


                     //This one has contain lists for color stops

//==================================================================== ==

Here descSTROKE had descriptor that I called descGRAD_FILL which contain multicolor and multitransparency informations. But there i had no problem pulling it out because its class is classFrameFX and key keyFrameFX so following code works.

 

     error = sPSActionDescriptor->HasKey(descEFFECTS, keyFrameFX, &hasKey);

     if (error) goto returnError;

 

     if (hasKey)

      {

            error = sPSActionControl->StringIDToTypeID("classFrameFX", &runtimeClassID);

            if (error) goto returnError;

            error = sPSActionDescriptor->GetObject(descEFFECTS, keyFrameFX, &runtimeClassID, & descSTROKE);

            if (error) goto returnError;

     }


Basically problem boils down to question HOW TO TRANSFORM PutObject line

 

     error=sPSActionDescriptor->PutObject(descEFFECTS,'GrFl','GrFl',descGR ADIENT_OVERLAY);


 

To GetObject line.

Thanks in advance for any help that you can give me.

 

Regards,

Momir Zecevic

 


 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points