C++-SDK: How to get the colors of a Pattern?
I'm currently writing a Plugin which should get the colors out of different Arts.
The basic function I'm using for this is from AIPathStyleSuite
sAIPathStyle->AdjustObjectAIColors(_art, this->ShowColorAdjustColorFunc, &data, visitFlags, &modified);
with the following call:
void searchForColors(AIArtHandle _art)
{
VisitAIColorFlags visitFlags = (kVisitColorsSolidOnly | kVisitGlobalObjectsOnceOnly | kVisitColorsSelectedOnly);
Colors data = Colors();
ASBoolean modified = false;
sAIPathStyle->AdjustObjectAIColors(_art, this->ShowColorAdjustColorFunc, &data, visitFlags, &modified);
}
The callback-function is the following:
/**Callback-function for ShowColor**/
void ShowColorAdjustColorFunc(AIColor* color, void* userData, AIErr* reportResult, ASBoolean* modifiedColor)
{
//Do something
}
This works perfectly with normal kPathArt, also for Art with Gradients and Pattern. If this art is filled wih a pattern, I get all the colors from the Pattern back when I call AdjustObjectAIColors() for this art
However, when I try to do the same for kTextFrameArt, where the Fill-Color of the Text is a Pattern, I get only the information that the color is a pattern.
From the color-structure I can get the Art-Handle of the pattern, by calling:
AIColor _Color;
....
AIPatternHandle handle = _Color.c.p.pattern;
AIArtHandle arthandle;
sAIPattern->GetPatternArt(handle, &arthandle);
This arthandle is a pointer to a group of arts, which I examine to get includes kPathArts. When I find such an art, I call my searchForColors()-Function with that art.
However, in this case, the callback-function ShowColorAdjustColorFunc() is never called from sAIPathStyle->AdjustObjectAIColors().
So my question is:
Why do I not get back colors in this case and how can I get (and manipulate) the colors of a pattern?
Thanks for any help
