Blender  V3.3
Functions | Variables
MOD_gpencillength.c File Reference
#include <stdio.h>
#include <string.h>
#include "BLI_hash.h"
#include "BLI_listbase.h"
#include "BLI_math_base.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_defaults.h"
#include "DNA_gpencil_modifier_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "BKE_context.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 "MOD_gpencil_modifiertypes.h"
#include "MOD_gpencil_ui_common.h"
#include "MOD_gpencil_util.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"

Go to the source code of this file.

Functions

static void initData (GpencilModifierData *md)
 
static void copyData (const GpencilModifierData *md, GpencilModifierData *target)
 
static floatnoise_table (int len, int offset, int seed)
 
BLI_INLINE float table_sample (float *table, float x)
 
static bool gpencil_modify_stroke (bGPDstroke *gps, const float length, const float overshoot_fac, const short len_mode, const bool use_curvature, const int extra_point_count, const float segment_influence, const float max_angle, const bool invert_curvature)
 
static void applyLength (GpencilModifierData *md, Depsgraph *depsgraph, bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps, Object *ob)
 
static void deformStroke (GpencilModifierData *md, Depsgraph *depsgraph, Object *ob, bGPDlayer *gpl, bGPDframe *gpf, bGPDstroke *gps)
 
static void bakeModifier (Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob)
 
static void foreachIDLink (GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
 
static void random_header_draw (const bContext *UNUSED(C), Panel *panel)
 
static void random_panel_draw (const bContext *UNUSED(C), Panel *panel)
 
static void offset_panel_draw (const bContext *UNUSED(C), Panel *panel)
 
static void panel_draw (const bContext *UNUSED(C), Panel *panel)
 
static void mask_panel_draw (const bContext *UNUSED(C), Panel *panel)
 
static void curvature_header_draw (const bContext *UNUSED(C), Panel *panel)
 
static void curvature_panel_draw (const bContext *UNUSED(C), Panel *panel)
 
static void panelRegister (ARegionType *region_type)
 

Variables

GpencilModifierTypeInfo modifierType_Gpencil_Length
 

Function Documentation

◆ applyLength()

static void applyLength ( GpencilModifierData md,
Depsgraph depsgraph,
bGPdata gpd,
bGPDframe gpf,
bGPDstroke gps,
Object ob 
)
static

◆ bakeModifier()

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

Definition at line 238 of file MOD_gpencillength.c.

References deformStroke(), depsgraph, and generic_bake_deform_stroke().

◆ copyData()

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

Definition at line 57 of file MOD_gpencillength.c.

References BKE_gpencil_modifier_copydata_generic().

◆ curvature_header_draw()

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

◆ curvature_panel_draw()

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

◆ deformStroke()

static void deformStroke ( GpencilModifierData md,
Depsgraph depsgraph,
Object ob,
bGPDlayer gpl,
bGPDframe gpf,
bGPDstroke gps 
)
static

◆ foreachIDLink()

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

Definition at line 246 of file MOD_gpencillength.c.

References IDWALK_CB_USER, and LengthGpencilModifierData::material.

◆ gpencil_modify_stroke()

static bool gpencil_modify_stroke ( bGPDstroke gps,
const float  length,
const float  overshoot_fac,
const short  len_mode,
const bool  use_curvature,
const int  extra_point_count,
const float  segment_influence,
const float  max_angle,
const bool  invert_curvature 
)
static

◆ initData()

static void initData ( GpencilModifierData md)
static

◆ mask_panel_draw()

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

Definition at line 311 of file MOD_gpencillength.c.

References gpencil_modifier_masking_panel_draw().

Referenced by panelRegister().

◆ noise_table()

static float* noise_table ( int  len,
int  offset,
int  seed 
)
static

Definition at line 62 of file MOD_gpencillength.c.

References BLI_hash_int_01(), BLI_hash_int_2d(), len, MEM_callocN, offset, and seed.

Referenced by applyLength().

◆ offset_panel_draw()

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

◆ panel_draw()

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

◆ panelRegister()

static void panelRegister ( ARegionType region_type)
static

◆ random_header_draw()

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

◆ random_panel_draw()

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

◆ table_sample()

BLI_INLINE float table_sample ( float table,
float  x 
)

Definition at line 71 of file MOD_gpencillength.c.

References ceilf, blender::math::floor(), fractf(), interpf(), and x.

Referenced by applyLength().

Variable Documentation

◆ modifierType_Gpencil_Length

GpencilModifierTypeInfo modifierType_Gpencil_Length
Initial value:
= {
N_("Length"),
"LengthGpencilModifierData",
}
@ eGpencilModifierTypeFlag_SupportsEditmode
@ eGpencilModifierTypeType_Gpencil
struct LengthGpencilModifierData LengthGpencilModifierData
static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData)
static void bakeModifier(Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob)
static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
static void deformStroke(GpencilModifierData *md, Depsgraph *depsgraph, Object *ob, bGPDlayer *gpl, bGPDframe *gpf, bGPDstroke *gps)
static void panelRegister(ARegionType *region_type)
static void initData(GpencilModifierData *md)
#define N_(msgid)

Definition at line 357 of file MOD_gpencillength.c.