Blender  V3.3
Macros | Typedefs | Enumerations | Functions
drawgpencil.c File Reference
#include <float.h>
#include <math.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_sys_types.h"
#include "BLI_math.h"
#include "BLI_polyfill_2d.h"
#include "BLI_utildefines.h"
#include "BLF_api.h"
#include "BLT_translation.h"
#include "DNA_brush_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_userdef_types.h"
#include "DNA_view3d_types.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_gpencil.h"
#include "BKE_image.h"
#include "BKE_material.h"
#include "BKE_paint.h"
#include "DEG_depsgraph.h"
#include "WM_api.h"
#include "GPU_batch.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_shader_shared.h"
#include "GPU_state.h"
#include "GPU_uniform_buffer.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_view3d.h"
#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "IMB_imbuf_types.h"
#include "gpencil_intern.h"

Go to the source code of this file.

Macros

#define F2UB(x)   (uchar)(255.0f * x)
 

Typedefs

typedef enum eDrawStrokeFlags eDrawStrokeFlags
 

Enumerations

enum  eDrawStrokeFlags {
  GP_DRAWDATA_NOSTATUS = (1 << 0) , GP_DRAWDATA_ONLY3D = (1 << 1) , GP_DRAWDATA_ONLYV2D = (1 << 2) , GP_DRAWDATA_ONLYI2D = (1 << 3) ,
  GP_DRAWDATA_IEDITHACK = (1 << 4) , GP_DRAWDATA_NO_XRAY = (1 << 5) , GP_DRAWDATA_NO_ONIONS = (1 << 6) , GP_DRAWDATA_NOSTATUS = (1 << 0) ,
  GP_DRAWDATA_ONLY3D = (1 << 1) , GP_DRAWDATA_ONLYV2D = (1 << 2) , GP_DRAWDATA_ONLYI2D = (1 << 3) , GP_DRAWDATA_IEDITHACK = (1 << 4) ,
  GP_DRAWDATA_NO_XRAY = (1 << 5) , GP_DRAWDATA_NO_ONIONS = (1 << 6) , GP_DRAWDATA_VOLUMETRIC = (1 << 7) , GP_DRAWDATA_FILL = (1 << 8)
}
 

Functions

static void gpencil_set_point_varying_color (const bGPDspoint *pt, const float ink[4], uint attr_id, bool fix_strength)
 
static void gpencil_draw_stroke_volumetric_3d (const bGPDspoint *points, int totpoints, short thickness, const float ink[4])
 
static void gpencil_draw_stroke_3d (tGPDdraw *tgpw, short thickness, const float ink[4], bool cyclic)
 
static bool gpencil_can_draw_stroke (const bGPDstroke *gps, const int dflag)
 
static void gpencil_draw_strokes (tGPDdraw *tgpw)
 
void ED_gpencil_draw_fill (tGPDdraw *tgpw)
 

Macro Definition Documentation

◆ F2UB

#define F2UB (   x)    (uchar)(255.0f * x)

Definition at line 99 of file drawgpencil.c.

Typedef Documentation

◆ eDrawStrokeFlags

Enumeration Type Documentation

◆ eDrawStrokeFlags

Enumerator
GP_DRAWDATA_NOSTATUS 

don't draw status info

GP_DRAWDATA_ONLY3D 

only draw 3d-strokes

GP_DRAWDATA_ONLYV2D 

only draw 'canvas' strokes

GP_DRAWDATA_ONLYI2D 

only draw 'image' strokes

GP_DRAWDATA_IEDITHACK 

special hack for drawing strokes in Image Editor (weird coordinates)

GP_DRAWDATA_NO_XRAY 

don't draw xray in 3D view (which is default)

GP_DRAWDATA_NO_ONIONS 

no onionskins should be drawn (for animation playback)

GP_DRAWDATA_NOSTATUS 

don't draw status info

GP_DRAWDATA_ONLY3D 

only draw 3d-strokes

GP_DRAWDATA_ONLYV2D 

only draw 'canvas' strokes

GP_DRAWDATA_ONLYI2D 

only draw 'image' strokes

GP_DRAWDATA_IEDITHACK 

special hack for drawing strokes in Image Editor (weird coordinates)

GP_DRAWDATA_NO_XRAY 

Don't draw XRAY in 3D view (which is default).

GP_DRAWDATA_NO_ONIONS 

No onion-skins should be drawn (for animation playback).

GP_DRAWDATA_VOLUMETRIC 

draw strokes as "volumetric" circular billboards

GP_DRAWDATA_FILL 

fill insides/bounded-regions of strokes

Definition at line 72 of file drawgpencil.c.

Function Documentation

◆ ED_gpencil_draw_fill()

void ED_gpencil_draw_fill ( struct tGPDdraw tgpw)

Wrapper to draw strokes for filling operator.

Definition at line 410 of file drawgpencil.c.

References gpencil_draw_strokes().

Referenced by gpencil_draw_datablock().

◆ gpencil_can_draw_stroke()

static bool gpencil_can_draw_stroke ( const bGPDstroke gps,
const int  dflag 
)
static

◆ gpencil_draw_stroke_3d()

static void gpencil_draw_stroke_3d ( tGPDdraw tgpw,
short  thickness,
const float  ink[4],
bool  cyclic 
)
static

◆ gpencil_draw_stroke_volumetric_3d()

static void gpencil_draw_stroke_volumetric_3d ( const bGPDspoint points,
int  totpoints,
short  thickness,
const float  ink[4] 
)
static

◆ gpencil_draw_strokes()

static void gpencil_draw_strokes ( tGPDdraw tgpw)
static

◆ gpencil_set_point_varying_color()

static void gpencil_set_point_varying_color ( const bGPDspoint pt,
const float  ink[4],
uint  attr_id,
bool  fix_strength 
)
static