Blender
V3.3
|
#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) |
typedef enum eDrawStrokeFlags eDrawStrokeFlags |
enum 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.
Wrapper to draw strokes for filling operator.
Definition at line 410 of file drawgpencil.c.
References gpencil_draw_strokes().
Referenced by gpencil_draw_datablock().
|
static |
Definition at line 258 of file drawgpencil.c.
References bGPDstroke::flag, GP_DRAWDATA_ONLY3D, GP_DRAWDATA_ONLYI2D, GP_DRAWDATA_ONLYV2D, GP_STROKE_2DIMAGE, GP_STROKE_2DSPACE, GP_STROKE_3DSPACE, NULL, bGPDstroke::points, and bGPDstroke::totpoints.
Referenced by gpencil_draw_strokes().
|
static |
Definition at line 152 of file drawgpencil.c.
References attr_id, bGPDstroke::caps, GPencilStrokeData::caps_end, GPencilStrokeData::caps_start, color, copy_v2_v2(), tGPDdraw::diff_mat, GPencilStrokeData::fill_stroke, bGPdata::flag, float(), GP_DATA_STROKE_KEEPTHICKNESS, GP_XRAY_3DSPACE, tGPDdraw::gpd, gpencil_set_point_varying_color(), tGPDdraw::gps, GPU_COMP_F32, GPU_COMP_U8, GPU_FETCH_FLOAT, GPU_FETCH_INT_TO_FLOAT_UNIT, GPU_PRIM_LINE_STRIP_ADJ, GPU_SHADER_GPENCIL_STROKE, GPU_uniformbuf_create_ex(), GPU_uniformbuf_free(), GPU_vertformat_attr_add(), immAttr1f(), immBeginAtMost(), immBindBuiltinProgram(), immBindUniformBuf(), immEnd(), immUnbindProgram(), immVertex3fv(), immVertexFormat(), tGPDdraw::is_fill_stroke, GPencilStrokeData::keep_size, max_ff(), mul_v3_m4v3(), tGPDdraw::ob, GPencilStrokeData::objscale, GPencilStrokeData::pixfactor, bGPdata::pixfactor, GPencilStrokeData::pixsize, RegionView3D::pixsize, bGPDstroke::points, pos, bGPDspoint::pressure, tGPDdraw::rv3d, Object::scale, bGPDstroke::totpoints, GPencilStrokeData::viewport, tGPDdraw::winx, tGPDdraw::winy, bGPDspoint::x, and GPencilStrokeData::xraymode.
Referenced by gpencil_draw_strokes().
|
static |
Definition at line 120 of file drawgpencil.c.
References color, gpencil_set_point_varying_color(), GPU_COMP_F32, GPU_COMP_U8, GPU_FETCH_FLOAT, GPU_FETCH_INT_TO_FLOAT_UNIT, GPU_PRIM_POINTS, GPU_program_point_size(), GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR, GPU_vertformat_attr_add(), immAttr1f(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immVertex3fv(), immVertexFormat(), pos, bGPDspoint::pressure, size(), and bGPDspoint::x.
Referenced by gpencil_draw_strokes().
Definition at line 295 of file drawgpencil.c.
References ARRAY_SET_ITEMS, BKE_material_default_gpencil(), copy_v4_v4(), tGPDdraw::custonion, tGPDdraw::dflag, tGPDdraw::disable_fill, MaterialGPencilStyle::fill_rgba, ListBase::first, MaterialGPencilStyle::flag, GP_DRAWDATA_NO_XRAY, GP_DRAWDATA_ONLY3D, GP_MATERIAL_FILL_SHOW, GP_MATERIAL_HIDE, GP_MATERIAL_HIDE_ONIONSKIN, GP_MATERIAL_MODE_DOT, GP_STROKE_CYCLIC, GP_STROKE_NOFILL, Material::gp_style, tGPDdraw::gpd, GPENCIL_ALPHA_OPACITY_THRESH, gpencil_can_draw_stroke(), gpencil_draw_stroke_3d(), gpencil_draw_stroke_volumetric_3d(), tGPDdraw::gps, GPU_DEPTH_LESS_EQUAL, GPU_depth_mask(), GPU_depth_mask_get(), GPU_DEPTH_NONE, GPU_depth_test(), GPU_polygon_offset(), GPU_program_point_size(), if(), interp_v3_v3v3(), tGPDdraw::is_fill_stroke, tGPDdraw::lthick, bGPdata::mat, max_ii(), MaterialGPencilStyle::mode, bGPDstroke::next, NULL, tGPDdraw::onion, tGPDdraw::opacity, MaterialGPencilStyle::stroke_rgba, bGPDframe::strokes, tGPDdraw::t_gpf, tGPDdraw::tintcolor, and UNPACK3.
Referenced by ED_gpencil_draw_fill().
|
static |
Definition at line 104 of file drawgpencil.c.
References attr_id, CLAMP, F2UB, GPENCIL_STRENGTH_MIN, immAttr4ub(), and bGPDspoint::strength.
Referenced by gpencil_draw_stroke_3d(), and gpencil_draw_stroke_volumetric_3d().