|
Blender V4.3
|
#include <cmath>#include <cstddef>#include <cstdio>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_math_color.h"#include "BLI_math_vector.h"#include "BLT_translation.hh"#include "DNA_collection_types.h"#include "DNA_gpencil_legacy_types.h"#include "DNA_material_types.h"#include "DNA_meshdata_types.h"#include "DNA_scene_types.h"#include "BKE_collection.hh"#include "BKE_curve.hh"#include "BKE_gpencil_curve_legacy.h"#include "BKE_gpencil_geom_legacy.h"#include "BKE_gpencil_legacy.h"#include "BKE_material.h"#include "curve_fit_nd.h"#include "DEG_depsgraph_query.hh"Go to the source code of this file.
Macros | |
| #define | COORD_FITTING_INFLUENCE 20.0f |
| #define | POINT_DIM 9 |
Functions | |
Convert to curve object | |
| static void | gpencil_editstroke_deselect_all (bGPDcurve *gpc) |
Edit-Curve Kernel Functions | |
| static bGPDcurve * | gpencil_stroke_editcurve_generate_edgecases (bGPDstroke *gps, const float stroke_radius) |
| bGPDcurve * | BKE_gpencil_stroke_editcurve_generate (bGPDstroke *gps, const float error_threshold, const float corner_angle, const float stroke_radius) |
| void | BKE_gpencil_editcurve_stroke_sync_selection (bGPdata *, bGPDstroke *gps, bGPDcurve *gpc) |
| void | BKE_gpencil_editcurve_recalculate_handles (bGPDstroke *gps) |
| static int | gpencil_editcurve_subdivide_count (bGPDcurve *gpc, bool is_cyclic) |
| static void | gpencil_editcurve_subdivide_curve_segment (bGPDcurve_point *cpt_start, bGPDcurve_point *cpt_end, bGPDcurve_point *cpt_new) |
| void | BKE_gpencil_editcurve_subdivide (bGPDstroke *gps, const int cuts) |
| #define COORD_FITTING_INFLUENCE 20.0f |
Definition at line 41 of file gpencil_curve_legacy.cc.
Referenced by BKE_gpencil_stroke_editcurve_generate().
| #define POINT_DIM 9 |
Referenced by BKE_gpencil_stroke_editcurve_generate().
| void BKE_gpencil_editcurve_recalculate_handles | ( | struct bGPDstroke * | gps | ) |
Recalculate the handles of the edit curve of a grease pencil stroke.
Definition at line 275 of file gpencil_curve_legacy.cc.
References bGPDcurve_point::bezt, BKE_nurb_handle_calc(), bGPDcurve::curve_points, bGPDstroke::editcurve, bGPDcurve_point::flag, bGPDstroke::flag, GP_CURVE_POINT_SELECT, GP_STROKE_CYCLIC, GP_STROKE_NEEDS_CURVE_UPDATE, and bGPDcurve::tot_curve_points.
Referenced by createTransGPencil_curves(), and recalcData_gpencil_strokes().
| void BKE_gpencil_editcurve_stroke_sync_selection | ( | struct bGPdata * | gpd, |
| struct bGPDstroke * | gps, | ||
| struct bGPDcurve * | gpc ) |
Sync the selection from stroke to edit-curve.
Definition at line 249 of file gpencil_curve_legacy.cc.
References bGPDcurve_point::bezt, BEZT_DESEL_ALL, BEZT_SEL_ALL, bGPDcurve::curve_points, bGPDcurve::flag, bGPDcurve_point::flag, bGPDspoint::flag, bGPDstroke::flag, GP_CURVE_POINT_SELECT, GP_CURVE_SELECT, GP_SPOINT_SELECT, GP_STROKE_SELECT, gpencil_editstroke_deselect_all(), bGPDcurve_point::point_index, bGPDstroke::points, and bGPDcurve::tot_curve_points.
| void BKE_gpencil_editcurve_subdivide | ( | bGPDstroke * | gps, |
| const int | cuts ) |
Definition at line 402 of file gpencil_curve_legacy.cc.
References bGPDcurve_point::bezt, BEZT_SEL_ALL, bGPDcurve::curve_points, bGPDstroke::editcurve, bGPDcurve_point::flag, bGPDstroke::flag, GP_CURVE_POINT_SELECT, GP_STROKE_CYCLIC, gpencil_editcurve_subdivide_count(), gpencil_editcurve_subdivide_curve_segment(), BezTriple::h1, BezTriple::h2, HD_ALIGN, is_cyclic(), MEM_callocN, MEM_freeN(), and bGPDcurve::tot_curve_points.
| bGPDcurve * BKE_gpencil_stroke_editcurve_generate | ( | struct bGPDstroke * | gps, |
| float | error_threshold, | ||
| float | corner_angle, | ||
| float | stroke_radius ) |
Creates a bGPDcurve by doing a cubic curve fitting on the grease pencil stroke points.
Definition at line 137 of file gpencil_curve_legacy.cc.
References bGPDcurve_point::bezt, BKE_gpencil_stroke_editcurve_new(), bGPDstroke::boundbox_max, bGPDstroke::boundbox_min, COORD_FITTING_INFLUENCE, bGPDcurve::curve_points, bGPDstroke::flag, free(), GP_STROKE_CYCLIC, gpencil_stroke_editcurve_generate_edgecases(), BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_FREE, len_v3v3(), madd_v3_v3v3fl(), MEM_callocN, MEM_freeN(), mul_v3_v3fl(), mul_v4_v4fl(), POINT_DIM, bGPDcurve_point::point_index, bGPDstroke::points, bGPDcurve_point::pressure, bGPDspoint::pressure, bGPDcurve_point::strength, bGPDspoint::strength, sub_v3_v3v3(), bGPDstroke::totpoints, BezTriple::vec, bGPDcurve_point::vert_color, bGPDspoint::vert_color, and bGPDspoint::x.
Definition at line 345 of file gpencil_curve_legacy.cc.
References count, bGPDcurve::curve_points, bGPDcurve_point::flag, GP_CURVE_POINT_SELECT, is_cyclic(), and bGPDcurve::tot_curve_points.
Referenced by BKE_gpencil_editcurve_subdivide().
|
static |
Definition at line 369 of file gpencil_curve_legacy.cc.
References b, bGPDcurve_point::bezt, interp_v4_v4v4(), interpf(), bGPDcurve_point::pressure, q1, bGPDcurve_point::strength, BezTriple::vec, and bGPDcurve_point::vert_color.
Referenced by BKE_gpencil_editcurve_subdivide().
|
static |
Definition at line 47 of file gpencil_curve_legacy.cc.
References bGPDcurve_point::bezt, BEZT_DESEL_ALL, bGPDcurve::curve_points, bGPDcurve::flag, bGPDcurve_point::flag, and bGPDcurve::tot_curve_points.
Referenced by BKE_gpencil_editcurve_stroke_sync_selection().
|
static |
Definition at line 64 of file gpencil_curve_legacy.cc.
References add_v3_v3v3(), bGPDcurve_point::bezt, BKE_gpencil_stroke_editcurve_new(), BLI_assert, copy_v3_v3(), copy_v4_v4(), bGPDcurve::curve_points, float, BezTriple::h1, BezTriple::h2, HD_FREE, HD_VECT, len_v3v3(), normalize_v3_length(), bGPDcurve_point::point_index, bGPDstroke::points, bGPDcurve_point::pressure, bGPDspoint::pressure, bGPDcurve_point::strength, bGPDspoint::strength, sub_v3_v3v3(), bGPDstroke::totpoints, BezTriple::vec, bGPDcurve_point::vert_color, bGPDspoint::vert_color, and bGPDspoint::x.
Referenced by BKE_gpencil_stroke_editcurve_generate().