Blender
V3.3
|
#include <stdio.h>
#include "BLI_listbase.h"
#include "BLI_math_geom.h"
#include "BLI_math_vector.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_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_gpencil.h"
#include "BKE_gpencil_geom.h"
#include "BKE_gpencil_modifier.h"
#include "BKE_lib_query.h"
#include "BKE_modifier.h"
#include "BKE_screen.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "DEG_depsgraph_query.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 "MEM_guardedalloc.h"
Go to the source code of this file.
Functions | |
static void | initData (GpencilModifierData *md) |
static void | copyData (const GpencilModifierData *md, GpencilModifierData *target) |
static float | calc_min_radius_v3v3 (float p1[3], float p2[3], float dir[3]) |
static float | calc_radius_limit (bGPDstroke *gps, bGPDspoint *points, float dir[3], int spread, const int i) |
static void | apply_stroke_envelope (bGPDstroke *gps, int spread, const int def_nr, const bool invert_vg, const float thickness, const float pixfactor) |
static void | deformStroke (GpencilModifierData *md, Depsgraph *UNUSED(depsgraph), Object *ob, bGPDlayer *gpl, bGPDframe *UNUSED(gpf), bGPDstroke *gps) |
static void | add_stroke (Object *ob, bGPDstroke *gps, const int point_index, const int connection_index, const int size2, const int size1, const int mat_nr, const float thickness, const float strength, ListBase *results) |
static void | add_stroke_cyclic (Object *ob, bGPDstroke *gps, const int point_index, const int connection_index, const int size, const int mat_nr, const float thickness, const float strength, ListBase *results) |
static void | add_stroke_simple (Object *ob, bGPDstroke *gps, const int point_index, const int connection_index, const int mat_nr, const float thickness, const float strength, ListBase *results) |
static void | generate_geometry (GpencilModifierData *md, Object *ob, bGPDlayer *gpl, bGPDframe *gpf) |
static void | generateStrokes (GpencilModifierData *md, Depsgraph *depsgraph, Object *ob) |
static void | bakeModifier (struct Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) |
static void | foreachIDLink (GpencilModifierData *md, Object *ob, IDWalkFunc walk, void *userData) |
static void | panel_draw (const bContext *UNUSED(C), Panel *panel) |
static void | mask_panel_draw (const bContext *UNUSED(C), Panel *panel) |
static void | panelRegister (ARegionType *region_type) |
Variables | |
GpencilModifierTypeInfo | modifierType_Gpencil_Envelope |
|
static |
Definition at line 340 of file MOD_gpencilenvelope.c.
References BKE_defvert_array_copy(), BKE_gpencil_stroke_geometry_update(), BKE_gpencil_stroke_new(), BLI_addtail(), Object::data, bGPDstroke::dvert, bGPDstroke_Runtime::gps_orig, MEM_malloc_arrayN, NULL, point_index, bGPDstroke::points, bGPDspoint::pressure, bGPDstroke::runtime, size(), bGPDspoint::strength, and bGPDstroke::thickness.
Referenced by generate_geometry().
|
static |
Definition at line 376 of file MOD_gpencilenvelope.c.
References Freestyle::a, usdtokens::b(), BKE_defvert_array_copy(), BKE_gpencil_stroke_geometry_update(), BKE_gpencil_stroke_new(), BLI_addtail(), Object::data, bGPDstroke::dvert, bGPDstroke_Runtime::gps_orig, bGPDspoint_Runtime::idx_orig, MEM_malloc_arrayN, NULL, point_index, bGPDstroke::points, bGPDspoint::pressure, bGPDspoint_Runtime::pt_orig, bGPDspoint::runtime, bGPDstroke::runtime, size(), bGPDspoint::strength, bGPDstroke::thickness, and bGPDstroke::totpoints.
Referenced by generate_geometry().
|
static |
Definition at line 427 of file MOD_gpencilenvelope.c.
References BKE_defvert_array_copy(), BKE_gpencil_stroke_geometry_update(), BKE_gpencil_stroke_new(), BLI_addtail(), Object::data, bGPDstroke::dvert, bGPDstroke_Runtime::gps_orig, bGPDspoint_Runtime::idx_orig, MEM_malloc_arrayN, NULL, point_index, bGPDstroke::points, bGPDspoint::pressure, bGPDspoint_Runtime::pt_orig, bGPDspoint::runtime, bGPDstroke::runtime, bGPDspoint::strength, and bGPDstroke::thickness.
Referenced by generate_geometry().
|
static |
Definition at line 154 of file MOD_gpencilenvelope.c.
References blender::math::abs(), calc_radius_limit(), CLAMP, closest(), copy_v3_v3(), dot_v3v3(), bGPDstroke::dvert, fabsf, bGPDstroke::flag, get_modifier_point_weight(), GP_STROKE_CYCLIC, i1, interp_v3_v3v3(), interpf(), is_cyclic(), len_v3(), len_v3v3(), line_plane_factor_v3(), max_ii(), MEM_dupallocN, MEM_freeN, min_ff(), min_ii(), normalize_v3(), NULL, point, bGPDstroke::points, sub_v3_v3v3(), bGPDstroke::totpoints, v1, v2, x, and bGPDspoint::x.
Referenced by deformStroke().
|
static |
Definition at line 584 of file MOD_gpencilenvelope.c.
References Object::data, deformStroke(), depsgraph, bGPDlayer::frames, generate_geometry(), generic_bake_deform_stroke(), GP_ENVELOPE_DEFORM, bGPdata::layers, LISTBASE_FOREACH, and EnvelopeGpencilModifierData::mode.
Definition at line 63 of file MOD_gpencilenvelope.c.
References CLAMP, KDL::diff(), dot_v3v3(), interp_v3_v3v3(), interpf(), CCL_NAMESPACE_BEGIN::isfinite(), len_squared_v3(), sqrtf, sub_v3_v3v3(), and v.
Referenced by calc_radius_limit().
|
static |
Definition at line 112 of file MOD_gpencilenvelope.c.
References calc_min_radius_v3v3(), bGPDstroke::flag, GP_STROKE_CYCLIC, i1, is_cyclic(), max_ii(), min_ff(), min_ii(), r, sub_v3_v3v3(), bGPDstroke::totpoints, x, and bGPDspoint::x.
Referenced by apply_stroke_envelope().
|
static |
Definition at line 58 of file MOD_gpencilenvelope.c.
References BKE_gpencil_modifier_copydata_generic().
|
static |
Apply envelope effect to the stroke.
Definition at line 298 of file MOD_gpencilenvelope.c.
References apply_stroke_envelope(), BKE_object_defgroup_name_index(), Object::data, EnvelopeGpencilModifierData::flag, GP_ENVELOPE_DEFORM, GP_ENVELOPE_INVERT_LAYER, GP_ENVELOPE_INVERT_LAYERPASS, GP_ENVELOPE_INVERT_MATERIAL, GP_ENVELOPE_INVERT_PASS, GP_ENVELOPE_INVERT_VGROUP, is_stroke_affected_by_modifier(), EnvelopeGpencilModifierData::layer_pass, EnvelopeGpencilModifierData::layername, bGPDlayer::line_change, EnvelopeGpencilModifierData::material, EnvelopeGpencilModifierData::mode, EnvelopeGpencilModifierData::pass_index, bGPdata::pixfactor, EnvelopeGpencilModifierData::spread, EnvelopeGpencilModifierData::thickness, bGPDstroke::thickness, and EnvelopeGpencilModifierData::vgname.
Referenced by bakeModifier().
|
static |
Definition at line 604 of file MOD_gpencilenvelope.c.
References IDWALK_CB_USER, and EnvelopeGpencilModifierData::material.
|
static |
Definition at line 468 of file MOD_gpencilenvelope.c.
References add_stroke(), add_stroke_cyclic(), add_stroke_simple(), BKE_gpencil_free_stroke(), BLI_assert, BLI_listbase_is_empty(), BLI_movelisttolist_reverse(), BLI_remlink(), EnvelopeGpencilModifierData::flag, GP_ENVELOPE_FILLS, GP_ENVELOPE_INVERT_LAYER, GP_ENVELOPE_INVERT_LAYERPASS, GP_ENVELOPE_INVERT_MATERIAL, GP_ENVELOPE_INVERT_PASS, GP_ENVELOPE_SEGMENTS, GP_STROKE_CYCLIC, is_stroke_affected_by_modifier(), EnvelopeGpencilModifierData::layer_pass, EnvelopeGpencilModifierData::layername, LISTBASE_FOREACH_MUTABLE, EnvelopeGpencilModifierData::mat_nr, EnvelopeGpencilModifierData::material, max_ii(), min_ii(), EnvelopeGpencilModifierData::mode, EnvelopeGpencilModifierData::pass_index, point_index, EnvelopeGpencilModifierData::skip, EnvelopeGpencilModifierData::spread, EnvelopeGpencilModifierData::strength, bGPDframe::strokes, EnvelopeGpencilModifierData::thickness, and Object::totcol.
Referenced by bakeModifier(), and generateStrokes().
|
static |
Apply envelope effect to the strokes.
Definition at line 566 of file MOD_gpencilenvelope.c.
References BKE_gpencil_frame_retime_get(), Object::data, DEG_get_evaluated_scene(), depsgraph, generate_geometry(), GP_ENVELOPE_DEFORM, bGPdata::layers, LISTBASE_FOREACH, EnvelopeGpencilModifierData::mode, NULL, scene, and EnvelopeGpencilModifierData::spread.
|
static |
Definition at line 49 of file MOD_gpencilenvelope.c.
References BLI_assert, DNA_struct_default_get, MEMCMP_STRUCT_AFTER_IS_ZERO, and MEMCPY_STRUCT_AFTER.
Definition at line 634 of file MOD_gpencilenvelope.c.
References gpencil_modifier_masking_panel_draw().
Referenced by panelRegister().
Definition at line 611 of file MOD_gpencilenvelope.c.
References GP_ENVELOPE_DEFORM, gpencil_modifier_panel_end(), gpencil_modifier_panel_get_property_pointers(), Panel::layout, NULL, ptr, RNA_enum_get(), uiItemR(), and uiLayoutSetPropSep().
Referenced by panelRegister().
|
static |
Definition at line 639 of file MOD_gpencilenvelope.c.
References eGpencilModifierType_Envelope, gpencil_modifier_panel_register(), gpencil_modifier_subpanel_register(), mask_panel_draw(), NULL, and panel_draw().
GpencilModifierTypeInfo modifierType_Gpencil_Envelope |
Definition at line 647 of file MOD_gpencilenvelope.c.