2 Replies Latest reply on Jul 9, 2012 4:40 PM by MOMIR ZECEVIC

    Problem Getting Gradient Overlay Parameters Making GetObject from known PutObject


      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)







                             //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:




      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






                           //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




      To GetObject line.

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



      Momir Zecevic


        • 1. Re: Problem Getting Gradient Overlay Parameters Making GetObject from known PutObject
          MOMIR ZECEVIC Level 1

          I have tried listener (adding gradient overlay to layer) also, but listener gives me the same results as getter. same descriptor hierarchy and same put object line as getter




          Trouble is that 'GrFl' is not accepted when I transform PutObject to  GetObject.


          Or put it another way what is the key 'GrFl'

          What is the class 'GrFl'


          Can you Please give me any idea what to try here?


          Any idea what to do, no matter how crazy it looks may help. I am at the point when thinking about trying



          error = sPSActionControl->StringIDToTypeID(EVERY_KEY, &runtimeKeyID);

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


          in a loop and see what it will give me as set of possible keys.


          Again please help.




          • 2. Re: Problem Getting Gradient Overlay Parameters Making GetObject from known PutObject
            MOMIR ZECEVIC Level 1

            Of course getter war right.

            I was just making error somewhere but here it how it works:



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

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

            error = sPSActionDescriptor->GetObject(descEFFECTS, runtimeKeyID, &runtimeClassID, & descGRADIENT_OVERLAY);


            Et voila, works.


            Feel so stupid.