Skip to main content
Inspiring
March 5, 2024
Question

C++-API: How to detect a Freeform-Gradient in a Paint-Field of an Appearance?

  • March 5, 2024
  • 1 reply
  • 184 views

Hi
working with the C++-API, it seems to me that the Freeform-Gradient can not be detected.

When requesting the Color of a Paint Field, and it is a Gradient which is Linear or Radial, the Color is set to kGradient, and inside the ColorInformation there is the Handle to that Gradient.

However, when it is a Freeform Gradient, the Color is set kNoneColor, which makes it impossible to detect the Gradient.

Also, the enum for Gradients defined in AIColor.h is only

 

/** Types of gradients, or color blends. See \c #AIGradientStyle. */
enum {
	/** A linear gradient extends in a straight line for a given length at a
		given angle from an origin point. */
	kLinearGradient = 0,
	/** A radial gradient is circular, and extends for a given radius around a highlight point. */
	kRadialGradient
};

 

 

 

 

So my questions are:

  • How to detect a Freeform-Gradient from a Paint Field of an Appearance?
  • How to get detailed information about the Freeform, like the information about the other gradients?

    Thank you
    Thorsten
This topic has been closed for replies.

1 reply

kuo chunh36971252
Participating Frequently
October 25, 2024

I think It's what you want.

AIAPI AIBoolean(* IsSmoothShadingStyle )(AIParserPaintField paintField)