• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Pattern fill

Enthusiast ,
Apr 01, 2008 Apr 01, 2008

Copy link to clipboard

Copied

Hello,

i am trying to make an export plug-in(convert ai file to my own model).

The ArtObject conversion is made whitout problem.
But if object has a pattern fill, this is not the same.

How can i access object' pattern fill in ordrer to convert it? i should use Art Style Suite, i suppose, but are there any available samples showing how to do?

Any help will be appreciated.
Thanks,
Thomas.
TOPICS
SDK

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Enthusiast ,
Apr 02, 2008 Apr 02, 2008

Copy link to clipboard

Copied

in other worlds, how could i explore an ArtStyle.
(how could i write a recursive tree walk to access all elements composing the ArtStyle.)

Thanks,
Thomas.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 04, 2008 Apr 04, 2008

Copy link to clipboard

Copied

AIArtStyleHandle thisArtStyle;
AIPathStyle aiPathStyle;
AIArtStylePaintData paintData;

error = sAIArtStyle->GetPaintAttributes( thisArtStyle, &aiPathStyle, &paintData );

The pattern is in the AIPatternStyle struct of the AIColorUnion struct of the AIColor struct of the AIFillStyle struct of the AIPathStyle struct which for the example above would be in aiPathStyle.fill.color.c.p. So for example aiPathStyle.fill.color.c.p.scale would be a AIReal number representing the scale of the pattern. For your convenience, I have included all of the structs below:

typedef struct AIPathStyle {
/** Whether or not to fill the path. */
AIBoolean fillPaint;
/** Whether or not to stroke the path */
AIBoolean strokePaint;
/** Fill style, if fillPaint is true */
struct AIFillStyle fill;
/** Stroke style, if strokePaint is true */
struct AIStrokeStyle stroke;
/** Whether or not to use this as a clipping path */
AIBoolean clip;
/** Whether or not to lock the clipping path */
AIBoolean lockClip;
/** When true, use the even-odd rule to determine path insideness */
AIBoolean evenodd;
/** Path's resolution */
AIReal resolution;
} AIPathStyle;

typedef struct AIFillStyle {
/** Fill color */
AIColor color;
/** When true, print any art beneath this, then print the fill of this object over it.
When false, knock out art beneath this art at print time */
AIBoolean overprint;
} AIFillStyle;

typedef struct {
/** The type of color being described. */
AIColorTag kind;
/** Contains the detailed specification of the color as appropriate for
the \c kind. */
AIColorUnion c;
} AIColor;

/** The union of all possible types of color specification. */
typedef union {
/** A grayscale color */
AIGrayColorStyle g;
/** A CMYK color */
AIFourColorStyle f;
/** An RGB color */
AIThreeColorStyle rgb;
/** A custom color */
AICustomColorStyle c;
/** A pattern */
AIPatternStyle p;
/** A gradient (blend) */
AIGradientStyle b;
} AIColorUnion;

typedef struct {
/** An opaque reference to the pattern object, accessed through the
\c #AIPatternSuite, whose functions get and set a patternís name
and defining art object or objects.
*/
AIPatternHandle pattern;
/** Distance to translate the unscaled prototype before filling,
measured from the ruler origin.*/
AIReal shiftDist;
/** Angle to translate the unscaled prototype before filling,
in degrees. */
AIReal shiftAngle;
/** Fraction to scale the prototype before filling. */
AIRealPoint scale;
/** Angle to rotate the prototype before filling. */
AIReal rotate;
/** When true, the prototype is reflected before filling */
AIBoolean reflect;
/** Axis around which to reflect. */
AIReal reflectAngle;
/** Angle to slant the shear by. */
AIReal shearAngle;
/** Axis to shear with respect to. */
AIReal shearAxis;
/** Additional transformation arising from manipulating the path. */
AIRealMatrix transform;
} AIPatternStyle;

-jeshua

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 10, 2008 Apr 10, 2008

Copy link to clipboard

Copied

thanks!
with this structs, i succeded in making a recursive tree walk through
art and retrieving all datas.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 16, 2008 Jun 16, 2008

Copy link to clipboard

Copied

After playing with Pattern suite, I've encountered a sproblem with AIPatternStyle. Applying transformations on a Pattern (such as translation or rotation), do not change shiftDist, shiftAngle or shearAngle. Only transform matrix is modified. Why could I do, or what must I do to retrieve this properties ?

thank,
Thomas

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jun 16, 2008 Jun 16, 2008

Copy link to clipboard

Copied

You've probably tried this, but the AITransformArt suite has some options for applying transforms to objects, including things like 'kTransformStrokePatterns' and 'kTransformFillPatterns'. I assume these aren't helpful or you've already tried them?

I'll admit, working with the nitty-gritty of patterns isn't something I've got any experience in :(

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 17, 2008 Jun 17, 2008

Copy link to clipboard

Copied

LATEST
I have solved this problem. See other post, in which you gave me information about illustrator' coordinate spaces.

But it seems that whatever transformations are applied to Pattern, only the matrix (stored in the AIPatternStyle) is modified. Since this matrix, I succeeded in placing correctly rasterized PatternArt.

but I don't have the slightest idea about AIPatternStyle's others properties goals.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines