Skip to main content
Inspiring
January 9, 2017
Answered

Reciving signal: "EXC_BAD_ACCESS" when attempting to transform TextFrameArt objects.

  • January 9, 2017
  • 1 reply
  • 537 views

GDB is reciving signal: "EXC_BAD_ACESS" when I try to transform a TextFrameArt using the TransformArtSuite. Here is an exampke code.

(Note I'still with CS5 SDK.)

AIErr

SetPointTextMatrix( AIArtHandle textArt, AIRealMatrix *matrix)

{

    AIErr error = kNoErr;

    int textType;

    VMGetTextType( textArt, &textType);

   

    if (textType == kPointTextType)

    {

        /* since we cannot set the matrix directly, we need to calculate a

         tranformation and transform the object:

        

         Let C be the <currentMatrix>

         Let R be the final <matrix>

         Let T be the <transformation> matrix

        

         Since,

        

            R = C * T

        

         then we can calulate

        

            T = inv(C) * R

         */

       

       

        AIRealMatrix currentMatrix, transformation;

        GetPointTextMatrix( textArt, &currentMatrix);

        sMath->AIRealMatrixInvert( &currentMatrix);

        sMath->AIRealMatrixConcat( &currentMatrix, matrix, &transformation);

        /* THIS IS WHERE IT ALL GOES WRONG: - the content of the <transformation> matrix is OK */

        error = sTransformArt->TransformArt( textArt, &transformation, 1.0, kTransformObjects));

    }

    return error;

}

Anyone know why?

This topic has been closed for replies.
Correct answer LeoTaro

My guess would be that there was a problem obtaining the Transform Art Suite so sTransformArt is not valid.

1 reply

LeoTaroCorrect answer
Inspiring
January 10, 2017

My guess would be that there was a problem obtaining the Transform Art Suite so sTransformArt is not valid.

arenolAuthor
Inspiring
January 10, 2017

I looked into it, and thought it was OK, But eventually I found the cultprit: a missing "&".

...

kAIRealMathSuite, kAIRealMathVersion, &sMath,
kAIHardSoftSuite, kAIHardSoftSuiteVersion, &sHardSoft,
kAITransformArtSuite, kAITransformArtSuiteVersion, sTransformArt,   <- missing "&".
kAIArtStyleSuite, kAIArtStyleSuiteVersion, &sArtStyle,
kAIBlendStyleSuite, kAIBlendStyleSuiteVersion,  &sBlendStyle,

...

Agnar