|
Blender V4.3
|
#include <algorithm>#include <cmath>#include <cstddef>#include <cstdio>#include <cstdlib>#include <cstring>#include "MEM_guardedalloc.h"#include "BLI_array_utils.h"#include "BLI_blenlib.h"#include "BLI_ghash.h"#include "BLI_hash.h"#include "BLI_heap.h"#include "BLI_math_geom.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "BLI_math_vector.hh"#include "BLI_math_vector_types.hh"#include "BLI_polyfill_2d.h"#include "BLI_span.hh"#include "BLI_string_utils.hh"#include "DNA_gpencil_legacy_types.h"#include "DNA_gpencil_modifier_types.h"#include "DNA_material_types.h"#include "DNA_mesh_types.h"#include "DNA_meshdata_types.h"#include "DNA_scene_types.h"#include "BKE_attribute.hh"#include "BKE_deform.hh"#include "BKE_gpencil_curve_legacy.h"#include "BKE_gpencil_geom_legacy.h"#include "BKE_gpencil_legacy.h"#include "BKE_material.h"#include "BKE_object.hh"#include "BKE_object_types.hh"#include "DEG_depsgraph_query.hh"Go to the source code of this file.
Classes | |
| struct | tGPDeleteIsland |
Functions | |
| void | BKE_gpencil_transform (bGPdata *gpd, const float mat[4][4]) |
| int | BKE_gpencil_stroke_point_count (const bGPdata *gpd) |
| void | BKE_gpencil_point_coords_get (bGPdata *gpd, GPencilPointCoordinates *elem_data) |
| void | BKE_gpencil_point_coords_apply (bGPdata *gpd, const GPencilPointCoordinates *elem_data) |
| void | BKE_gpencil_point_coords_apply_with_mat4 (bGPdata *gpd, const GPencilPointCoordinates *elem_data, const float mat[4][4]) |
| void | BKE_gpencil_stroke_set_random_color (bGPDstroke *gps) |
| void | BKE_gpencil_stroke_flip (bGPDstroke *gps) |
| static void | gpencil_stroke_join_islands (bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps_first, bGPDstroke *gps_last) |
| bGPDstroke * | BKE_gpencil_stroke_delete_tagged_points (bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gps, bGPDstroke *next_stroke, int tag_flags, const bool select, const bool flat_cap, const int limit) |
| static void | gpencil_stroke_copy_point (bGPDstroke *gps, MDeformVert *dvert, bGPDspoint *point, const float delta[3], float pressure, float strength, float deltatime) |
| void | BKE_gpencil_stroke_join (bGPDstroke *gps_a, bGPDstroke *gps_b, const bool leave_gaps, const bool fit_thickness, const bool smooth, bool auto_flip) |
| void | BKE_gpencil_stroke_to_view_space (bGPDstroke *gps, float viewmat[4][4], const float diff_mat[4][4]) |
| void | BKE_gpencil_stroke_from_view_space (bGPDstroke *gps, float viewinv[4][4], const float diff_mat[4][4]) |
| float | BKE_gpencil_stroke_average_pressure_get (bGPDstroke *gps) |
| bool | BKE_gpencil_stroke_is_pressure_constant (bGPDstroke *gps) |
Grease Pencil Object: Bound-box Support | |
| bool | BKE_gpencil_stroke_minmax (const bGPDstroke *gps, const bool use_select, float r_min[3], float r_max[3]) |
| std::optional< blender::Bounds< blender::float3 > > | BKE_gpencil_data_minmax (const bGPdata *gpd) |
| void | BKE_gpencil_centroid_3d (bGPdata *gpd, float r_centroid[3]) |
| void | BKE_gpencil_stroke_boundingbox_calc (bGPDstroke *gps) |
Stroke Smooth Positions | |
| bool | BKE_gpencil_stroke_smooth_point (bGPDstroke *gps, int point_index, float influence, int iterations, const bool smooth_caps, const bool keep_shape, bGPDstroke *r_gps) |
Stroke Smooth Strength | |
| bool | BKE_gpencil_stroke_smooth_strength (bGPDstroke *gps, int point_index, float influence, int iterations, bGPDstroke *r_gps) |
Stroke Smooth Thickness | |
| bool | BKE_gpencil_stroke_smooth_thickness (bGPDstroke *gps, int point_index, float influence, int iterations, bGPDstroke *r_gps) |
Stroke Smooth UV | |
| bool | BKE_gpencil_stroke_smooth_uv (bGPDstroke *gps, int point_index, float influence, int iterations, bGPDstroke *r_gps) |
| void | BKE_gpencil_stroke_smooth (bGPDstroke *gps, const float influence, const int iterations, const bool smooth_position, const bool smooth_strength, const bool smooth_thickness, const bool smooth_uv, const bool keep_shape, const float *weights) |
| void | BKE_gpencil_stroke_2d_flat (const bGPDspoint *points, int totpoints, float(*points2d)[2], int *r_direction) |
| void | BKE_gpencil_stroke_2d_flat_ref (const bGPDspoint *ref_points, int ref_totpoints, const bGPDspoint *points, int totpoints, float(*points2d)[2], const float scale, int *r_direction) |
| static void | gpencil_calc_stroke_fill_uv (const float(*points2d)[2], bGPDstroke *gps, const float minv[2], const float maxv[2], float(*r_uv)[2]) |
Stroke Fill Triangulate | |
| void | BKE_gpencil_stroke_fill_triangulate (bGPDstroke *gps) |
| void | BKE_gpencil_stroke_uv_update (bGPDstroke *gps) |
| void | BKE_gpencil_stroke_geometry_update (bGPdata *, bGPDstroke *gps) |
| float | BKE_gpencil_stroke_length (const bGPDstroke *gps, bool use_3d) |
| float | BKE_gpencil_stroke_segment_length (const bGPDstroke *gps, const int start_index, const int end_index, bool use_3d) |
| bool | BKE_gpencil_stroke_trim (bGPdata *gpd, bGPDstroke *gps) |
| bool | BKE_gpencil_stroke_close (bGPDstroke *gps) |
Normal Calculation | |
| void | BKE_gpencil_stroke_normal (const bGPDstroke *gps, float r_normal[3]) |
Compute center of bounding box.
| gpd | Grease pencil data-block |
| r_centroid | Location of the center |
Definition at line 110 of file gpencil_geom_legacy.cc.
References BKE_gpencil_data_minmax(), bounds(), copy_v3_v3(), and blender::math::midpoint().
Referenced by blender::ed::object::object_origin_set_exec().
| std::optional< blender::Bounds< blender::float3 > > BKE_gpencil_data_minmax | ( | const bGPdata * | gpd | ) |
Definition at line 86 of file gpencil_geom_legacy.cc.
References BKE_gpencil_stroke_minmax(), INIT_MINMAX, bGPdata::layers, LISTBASE_FOREACH, max, min, and bGPDframe::strokes.
Referenced by BKE_gpencil_centroid_3d().
| void BKE_gpencil_point_coords_apply | ( | struct bGPdata * | gpd, |
| const GPencilPointCoordinates * | elem_data ) |
Definition at line 1141 of file gpencil_geom_legacy.cc.
References BKE_gpencil_stroke_geometry_update(), GPencilPointCoordinates::co, copy_v3_v3(), bGPdata::layers, LISTBASE_FOREACH, bGPDstroke::points, bGPDspoint::pressure, GPencilPointCoordinates::pressure, bGPDstroke::totpoints, and bGPDspoint::x.
Referenced by blender::ed::object::data_xform_restore().
| void BKE_gpencil_point_coords_apply_with_mat4 | ( | struct bGPdata * | gpd, |
| const GPencilPointCoordinates * | elem_data, | ||
| const float | mat[4][4] ) |
Definition at line 1174 of file gpencil_geom_legacy.cc.
References BKE_gpencil_stroke_geometry_update(), GPencilPointCoordinates::co, bGPdata::layers, LISTBASE_FOREACH, mat4_to_scale(), mul_v3_m4v3(), bGPDstroke::points, bGPDspoint::pressure, GPencilPointCoordinates::pressure, bGPDstroke::totpoints, and bGPDspoint::x.
Referenced by blender::ed::object::data_xform_by_mat4().
| void BKE_gpencil_point_coords_get | ( | struct bGPdata * | gpd, |
| GPencilPointCoordinates * | elem_data ) |
Definition at line 1111 of file gpencil_geom_legacy.cc.
References GPencilPointCoordinates::co, copy_v3_v3(), bGPdata::layers, LISTBASE_FOREACH, bGPDstroke::points, bGPDspoint::pressure, GPencilPointCoordinates::pressure, bGPDstroke::totpoints, and bGPDspoint::x.
Referenced by blender::ed::object::data_xform_create_ex().
| void BKE_gpencil_stroke_2d_flat | ( | const bGPDspoint * | points, |
| int | totpoints, | ||
| float(*) | points2d[2], | ||
| int * | r_direction ) |
Definition at line 488 of file gpencil_geom_legacy.cc.
References BLI_assert, copy_v3_v3(), cross(), cross_v3_v3v3(), dot_v3v3(), int, mul_v3_v3fl(), normalize_v3(), sub_v3_v3v3(), and bGPDspoint::x.
Referenced by BKE_gpencil_stroke_fill_triangulate().
| void BKE_gpencil_stroke_2d_flat_ref | ( | const bGPDspoint * | ref_points, |
| int | ref_totpoints, | ||
| const bGPDspoint * | points, | ||
| int | totpoints, | ||
| float(*) | points2d[2], | ||
| const float | scale, | ||
| int * | r_direction ) |
Definition at line 562 of file gpencil_geom_legacy.cc.
References add_v3_v3v3(), BLI_assert, copy_v3_v3(), cross_v3_v3v3(), dot_v3v3(), int, mul_v3_fl(), mul_v3_v3fl(), normalize_v3(), sub_v3_v3v3(), and bGPDspoint::x.
| float BKE_gpencil_stroke_average_pressure_get | ( | struct bGPDstroke * | gps | ) |
Get average pressure.
Definition at line 1714 of file gpencil_geom_legacy.cc.
References float, bGPDstroke::points, bGPDspoint::pressure, and bGPDstroke::totpoints.
| void BKE_gpencil_stroke_boundingbox_calc | ( | struct bGPDstroke * | gps | ) |
Compute stroke bounding box.
| gps | Grease pencil Stroke |
Definition at line 117 of file gpencil_geom_legacy.cc.
References BKE_gpencil_stroke_minmax(), bGPDstroke::boundbox_max, bGPDstroke::boundbox_min, and INIT_MINMAX.
Referenced by BKE_gpencil_stroke_geometry_update().
| bool BKE_gpencil_stroke_close | ( | struct bGPDstroke * | gps | ) |
Close grease pencil stroke.
| gps | Stroke to close |
Definition at line 925 of file gpencil_geom_legacy.cc.
References BKE_defvert_ensure_index(), bGPDstroke::dvert, MDeformVert::dw, bGPDspoint::flag, bGPDstroke::flag, float, GP_SPOINT_SELECT, GP_STROKE_CYCLIC, GP_STROKE_SELECT, interp_v3_v3v3(), interp_v4_v4v4(), interpf(), len_v3v3(), MEM_recallocN, bGPDstroke::points, bGPDspoint::pressure, bGPDspoint::strength, bGPDstroke::totpoints, MDeformVert::totweight, bGPDspoint::vert_color, MDeformWeight::weight, and bGPDspoint::x.
| bGPDstroke * BKE_gpencil_stroke_delete_tagged_points | ( | struct bGPdata * | gpd, |
| struct bGPDframe * | gpf, | ||
| struct bGPDstroke * | gps, | ||
| struct bGPDstroke * | next_stroke, | ||
| int | tag_flags, | ||
| bool | select, | ||
| bool | flat_cap, | ||
| int | limit ) |
Split the given stroke into several new strokes, partitioning it based on whether the stroke points have a particular flag is set (e.g. GP_SPOINT_SELECT in most cases, but not always).
Definition at line 1334 of file gpencil_geom_legacy.cc.
References BKE_gpencil_free_stroke(), BKE_gpencil_stroke_duplicate(), BKE_gpencil_stroke_geometry_update(), BLI_addtail(), BLI_insertlinkbefore(), BLI_remlink(), bGPDstroke::caps, double(), bGPDstroke::dvert, MDeformVert::dw, e, tGPDeleteIsland::end_idx, bGPDspoint::flag, bGPDstroke::flag, GP_SPOINT_TAG, GP_STROKE_CAP_FLAT, GP_STROKE_CYCLIC, gpencil_stroke_join_islands(), bGPDstroke::inittime, is_cyclic(), max_ff(), MEM_callocN, MEM_dupallocN, MEM_freeN(), bGPDstroke::points, select(), tGPDeleteIsland::start_idx, bGPDframe::strokes, bGPDspoint::time, and bGPDstroke::totpoints.
Referenced by annotation_stroke_eraser_dostroke().
| void BKE_gpencil_stroke_fill_triangulate | ( | struct bGPDstroke * | gps | ) |
Triangulate stroke to generate data for filling areas.
| gps | Grease pencil stroke |
Definition at line 691 of file gpencil_geom_legacy.cc.
References ARRAY_SET_ITEMS, BKE_gpencil_stroke_2d_flat(), BLI_assert, BLI_polyfill_calc(), copy_v2_v2(), float, gpencil_calc_stroke_fill_uv(), MEM_callocN, MEM_freeN(), MEM_mallocN, MEM_SAFE_FREE, bGPDstroke::points, bGPDstroke::tot_triangles, bGPDstroke::totpoints, bGPDstroke::triangles, bGPDspoint::uv_fill, and bGPDtriangle::verts.
Referenced by BKE_gpencil_stroke_geometry_update().
| void BKE_gpencil_stroke_flip | ( | struct bGPDstroke * | gps | ) |
Flip stroke.
Definition at line 1225 of file gpencil_geom_legacy.cc.
References BLI_array_reverse, bGPDstroke::dvert, bGPDstroke::points, and bGPDstroke::totpoints.
Referenced by BKE_gpencil_stroke_join().
| void BKE_gpencil_stroke_from_view_space | ( | struct bGPDstroke * | gps, |
| float | viewinv[4][4], | ||
| const float | diff_mat[4][4] ) |
Stroke from view space Transforms a stroke from view space back to world space. Inverse of BKE_gpencil_stroke_to_view_space
Definition at line 1698 of file gpencil_geom_legacy.cc.
References invert_m4_m4(), mul_m4_v3(), mul_v3_m4v3(), bGPDstroke::points, bGPDstroke::totpoints, and bGPDspoint::x.
| void BKE_gpencil_stroke_geometry_update | ( | struct bGPdata * | gpd, |
| struct bGPDstroke * | gps ) |
Recalc all internal geometry data for the stroke
| gpd | Grease pencil data-block |
| gps | Grease pencil stroke |
Definition at line 765 of file gpencil_geom_legacy.cc.
References BKE_gpencil_stroke_boundingbox_calc(), BKE_gpencil_stroke_fill_triangulate(), BKE_gpencil_stroke_uv_update(), MEM_SAFE_FREE, bGPDstroke::tot_triangles, bGPDstroke::totpoints, and bGPDstroke::triangles.
Referenced by BKE_gpencil_point_coords_apply(), BKE_gpencil_point_coords_apply_with_mat4(), BKE_gpencil_stroke_delete_tagged_points(), BKE_gpencil_stroke_trim(), BKE_gpencil_transform(), blo_do_versions_280(), gpencil_stroke_join_islands(), blender::ed::object::object_origin_set_exec(), and recalcData_gpencil_strokes().
| bool BKE_gpencil_stroke_is_pressure_constant | ( | struct bGPDstroke * | gps | ) |
Check if the thickness of the stroke is constant.
Definition at line 1730 of file gpencil_geom_legacy.cc.
References bGPDstroke::points, bGPDspoint::pressure, and bGPDstroke::totpoints.
| void BKE_gpencil_stroke_join | ( | struct bGPDstroke * | gps_a, |
| struct bGPDstroke * | gps_b, | ||
| bool | leave_gaps, | ||
| bool | fit_thickness, | ||
| bool | smooth, | ||
| bool | auto_flip ) |
Join two strokes using the shortest distance (reorder stroke if necessary).
| auto_flip | Flip the stroke if the join between two strokes is not end->start points. |
Definition at line 1552 of file gpencil_geom_legacy.cc.
References BKE_gpencil_stroke_flip(), BKE_gpencil_stroke_smooth_point(), copy_v3_v3(), bGPDstroke::dvert, ELEM, float, gpencil_stroke_copy_point(), len, len_squared_v3v3(), point, bGPDstroke::points, bGPDspoint::pressure, bGPDspoint::strength, bGPDstroke::thickness, bGPDstroke::totpoints, and bGPDspoint::x.
| float BKE_gpencil_stroke_length | ( | const bGPDstroke * | gps, |
| bool | use_3d ) |
Definition at line 786 of file gpencil_geom_legacy.cc.
References len_v2v2(), len_v3v3(), bGPDstroke::points, bGPDstroke::totpoints, and bGPDspoint::x.
| bool BKE_gpencil_stroke_minmax | ( | const bGPDstroke * | gps, |
| const bool | use_select, | ||
| float | r_min[3], | ||
| float | r_max[3] ) |
Definition at line 58 of file gpencil_geom_legacy.cc.
References GP_SPOINT_SELECT, minmax_v3v3_v3(), bGPDstroke::points, and bGPDstroke::totpoints.
Referenced by BKE_gpencil_data_minmax(), and BKE_gpencil_stroke_boundingbox_calc().
| void BKE_gpencil_stroke_normal | ( | const bGPDstroke * | gps, |
| float | r_normal[3] ) |
Definition at line 1020 of file gpencil_geom_legacy.cc.
References cross_v3_v3v3(), int, normalize_v3(), bGPDstroke::points, sub_v3_v3v3(), bGPDstroke::totpoints, bGPDspoint::x, and zero_v3().
Definition at line 1085 of file gpencil_geom_legacy.cc.
References bGPdata::layers, LISTBASE_FOREACH, and bGPDstroke::totpoints.
| float BKE_gpencil_stroke_segment_length | ( | const bGPDstroke * | gps, |
| const int | start_index, | ||
| const int | end_index, | ||
| bool | use_3d ) |
Definition at line 806 of file gpencil_geom_legacy.cc.
References len_v2v2(), len_v3v3(), bGPDstroke::points, bGPDstroke::totpoints, and bGPDspoint::x.
| void BKE_gpencil_stroke_set_random_color | ( | struct bGPDstroke * | gps | ) |
Set a random color to stroke using vertex color.
| gps | Stroke |
Definition at line 1210 of file gpencil_geom_legacy.cc.
References BLI_assert, BLI_hash_int_01(), BLI_hash_int_2d(), copy_v4_v4(), bGPDstroke::points, bGPDstroke::totpoints, bGPDspoint::vert_color, bGPDspoint::x, bGPDspoint::y, and bGPDspoint::z.
| void BKE_gpencil_stroke_smooth | ( | struct bGPDstroke * | gps, |
| const float | influence, | ||
| const int | iterations, | ||
| const bool | smooth_position, | ||
| const bool | smooth_strength, | ||
| const bool | smooth_thickness, | ||
| const bool | smooth_uv, | ||
| const bool | keep_shape, | ||
| const float * | weights ) |
Apply smooth operation to the stroke.
| gps | Stroke to smooth |
| influence | The interpolation factor for the smooth and the original stroke |
| iterations | Radius of points to consider, equivalent to iterations |
| smooth_position | Smooth point locations |
| smooth_strength | Smooth point strength |
| smooth_thickness | Smooth point thickness |
| smooth_uv | Smooth uv rotation/factor |
| keep_shape | Use different distribution for smooth locations to keep the shape |
| weights | per point weights to multiply influence with (optional, can be null) |
Definition at line 438 of file gpencil_geom_legacy.cc.
References BKE_gpencil_stroke_smooth_point(), BKE_gpencil_stroke_smooth_strength(), BKE_gpencil_stroke_smooth_thickness(), BKE_gpencil_stroke_smooth_uv(), MEM_dupallocN, MEM_freeN(), bGPDstroke::points, and bGPDstroke::totpoints.
| bool BKE_gpencil_stroke_smooth_point | ( | struct bGPDstroke * | gps, |
| int | point_index, | ||
| float | influence, | ||
| int | iterations, | ||
| bool | smooth_caps, | ||
| bool | keep_shape, | ||
| struct bGPDstroke * | r_gps ) |
Apply smooth position to stroke point.
| gps | Stroke to smooth |
| i | Point index |
| inf | Amount of smoothing to apply |
| iterations | Radius of points to consider, equivalent to iterations |
| smooth_caps | Apply smooth to stroke extremes |
| keep_shape | Smooth out fine details first |
| r_gps | Stroke to put the result into |
Definition at line 129 of file gpencil_geom_legacy.cc.
References add_v3_v3(), copy_v3_v3(), double(), ELEM, exp(), bGPDstroke::flag, float, GP_STROKE_CYCLIC, interp_v3_v3v3(), is_cyclic(), M_SQRT3, madd_v3_v3fl(), mul_v3_fl(), bGPDstroke::points, sub_v3_v3v3(), bGPDstroke::totpoints, w(), and bGPDspoint::x.
Referenced by BKE_gpencil_stroke_join(), and BKE_gpencil_stroke_smooth().
| bool BKE_gpencil_stroke_smooth_strength | ( | struct bGPDstroke * | gps, |
| int | point_index, | ||
| float | influence, | ||
| int | iterations, | ||
| struct bGPDstroke * | r_gps ) |
Apply smooth strength to stroke point.
| gps | Stroke to smooth |
| point_index | Point index |
| influence | Amount of smoothing to apply |
| iterations | Radius of points to consider, equivalent to iterations |
| r_gps | Stroke to put the result into |
Definition at line 251 of file gpencil_geom_legacy.cc.
References CLAMP_MAX, CLAMP_MIN, bGPDstroke::flag, float, GP_STROKE_CYCLIC, is_cyclic(), bGPDstroke::points, bGPDspoint::strength, bGPDstroke::totpoints, and w().
Referenced by BKE_gpencil_stroke_smooth().
| bool BKE_gpencil_stroke_smooth_thickness | ( | struct bGPDstroke * | gps, |
| int | point_index, | ||
| float | influence, | ||
| int | iterations, | ||
| struct bGPDstroke * | r_gps ) |
Apply smooth for thickness to stroke point (use pressure).
| gps | Stroke to smooth |
| point_index | Point index |
| influence | Amount of smoothing to apply |
| iterations | Radius of points to consider, equivalent to iterations |
| r_gps | Stroke to put the result into |
Definition at line 309 of file gpencil_geom_legacy.cc.
References CLAMP_MAX, CLAMP_MIN, bGPDstroke::flag, float, GP_STROKE_CYCLIC, is_cyclic(), bGPDstroke::points, bGPDspoint::pressure, bGPDstroke::totpoints, and w().
Referenced by BKE_gpencil_stroke_smooth().
| bool BKE_gpencil_stroke_smooth_uv | ( | struct bGPDstroke * | gps, |
| int | point_index, | ||
| float | influence, | ||
| int | iterations, | ||
| struct bGPDstroke * | r_gps ) |
Apply smooth for UV rotation/factor to stroke point.
| gps | Stroke to smooth |
| point_index | Point index |
| influence | Amount of smoothing to apply |
| iterations | Radius of points to consider, equivalent to iterations |
| r_gps | Stroke to put the result into |
Definition at line 367 of file gpencil_geom_legacy.cc.
References ELEM, bGPDstroke::flag, float, GP_STROKE_CYCLIC, is_cyclic(), bGPDstroke::points, bGPDstroke::totpoints, bGPDspoint::uv_fac, bGPDspoint::uv_rot, and w().
Referenced by BKE_gpencil_stroke_smooth().
| void BKE_gpencil_stroke_to_view_space | ( | struct bGPDstroke * | gps, |
| float | viewmat[4][4], | ||
| const float | diff_mat[4][4] ) |
Stroke to view space Transforms a stroke to view space. This allows for manipulations in 2D but also easy conversion back to 3D.
Definition at line 1685 of file gpencil_geom_legacy.cc.
References mul_m4_v3(), mul_v3_m4v3(), bGPDstroke::points, bGPDstroke::totpoints, and bGPDspoint::x.
| bool BKE_gpencil_stroke_trim | ( | struct bGPdata * | gpd, |
| struct bGPDstroke * | gps ) |
Trim stroke to the first intersection or loop.
| gps | Stroke data |
Definition at line 833 of file gpencil_geom_legacy.cc.
References b, BKE_gpencil_stroke_geometry_update(), closest_to_line_v3(), copy_v3_v3(), bGPDstroke::dvert, MDeformVert::dw, ELEM, intersect(), isect_line_line_v3(), len_v3(), MEM_dupallocN, MEM_recallocN, MEM_SAFE_FREE, bGPDstroke::points, bGPDstroke::totpoints, and bGPDspoint::x.
| void BKE_gpencil_stroke_uv_update | ( | struct bGPDstroke * | gps | ) |
Update Stroke UV data.
| gps | Grease pencil stroke |
Definition at line 750 of file gpencil_geom_legacy.cc.
References len_v3v3(), bGPDstroke::points, bGPDstroke::totpoints, and bGPDspoint::uv_fac.
Referenced by BKE_gpencil_stroke_geometry_update().
Apply grease pencil Transforms.
| gpd | Grease pencil data-block |
| mat | Transformation matrix |
Definition at line 1052 of file gpencil_geom_legacy.cc.
References BKE_gpencil_stroke_geometry_update(), bGPdata::layers, LISTBASE_FOREACH, mat4_to_scale(), mul_m4_v3(), bGPDstroke::points, bGPDspoint::pressure, bGPDstroke::totpoints, and bGPDspoint::x.
Referenced by blender::ed::object::apply_objects_internal().
|
static |
Definition at line 647 of file gpencil_geom_legacy.cc.
References add_v2_v2(), cos(), mul_v2_fl(), bGPDstroke::totpoints, bGPDstroke::uv_rotation, bGPDstroke::uv_scale, and bGPDstroke::uv_translation.
Referenced by BKE_gpencil_stroke_fill_triangulate().
|
static |
Definition at line 1503 of file gpencil_geom_legacy.cc.
References copy_v4_v4(), bGPDstroke::dvert, MDeformVert::dw, bGPDspoint::flag, MEM_callocN, MEM_dupallocN, MEM_reallocN, bGPDstroke::points, bGPDspoint::pressure, bGPDspoint::strength, bGPDspoint::time, bGPDstroke::totpoints, MDeformVert::totweight, bGPDspoint::vert_color, bGPDspoint::x, bGPDspoint::y, and bGPDspoint::z.
Referenced by BKE_gpencil_stroke_join().
|
static |
Definition at line 1245 of file gpencil_geom_legacy.cc.
References BKE_gpencil_free_stroke(), BKE_gpencil_stroke_duplicate(), BKE_gpencil_stroke_geometry_update(), BLI_addhead(), BLI_remlink(), copy_v3_v3(), copy_v4_v4(), bGPDstroke::dvert, MDeformVert::dw, bGPDspoint::flag, bGPDstroke::flag, MEM_callocN, MEM_dupallocN, bGPDstroke::points, bGPDspoint::pressure, bGPDspoint::strength, bGPDframe::strokes, bGPDspoint::time, bGPDstroke::totpoints, bGPDspoint::vert_color, and bGPDspoint::x.
Referenced by BKE_gpencil_stroke_delete_tagged_points().