Blender  V3.3
Classes | Typedefs | Functions
gpencil_merge.c File Reference
#include <stdio.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BLI_math.h"
#include "DNA_gpencil_types.h"
#include "DNA_material_types.h"
#include "BKE_brush.h"
#include "BKE_context.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_report.h"
#include "WM_api.h"
#include "WM_types.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
#include "DEG_depsgraph.h"
#include "gpencil_intern.h"

Go to the source code of this file.

Classes

struct  tGPencilPointCache
 

Typedefs

typedef struct tGPencilPointCache tGPencilPointCache
 

Functions

static int gpencil_sort_points (const void *a1, const void *a2)
 
static void gpencil_insert_points_to_stroke (bGPDstroke *gps, tGPencilPointCache *points_array, int totpoints)
 
static bGPDstrokegpencil_prepare_stroke (bContext *C, wmOperator *op, int totpoints)
 
static void gpencil_get_elements_len (bContext *C, int *totstrokes, int *totpoints)
 
static void gpencil_dissolve_points (bContext *C)
 
static void gpencil_calc_points_factor (bContext *C, const int mode, int totpoints, const bool clear_point, const bool clear_stroke, tGPencilPointCache *src_array)
 
static int gpencil_insert_to_array (tGPencilPointCache *src_array, tGPencilPointCache *dst_array, int totpoints, bGPDstroke *gps_filter, bool reverse, int last)
 
static void gpencil_get_extremes (tGPencilPointCache *src_array, int totpoints, bGPDstroke *gps_filter, float *start, float *end)
 
static int gpencil_analyze_strokes (tGPencilPointCache *src_array, int totstrokes, int totpoints, tGPencilPointCache *dst_array)
 
static bool gpencil_strokes_merge_poll (bContext *C)
 
static int gpencil_stroke_merge_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_merge (wmOperatorType *ot)
 
static bool gpencil_stroke_merge_material_poll (bContext *C)
 
static int gpencil_stroke_merge_material_exec (bContext *C, wmOperator *op)
 
void GPENCIL_OT_stroke_merge_material (wmOperatorType *ot)
 

Detailed Description

Operators for merge Grease Pencil strokes.

Definition in file gpencil_merge.c.

Typedef Documentation

◆ tGPencilPointCache

Function Documentation

◆ gpencil_analyze_strokes()

static int gpencil_analyze_strokes ( tGPencilPointCache src_array,
int  totstrokes,
int  totpoints,
tGPencilPointCache dst_array 
)
static

◆ gpencil_calc_points_factor()

static void gpencil_calc_points_factor ( bContext C,
const int  mode,
int  totpoints,
const bool  clear_point,
const bool  clear_stroke,
tGPencilPointCache src_array 
)
static

◆ gpencil_dissolve_points()

static void gpencil_dissolve_points ( bContext C)
static

◆ gpencil_get_elements_len()

static void gpencil_get_elements_len ( bContext C,
int *  totstrokes,
int *  totpoints 
)
static

◆ gpencil_get_extremes()

static void gpencil_get_extremes ( tGPencilPointCache src_array,
int  totpoints,
bGPDstroke gps_filter,
float start,
float end 
)
static

Definition at line 325 of file gpencil_merge.c.

References copy_v3_v3(), tGPencilPointCache::gps, NULL, and tGPencilPointCache::x.

Referenced by gpencil_analyze_strokes().

◆ gpencil_insert_points_to_stroke()

static void gpencil_insert_points_to_stroke ( bGPDstroke gps,
tGPencilPointCache points_array,
int  totpoints 
)
static

◆ gpencil_insert_to_array()

static int gpencil_insert_to_array ( tGPencilPointCache src_array,
tGPencilPointCache dst_array,
int  totpoints,
bGPDstroke gps_filter,
bool  reverse,
int  last 
)
static

◆ GPENCIL_OT_stroke_merge()

void GPENCIL_OT_stroke_merge ( wmOperatorType ot)

◆ GPENCIL_OT_stroke_merge_material()

void GPENCIL_OT_stroke_merge_material ( wmOperatorType ot)

◆ gpencil_prepare_stroke()

static bGPDstroke* gpencil_prepare_stroke ( bContext C,
wmOperator op,
int  totpoints 
)
static

◆ gpencil_sort_points()

static int gpencil_sort_points ( const void a1,
const void a2 
)
static

Definition at line 51 of file gpencil_merge.c.

References tGPencilPointCache::factor.

Referenced by gpencil_stroke_merge_exec().

◆ gpencil_stroke_merge_exec()

static int gpencil_stroke_merge_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_merge_material_exec()

static int gpencil_stroke_merge_material_exec ( bContext C,
wmOperator op 
)
static

◆ gpencil_stroke_merge_material_poll()

static bool gpencil_stroke_merge_material_poll ( bContext C)
static

Definition at line 555 of file gpencil_merge.c.

References C, CTX_data_active_object(), NULL, OB_GPENCIL, and Object::type.

Referenced by GPENCIL_OT_stroke_merge_material().

◆ gpencil_strokes_merge_poll()

static bool gpencil_strokes_merge_poll ( bContext C)
static