3 Replies Latest reply: Mar 23, 2012 5:54 AM by INeedSol RSS

    [Ai-CS5] How to apply "Adobe Deform" effect on selected object?


      Hi All,


      I have an image on document and I want to wrap it horizontally. But I don't know which suites are required to perform this operation and how.

      I went through APIs and searched in this forum and got to know that  I'll have to apply "Adobe Deform " effect.


      plz suggest!



        • 1. Re: [Ai-CS5] How to apply "Adobe Deform" effect on selected object?
          A. Patterson Community Member

          I can't find Adobe Deform. Is this a Live Effect? Give me the exact menu path to it and I can give you details (e.g. File > Open)

          • 2. Re: [Ai-CS5] How to apply "Adobe Deform" effect on selected object?
            INeedSol Community Member

            Actly  I saw it in this thread http://forums.adobe.com/message/4158636#4158636


            Also when I get the all effects name and write them into a file. I got the "Adobe Deform" and 86 more. Here is the code snippet...




            ASInt32 cnt = -1;




            ofstream myfile;

            myfile.open ("C:\\Effects_Name.txt");

            for( ; cnt >= 0;  --cnt)


                 const char *p = NULL;

                  AILiveEffectHandle le = NULL;

                  sAILiveEffect->GetNthLiveEffect(cnt,  &le);

                  sAILiveEffect->GetLiveEffectName(le, &p);

                  myfile << p<<"\n";







            All I want to know is how to warp a selected  image horizontally on a document programmatically.


            Also I tried to use Action manager suite to warp the object but code has no effect. Here is the code snippet.



            AIErr error;

                                                    AIActionParamValueRef actionParam;


                                                    //create a new action param value.

                                                    error = sAIActionManager->AINewActionParamValue(&actionParam);

                                                    error = sAIActionManager->AIActionSetInteger(actionParam,kAIEnvelopeWarpStyle, kWarpStyleArc);

                                                    error = sAIActionManager->AIActionSetInteger(actionParam,kAIEnvelopeBend, 2);

                                                    error = sAIActionManager->AIActionSetInteger(actionParam,kAIEnvelopeHorizDistort, 20);

                                                    error = sAIActionManager->AIActionSetInteger(actionParam,  kAIEnvelopeVertDistort , 0);

                                                    error = sAIActionManager->AIActionSetInteger(actionParam,kAIEnvelopeRotate90, 0);

                                                    error = sAIActionManager->PlayActionEvent(kAIEnvelopeMakeAction , kDialogOn, actionParam);




            Please guide me.

            • 3. Re: [Ai-CS5] How to apply "Adobe Deform" effect on selected object?
              INeedSol Community Member

              Finally, I have done this like...




              AILayerHandle lh = NULL;



              AIArtSet set =NULL;



              sAIArtSet->LayerArtSet(lh, set);


              AIArtHandle art = NULL;

              sAIArtSet->IndexArtSet(set, 1, &art);


              AIEnvelopeOptions op;

              op.envOptions = kDeformAll;

              op.fidelity = 100;


              sAIEnv->MakeEnvelope(&art, 0,0, &op, &art);

              sAIEnv->WarpEnvelope(art, kWarpStyleArc, .1, 0, 0, false ); // .1 bending  for 10%




              But one thing I want to know is that how illustrator calculates the radius of upper arc. I see that after setting the bending option  to 100% in kWarpStyleArc style:

              radius of upper arc  =  (length/2 + height) of input object.


              And radius of lower arc in any case :

              radius of lower arc  = radius of upper arc -  height.


              Can anyone suggest me how its calculating the radius of upper arc for a given bending % value?