Blender  V3.3
Functions | Variables
MOD_gpencildash.c File Reference
#include <stdio.h>
#include <string.h>
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_string.h"
#include "DNA_defaults.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_screen.h"
#include "MEM_guardedalloc.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "RNA_access.h"
#include "RNA_prototypes.h"
#include "BLT_translation.h"
#include "MOD_gpencil_modifiertypes.h"
#include "MOD_gpencil_ui_common.h"
#include "MOD_gpencil_util.h"
#include "DEG_depsgraph.h"
#include "WM_api.h"

Go to the source code of this file.

Functions

static void initData (GpencilModifierData *md)
 
static void copyData (const GpencilModifierData *md, GpencilModifierData *target)
 
static void freeData (GpencilModifierData *md)
 
static int real_gap (const DashGpencilModifierSegment *ds)
 
static bool stroke_dash (const bGPDstroke *gps, const DashGpencilModifierData *dmd, ListBase *r_strokes)
 
static void apply_dash_for_frame (Object *ob, bGPDlayer *gpl, bGPdata *gpd, bGPDframe *gpf, DashGpencilModifierData *dmd)
 
static void bakeModifier (Main *UNUSED(bmain), Depsgraph *UNUSED(depsgraph), GpencilModifierData *md, Object *ob)
 
static bool isDisabled (GpencilModifierData *md, int UNUSED(userRenderParams))
 
static void generateStrokes (GpencilModifierData *md, Depsgraph *depsgraph, Object *ob)
 
static void foreachIDLink (GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
 
static void segment_list_item (struct uiList *UNUSED(ui_list), struct bContext *UNUSED(C), struct uiLayout *layout, struct PointerRNA *UNUSED(idataptr), struct PointerRNA *itemptr, int UNUSED(icon), struct PointerRNA *UNUSED(active_dataptr), const char *UNUSED(active_propname), int UNUSED(index), int UNUSED(flt_flag))
 
static void panel_draw (const bContext *C, Panel *panel)
 
static void mask_panel_draw (const bContext *UNUSED(C), Panel *panel)
 
static void panelRegister (ARegionType *region_type)
 

Variables

GpencilModifierTypeInfo modifierType_Gpencil_Dash
 

Function Documentation

◆ apply_dash_for_frame()

static void apply_dash_for_frame ( Object ob,
bGPDlayer gpl,
bGPdata gpd,
bGPDframe gpf,
DashGpencilModifierData dmd 
)
static

◆ bakeModifier()

static void bakeModifier ( Main UNUSEDbmain,
Depsgraph UNUSEDdepsgraph,
GpencilModifierData md,
Object ob 
)
static

◆ copyData()

static void copyData ( const GpencilModifierData md,
GpencilModifierData target 
)
static

◆ foreachIDLink()

static void foreachIDLink ( GpencilModifierData md,
Object ob,
IDWalkFunc  walk,
void userData 
)
static

Definition at line 269 of file MOD_gpencildash.c.

References IDWALK_CB_USER, and DashGpencilModifierData::material.

◆ freeData()

static void freeData ( GpencilModifierData md)
static

Definition at line 73 of file MOD_gpencildash.c.

References MEM_SAFE_FREE, and DashGpencilModifierData::segments.

◆ generateStrokes()

static void generateStrokes ( GpencilModifierData md,
Depsgraph depsgraph,
Object ob 
)
static

◆ initData()

static void initData ( GpencilModifierData md)
static

◆ isDisabled()

static bool isDisabled ( GpencilModifierData md,
int   UNUSEDuserRenderParams 
)
static

◆ mask_panel_draw()

static void mask_panel_draw ( const bContext UNUSEDC,
Panel panel 
)
static

Definition at line 351 of file MOD_gpencildash.c.

References gpencil_modifier_masking_panel_draw().

Referenced by panelRegister().

◆ panel_draw()

static void panel_draw ( const bContext C,
Panel panel 
)
static

◆ panelRegister()

static void panelRegister ( ARegionType region_type)
static

◆ real_gap()

static int real_gap ( const DashGpencilModifierSegment ds)
static

Gap==0 means to start the next segment at the immediate next point, which will leave a visual gap of "1 point". This makes the algorithm give the same visual appearance as displayed on the UI and also simplifies the check for "no-length" situation where SEG==0 (which will not produce any effective dash).

Definition at line 86 of file MOD_gpencildash.c.

References DashGpencilModifierSegment::gap.

Referenced by isDisabled(), and stroke_dash().

◆ segment_list_item()

static void segment_list_item ( struct uiList UNUSEDui_list,
struct bContext UNUSEDC,
struct uiLayout layout,
struct PointerRNA UNUSEDidataptr,
struct PointerRNA itemptr,
int   UNUSEDicon,
struct PointerRNA UNUSEDactive_dataptr,
const char *  UNUSEDactive_propname,
int   UNUSEDindex,
int   UNUSEDflt_flag 
)
static

Definition at line 276 of file MOD_gpencildash.c.

References UI_ITEM_R_NO_BG, uiItemR(), and uiLayoutRow().

Referenced by panelRegister().

◆ stroke_dash()

static bool stroke_dash ( const bGPDstroke gps,
const DashGpencilModifierData dmd,
ListBase r_strokes 
)
static

Variable Documentation

◆ modifierType_Gpencil_Dash

GpencilModifierTypeInfo modifierType_Gpencil_Dash
Initial value:
= {
N_("Dot Dash"),
"DashGpencilModifierData",
}
@ eGpencilModifierTypeFlag_SupportsEditmode
@ eGpencilModifierTypeType_Gpencil
struct DashGpencilModifierData DashGpencilModifierData
static bool isDisabled(GpencilModifierData *md, int UNUSED(userRenderParams))
static void freeData(GpencilModifierData *md)
static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
static void bakeModifier(Main *UNUSED(bmain), Depsgraph *UNUSED(depsgraph), GpencilModifierData *md, Object *ob)
static void panelRegister(ARegionType *region_type)
static void initData(GpencilModifierData *md)
static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Object *ob)
#define N_(msgid)

Definition at line 369 of file MOD_gpencildash.c.