77 const float *corner_point,
78 const float *arrow_coords,
79 const int arrow_style)
83 switch (arrow_style) {
129 if ((points ==
NULL) || (totpoints <= 0)) {
148 if (totpoints == 1) {
157 float oldpressure = points[0].
pressure;
172 for (
int i = 0; i < totpoints; i++, pt++) {
235 const float pt[3],
short sflag,
int offsx,
int offsy,
int winx,
int winy,
float r_co[2])
242 const float x = (
float)((pt[0] * winx) + offsx);
243 const float y = (
float)((pt[1] * winy) + offsy);
249 const float x = (
float)(pt[0] / 100 * winx) + offsx;
250 const float y = (
float)(pt[1] / 100 * winy) + offsy;
285 float co[3] = {0.0f};
307 const bGPDspoint *points,
int totpoints,
short thickness,
const float ink[4],
bool cyclic)
309 float curpressure = points[0].
pressure;
335 for (
int i = 0; i < totpoints; i++, pt++) {
341 if (
fabsf(pt->
pressure - curpressure) > 0.2f / (
float)thickness) {
367 if (cyclic && i == 0) {
400 if (totpoints == 0) {
403 float thickness = (
float)thickness_s;
412 float oldpressure = points[0].
pressure;
413 if (totpoints == 1) {
436 for (
int i = 0; i < totpoints; i++) {
445 pt_prev = &points[i - 1];
459 pt_prev = &points[i - 1];
475 pt_prev = &points[0];
532 const float color[4])
555 if (gps->totpoints == 1) {
557 gps->points, lthick, gps->flag, offsx, offsy, winx, winy,
color);
572 if (gps->totpoints == 1) {
574 gps->points, lthick, gps->flag, offsx, offsy, winx, winy,
color);
578 gps->points, gps->totpoints, lthick, gps->flag, offsx, offsy, winx, winy,
color);
591 const float alpha = 1.0f;
597 if (gpl->
gstep > 0) {
602 for (gf = gpf->
prev; gf; gf = gf->
prev) {
607 color[3] = alpha * fac * 0.66f;
615 else if (gpl->
gstep == 0) {
618 color[3] = (alpha / 7);
634 for (gf = gpf->
next; gf; gf = gf->
next) {
639 color[3] = alpha * fac * 0.66f;
650 color[3] = (alpha / 4);
661 bGPdata *gpd,
int offsx,
int offsy,
int winx,
int winy,
int cfra,
int dflag)
668 short lthick = gpl->thickness;
672 ink[3] = gpl->opacity;
719 bGPdata *gpd,
int offsx,
int offsy,
int winx,
int winy,
int cfra,
int dflag)
772 if (gpd_source ==
NULL || (gpd_source && gpd_source != gpd)) {
786 int offsx, offsy, sizex, sizey;
795 switch (
area->spacetype) {
804 sizex = region->
winx;
805 sizey = region->
winy;
818 sizex = region->
winx;
819 sizey = region->
winy;
830 sizex = region->
winx;
831 sizey = region->
winy;
889 int offsx, offsy, winx, winy;
937 Scene *
scene,
bGPdata *gpd,
int winx,
int winy,
const int cfra,
const char spacetype)
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
#define LISTBASE_FOREACH(type, var, list)
MINLINE int round_fl_to_int(float a)
MINLINE float max_ff(float a, float b)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define SET_FLAG_FROM_TEST(value, test, flag)
struct Depsgraph Depsgraph
@ GP_STROKE_ARROWSTYLE_NONE
@ GP_STROKE_ARROWSTYLE_SEGMENT
@ GP_STROKE_ARROWSTYLE_CLOSED
@ GP_STROKE_ARROWSTYLE_OPEN
@ GP_STROKE_ARROWSTYLE_SQUARE
@ GP_STROKE_USE_ARROW_END
@ GP_STROKE_USE_ARROW_START
Object is a sort of wrapper for general info.
#define V3D_HIDE_OVERLAYS
bScreen * ED_screen_animation_playing(const struct wmWindowManager *wm)
void ED_view3d_calc_camera_border(const struct Scene *scene, struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const struct RegionView3D *rv3d, struct rctf *r_viewborder, bool no_shift)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
void GPU_polygon_offset(float viewdist, float dist)
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
void GPU_program_point_size(bool enable)
void GPU_blend(eGPUBlend blend)
void GPU_line_smooth(bool enable)
void GPU_depth_mask(bool depth)
void GPU_point_size(float size)
bool GPU_depth_mask_get(void)
void GPU_depth_test(eGPUDepthTest test)
void GPU_viewport_size_get_f(float coords[4])
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
static void annotation_draw_strokes(const bGPDframe *gpf, int offsx, int offsy, int winx, int winy, int dflag, short lthick, const float color[4])
void ED_annotation_draw_ex(Scene *scene, bGPdata *gpd, int winx, int winy, const int cfra, const char spacetype)
static void annotation_draw_stroke_3d(const bGPDspoint *points, int totpoints, short thickness, const float ink[4], bool cyclic)
static void annotation_draw_data_layers(bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag)
static void annotation_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thickness_s, short sflag, int offsx, int offsy, int winx, int winy, const float ink[4])
void ED_annotation_draw_2dimage(const bContext *C)
static void annotation_draw_stroke_buffer(bGPdata *gps, short thickness, short dflag, const float ink[4])
static void annotation_draw_stroke_arrow_buffer(uint pos, const float *corner_point, const float *arrow_coords, const int arrow_style)
static void annotation_draw_onionskins(bGPDlayer *gpl, bGPDframe *gpf, int offsx, int offsy, int winx, int winy, int dflag)
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
static void annotation_calc_2d_stroke_fxy(const float pt[3], short sflag, int offsx, int offsy, int winx, int winy, float r_co[2])
static void annotation_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag, const eSpace_Type space_type)
static void annotation_draw_stroke_point(const bGPDspoint *points, short thickness, short sflag, int offsx, int offsy, int winx, int winy, const float ink[4])
void ED_annotation_draw_view3d(Scene *scene, struct Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
static void annotation_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag)
static bool annotation_can_draw_stroke(const bGPDstroke *gps, const int dflag)
const Depsgraph * depsgraph
int ED_gpencil_session_active(void)
bGPdata * ED_annotation_data_get_active(const bContext *C)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static void draw_points(ArmatureDrawContext *ctx, const EditBone *eBone, const bPoseChannel *pchan, const bArmature *arm, const int boneflag, const short constflag, const int select_id)
void wmOrtho2(float x1, float x2, float y1, float y2)