Blender
V3.3
|
#include <stddef.h>
#include <string.h>
#include "CLG_log.h"
#include "MEM_guardedalloc.h"
#include "BLI_endian_switch.h"
#include "BLI_ghash.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_string.h"
#include "BLI_string_utils.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "DNA_defaults.h"
#include "DNA_mask_types.h"
#include "BKE_animsys.h"
#include "BKE_curve.h"
#include "BKE_idtype.h"
#include "BKE_anim_data.h"
#include "BKE_image.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_mask.h"
#include "BKE_movieclip.h"
#include "BKE_tracking.h"
#include "DEG_depsgraph_build.h"
#include "BLO_read_write.h"
Go to the source code of this file.
Variables | |
static CLG_LogRef | LOG = {"bke.mask"} |
IDTypeInfo | IDType_ID_MSK |
struct { | |
ListBase splines | |
struct GHash * id_hash | |
} | mask_clipboard = {{NULL}} |
void BKE_mask_calc_handle_adjacent_interp | ( | MaskSpline * | spline, |
MaskSplinePoint * | point, | ||
const float | u | ||
) |
Definition at line 1449 of file mask.c.
References MaskSplinePoint::bezt, BKE_mask_get_handle_point_adjacent(), BLI_assert, dist_ensure_v2_v2fl(), float(), len_v2v2(), point, BezTriple::vec, and BezTriple::weight.
Referenced by setup_vertex_point().
void BKE_mask_calc_handle_point | ( | MaskSpline * | spline, |
MaskSplinePoint * | point | ||
) |
Definition at line 1440 of file mask.c.
References BKE_mask_get_handle_point_adjacent(), mask_calc_point_handle(), and point.
Referenced by BKE_mask_layer_calc_handles(), and BKE_mask_layer_evaluate_deform().
void BKE_mask_calc_handle_point_auto | ( | struct MaskSpline * | spline, |
struct MaskSplinePoint * | point, | ||
bool | do_recalc_length | ||
) |
Resets auto handles even for non-auto bezier points.
Useful for giving sane defaults.
Definition at line 1495 of file mask.c.
References BKE_mask_get_handle_point_adjacent(), dist_ensure_v2_v2fl(), HD_AUTO, len_v3v3(), mask_calc_point_handle(), and point.
Referenced by add_vertex_handle_cyclic_at_point(), and mask_normals_make_consistent_exec().
void BKE_mask_calc_tangent_polyline | ( | struct MaskSpline * | spline, |
struct MaskSplinePoint * | point, | ||
float | t[2] | ||
) |
Calculates the tangent of a point by its previous and next (ignoring handles - as if its a poly line).
Definition at line 1412 of file mask.c.
References add_v2_v2v2(), MaskSplinePoint::bezt, BKE_mask_get_handle_point_adjacent(), normalize_v2(), point, sub_v2_v2v2(), t, BezTriple::vec, and zero_v2().
Referenced by add_vertex_extrude().
Copy selected visible splines from the given layer to clipboard.
Definition at line 2054 of file mask.c.
References BKE_mask_spline_copy(), BLI_addtail(), BLI_ghash_insert(), BLI_ghash_lookup(), BLI_ghash_ptr_new(), ListBase::first, MaskSpline::flag, len, mask_clipboard, mask_clipboard_free_ex(), MASK_HIDE_SELECT, MEM_mallocN, MaskSpline::next, NULL, point, MaskSpline::points, SELECT, MaskLayer::splines, MaskSpline::tot_point, and MaskLayer::visibility_flag.
Referenced by copy_splines_exec().
Free the clipboard.
Definition at line 2049 of file mask.c.
References mask_clipboard_free_ex().
Referenced by WM_exit_ex().
Check clipboard is empty.
Definition at line 2088 of file mask.c.
References BLI_listbase_is_empty(), and mask_clipboard.
Referenced by paste_splines_poll().
Paste the contents of clipboard to given mask layer.
Definition at line 2093 of file mask.c.
References BKE_mask_spline_copy(), BLI_addtail(), BLI_assert, BLI_findstring(), BLI_ghash_lookup(), GS, id_name(), mask_clipboard, MaskSpline::next, NULL, point, MaskSpline::points, MaskLayer::splines, MaskSpline::tot_point, and which_libbase().
Referenced by paste_splines_exec().
Definition at line 1184 of file mask.c.
Referenced by BKE_mask_coord_from_image(), BKE_mask_coord_from_movieclip(), and create_primitive_from_points().
void BKE_mask_coord_from_image | ( | Image * | image, |
ImageUser * | iuser, | ||
float | r_co[2], | ||
const float | co[2] | ||
) |
Definition at line 1217 of file mask.c.
References BKE_image_get_aspect(), BKE_image_get_size_fl(), BKE_mask_coord_from_frame(), and image().
Referenced by calculateCenterCursor2D(), ED_mask_mouse_pos(), and ED_mask_point_pos().
void BKE_mask_coord_from_movieclip | ( | MovieClip * | clip, |
MovieClipUser * | user, | ||
float | r_co[2], | ||
const float | co[2] | ||
) |
Definition at line 1200 of file mask.c.
References BKE_mask_coord_from_frame(), BKE_movieclip_get_aspect(), and BKE_movieclip_get_size_fl().
Referenced by BKE_mask_point_parent_matrix_get(), calculateCenterCursor2D(), ED_mask_mouse_pos(), ED_mask_point_pos(), mask_parent_set_exec(), and mask_point_undistort_pos().
Inverse of BKE_mask_coord_from_image.
Definition at line 1230 of file mask.c.
Referenced by BKE_mask_coord_to_image(), and BKE_mask_coord_to_movieclip().
Definition at line 1263 of file mask.c.
References BKE_image_get_aspect(), BKE_image_get_size_fl(), BKE_mask_coord_to_frame(), and image().
Referenced by ED_mask_point_pos__reverse(), and projectIntViewEx().
void BKE_mask_coord_to_movieclip | ( | MovieClip * | clip, |
MovieClipUser * | user, | ||
float | r_co[2], | ||
const float | co[2] | ||
) |
Definition at line 1246 of file mask.c.
References BKE_mask_coord_to_frame(), BKE_movieclip_get_aspect(), and BKE_movieclip_get_size_fl().
Referenced by ED_mask_point_pos__reverse(), mask_point_undistort_pos(), projectIntViewEx(), and selected_boundbox().
Definition at line 1568 of file mask.c.
References BKE_mask_layer_evaluate(), mask(), and MaskLayer::next.
Referenced by blender::compositor::MaskOperation::init_execution(), and seq_render_mask().
int BKE_mask_get_duration | ( | Mask * | mask | ) |
Definition at line 2028 of file mask.c.
References mask(), and max_ii().
Referenced by SEQ_add_mask_strip(), and SEQ_add_reload_new_file().
void BKE_mask_get_handle_point_adjacent | ( | MaskSpline * | spline, |
MaskSplinePoint * | point, | ||
MaskSplinePoint ** | r_point_prev, | ||
MaskSplinePoint ** | r_point_next | ||
) |
Definition at line 1400 of file mask.c.
References BKE_mask_spline_point_array_from_point(), mask_spline_point_next(), mask_spline_point_prev(), and point.
Referenced by BKE_mask_calc_handle_adjacent_interp(), BKE_mask_calc_handle_point(), BKE_mask_calc_handle_point_auto(), BKE_mask_calc_tangent_polyline(), and BKE_mask_point_normal().
Definition at line 361 of file mask.c.
References BLI_findlink(), and mask().
Referenced by add_vertex_exec(), animdata_filter_mask_data(), copy_splines_exec(), ED_mask_draw_frames(), ED_mask_layer_ensure(), find_prev_next_keyframes(), keyframe_jump_exec(), mask_hide_view_set_exec(), mask_layer_remove_exec(), and paste_splines_exec().
Definition at line 366 of file mask.c.
References BLI_findindex(), and mask().
Referenced by mask_hide_view_set_exec().
Definition at line 1523 of file mask.c.
References BKE_mask_calc_handle_point(), ListBase::first, MaskSpline::next, MaskSpline::points, MaskLayer::splines, and MaskSpline::tot_point.
Referenced by BKE_mask_layer_evaluate_deform().
Definition at line 403 of file mask.c.
References MaskLayer::act_point, MaskLayer::act_spline, MaskLayer::alpha, BKE_mask_spline_copy(), MaskLayer::blend, MaskLayer::blend_flag, BLI_addtail(), BLI_strncpy(), MaskLayerShape::data, MaskLayer::falloff, ListBase::first, MaskLayerShape::flag, MaskLayer::flag, MaskLayerShape::frame, MEM_callocN, MEM_dupallocN, MaskLayer::name, MaskSpline::next, MaskLayerShape::next, point_index, MaskSpline::points, MaskLayer::splines, MaskLayer::splines_shapes, MaskSpline::tot_point, MaskLayerShape::tot_vert, and MaskLayer::visibility_flag.
Referenced by BKE_mask_layer_copy_list().
Definition at line 456 of file mask.c.
References BKE_mask_layer_copy(), BLI_addtail(), ListBase::first, and MaskLayer::next.
Referenced by mask_copy_data().
Definition at line 1558 of file mask.c.
References BKE_mask_layer_evaluate_animation(), and BKE_mask_layer_evaluate_deform().
Referenced by BKE_mask_evaluate(), and mask_shape_key_rekey_exec().
Definition at line 1159 of file mask.c.
References BKE_mask_layer_free_shapes(), BKE_mask_spline_free_list(), MEM_freeN, and MaskLayer::splines.
Referenced by BKE_mask_layer_free_list(), and BKE_mask_layer_remove().
Definition at line 1170 of file mask.c.
References BKE_mask_layer_free(), BLI_remlink(), ListBase::first, and MaskLayer::next.
Referenced by mask_free_data().
Free all animation keys for a mask layer.
Definition at line 1143 of file mask.c.
References BKE_mask_layer_shape_free(), BLI_remlink(), ListBase::first, MaskLayerShape::next, and MaskLayer::splines_shapes.
Referenced by BKE_mask_layer_free(), and delete_exec().
Definition at line 337 of file mask.c.
References MaskLayer::alpha, BKE_mask_layer_unique_name(), MaskLayer::blend, BLI_addtail(), BLI_strncpy(), MaskLayer::flag, mask(), MASK_BLEND_MERGE_ADD, MASK_LAYERFLAG_FILL_DISCRETE, MASK_LAYERFLAG_FILL_OVERLAP, MEM_callocN, and MaskLayer::name.
Referenced by add_vertex_new(), ED_mask_layer_ensure(), mask_layer_new_exec(), and paste_splines_exec().
Definition at line 371 of file mask.c.
References BKE_mask_layer_free(), BLI_remlink(), and mask().
Referenced by animchannels_delete_exec(), and mask_layer_remove_exec().
Definition at line 393 of file mask.c.
References BKE_animdata_fix_paths_rename_all(), BKE_mask_layer_unique_name(), BLI_strncpy(), mask(), and MaskLayer::name.
MaskLayerShape* BKE_mask_layer_shape_alloc | ( | struct MaskLayer * | masklay, |
int | frame | ||
) |
Definition at line 1120 of file mask.c.
References BKE_mask_layer_shape_totvert(), MaskLayerShape::data, MaskLayerShape::frame, MASK_OBJECT_SHAPE_ELEM_SIZE, MEM_mallocN, and MaskLayerShape::tot_vert.
Referenced by BKE_mask_layer_shape_verify_frame(), and mask_shape_key_feather_reset_exec().
void BKE_mask_layer_shape_changed_add | ( | struct MaskLayer * | masklay, |
int | index, | ||
bool | do_init, | ||
bool | do_init_interpolate | ||
) |
When a new points added, resizing all shape-key arrays.
Definition at line 1894 of file mask.c.
References MaskSplinePoint::bezt, BKE_mask_layer_shape_spline_from_index(), BKE_mask_layer_shape_totvert(), CLOG_ERROR, MaskLayerShape::data, ListBase::first, MaskLayerShape::frame, if(), interp_weights_uv_v2_apply(), interp_weights_uv_v2_calc(), LOG, mask_layer_shape_from_mask_point(), MASK_OBJECT_SHAPE_ELEM_SIZE, MEM_freeN, MEM_mallocN, MaskLayerShape::next, MaskSpline::points, MaskLayer::splines_shapes, MaskSpline::tot_point, MaskLayerShape::tot_vert, and BezTriple::vec.
Referenced by add_vertex_extrude(), add_vertex_new(), add_vertex_subdivide(), create_primitive_from_points(), and mask_duplicate_exec().
Move array elements to account for removed point.
Definition at line 1988 of file mask.c.
References BKE_mask_layer_shape_totvert(), CLOG_ERROR, count, MaskLayerShape::data, ListBase::first, MaskLayerShape::frame, LOG, MASK_OBJECT_SHAPE_ELEM_SIZE, MEM_freeN, MEM_mallocN, MaskLayerShape::next, MaskLayer::splines_shapes, and MaskLayerShape::tot_vert.
Referenced by delete_exec().
MaskLayerShape* BKE_mask_layer_shape_duplicate | ( | MaskLayerShape * | masklay_shape | ) |
Definition at line 1786 of file mask.c.
References MaskLayerShape::data, LIKELY, and MEM_dupallocN.
Referenced by ED_masklayer_frames_duplicate().
MaskLayerShape* BKE_mask_layer_shape_find_frame | ( | MaskLayer * | masklay, |
const int | frame | ||
) |
Definition at line 1715 of file mask.c.
References ListBase::first, MaskLayerShape::frame, MaskLayerShape::next, NULL, and MaskLayer::splines_shapes.
Referenced by BKE_mask_layer_shape_verify_frame(), ED_mask_select_frame(), mask_shape_key_clear_exec(), and mask_shape_key_rekey_exec().
int BKE_mask_layer_shape_find_frame_range | ( | struct MaskLayer * | masklay, |
float | frame, | ||
struct MaskLayerShape ** | r_masklay_shape_a, | ||
struct MaskLayerShape ** | r_masklay_shape_b | ||
) |
When returning 2 - the frame isn't found but before/after frames are.
Definition at line 1732 of file mask.c.
References ListBase::first, MaskLayerShape::frame, ListBase::last, MaskLayerShape::next, NULL, MaskLayerShape::prev, and MaskLayer::splines_shapes.
Referenced by BKE_mask_layer_evaluate_animation().
void BKE_mask_layer_shape_free | ( | MaskLayerShape * | masklay_shape | ) |
Definition at line 1134 of file mask.c.
References MaskLayerShape::data, and MEM_freeN.
Referenced by BKE_mask_layer_free_shapes(), BKE_mask_layer_shape_unlink(), mask_shape_key_feather_reset_exec(), and mask_shape_key_rekey_exec().
void BKE_mask_layer_shape_from_mask | ( | struct MaskLayer * | masklay, |
struct MaskLayerShape * | masklay_shape | ||
) |
Inverse of BKE_mask_layer_shape_to_mask
Definition at line 1617 of file mask.c.
References MaskSplinePoint::bezt, BKE_mask_layer_shape_totvert(), CLOG_ERROR, MaskLayerShape::data, ListBase::first, MaskLayerShape::frame, LOG, mask_layer_shape_from_mask_point(), MASK_OBJECT_SHAPE_ELEM_SIZE, MaskSpline::next, MaskSpline::points, MaskLayer::splines, MaskSpline::tot_point, and MaskLayerShape::tot_vert.
Referenced by ED_mask_layer_shape_auto_key(), blender::compositor::MaskOperation::init_execution(), mask_shape_key_feather_reset_exec(), mask_shape_key_insert_exec(), and mask_shape_key_rekey_exec().
Definition at line 1822 of file mask.c.
References BLI_listbase_sort(), mask_layer_shape_sort_cb(), and MaskLayer::splines_shapes.
Referenced by BKE_mask_layer_shape_verify_frame().
bool BKE_mask_layer_shape_spline_from_index | ( | MaskLayer * | masklay, |
int | index, | ||
MaskSpline ** | r_masklay_shape, | ||
int * | r_index | ||
) |
Definition at line 1827 of file mask.c.
References ListBase::first, MaskSpline::next, MaskLayer::splines, and MaskSpline::tot_point.
Referenced by BKE_mask_layer_shape_changed_add().
int BKE_mask_layer_shape_spline_to_index | ( | MaskLayer * | masklay, |
MaskSpline * | spline | ||
) |
Definition at line 1846 of file mask.c.
References ListBase::first, MaskSpline::next, MaskLayer::splines, and MaskSpline::tot_point.
Referenced by add_vertex_extrude(), add_vertex_new(), add_vertex_subdivide(), BKE_mask_spline_direction_switch(), create_primitive_from_points(), and mask_duplicate_exec().
void BKE_mask_layer_shape_to_mask | ( | struct MaskLayer * | masklay, |
struct MaskLayerShape * | masklay_shape | ||
) |
Inverse of BKE_mask_layer_shape_from_mask
Definition at line 1641 of file mask.c.
References MaskSplinePoint::bezt, BKE_mask_layer_shape_totvert(), CLOG_ERROR, MaskLayerShape::data, ListBase::first, MaskLayerShape::frame, LOG, mask_layer_shape_to_mask_point(), MASK_OBJECT_SHAPE_ELEM_SIZE, MaskSpline::next, MaskSpline::points, MaskLayer::splines, MaskSpline::tot_point, and MaskLayerShape::tot_vert.
Referenced by BKE_mask_layer_evaluate_animation().
void BKE_mask_layer_shape_to_mask_interp | ( | struct MaskLayer * | masklay, |
struct MaskLayerShape * | masklay_shape_a, | ||
struct MaskLayerShape * | masklay_shape_b, | ||
float | fac | ||
) |
Definition at line 1672 of file mask.c.
References MaskSplinePoint::bezt, BKE_mask_layer_shape_totvert(), CLOG_ERROR, MaskLayerShape::data, ListBase::first, MaskLayerShape::frame, interp_v2_v2v2_flfl(), LOG, MaskSpline::next, MaskSpline::points, BezTriple::radius, MaskLayer::splines, MaskSpline::tot_point, MaskLayerShape::tot_vert, BezTriple::vec, and BezTriple::weight.
Referenced by BKE_mask_layer_evaluate_animation().
int BKE_mask_layer_shape_totvert | ( | MaskLayer * | masklay | ) |
Definition at line 1585 of file mask.c.
References ListBase::first, MaskSpline::next, MaskLayer::splines, and MaskSpline::tot_point.
Referenced by BKE_mask_layer_shape_alloc(), BKE_mask_layer_shape_changed_add(), BKE_mask_layer_shape_changed_remove(), BKE_mask_layer_shape_from_mask(), BKE_mask_layer_shape_to_mask(), and BKE_mask_layer_shape_to_mask_interp().
void BKE_mask_layer_shape_unlink | ( | MaskLayer * | masklay, |
MaskLayerShape * | masklay_shape | ||
) |
Definition at line 1799 of file mask.c.
References BKE_mask_layer_shape_free(), BLI_remlink(), and MaskLayer::splines_shapes.
Referenced by ED_masklayer_frames_delete(), mask_shape_key_clear_exec(), and posttrans_mask_clean().
MaskLayerShape* BKE_mask_layer_shape_verify_frame | ( | MaskLayer * | masklay, |
const int | frame | ||
) |
Definition at line 1771 of file mask.c.
References BKE_mask_layer_shape_alloc(), BKE_mask_layer_shape_find_frame(), BKE_mask_layer_shape_sort(), BLI_addtail(), NULL, and MaskLayer::splines_shapes.
Referenced by ED_mask_layer_shape_auto_key(), blender::compositor::MaskOperation::init_execution(), mask_shape_key_insert_exec(), and mask_shape_key_rekey_exec().
Definition at line 383 of file mask.c.
References BLI_uniquename(), DATA_, mask(), and MaskLayer::name.
Referenced by BKE_mask_layer_new(), and BKE_mask_layer_rename().
Definition at line 1022 of file mask.c.
References BLI_strncpy(), DEG_relations_tag_update(), mask(), mask_alloc(), and MAX_ID_NAME.
Referenced by ED_mask_new().
void BKE_mask_parent_init | ( | MaskParent * | parent | ) |
Definition at line 1577 of file mask.c.
References ID_MC, and MaskParent::id_type.
Referenced by BKE_mask_spline_add(), blo_do_versions_270(), create_primitive_from_points(), and setup_vertex_point().
void BKE_mask_point_add_uw | ( | MaskSplinePoint * | point, |
float | u, | ||
float | w | ||
) |
Definition at line 937 of file mask.c.
References BKE_mask_point_sort_uw(), MEM_mallocN, MEM_reallocN, point, and w().
Referenced by add_feather_vertex_exec().
void BKE_mask_point_direction_switch | ( | MaskSplinePoint * | point | ) |
Definition at line 504 of file mask.c.
References copy_v2_v2(), point, SWAP, and MaskSplinePointUW::u.
Referenced by BKE_mask_spline_direction_switch().
void BKE_mask_point_free | ( | MaskSplinePoint * | point | ) |
Definition at line 1045 of file mask.c.
References MEM_freeN, and point.
Referenced by BKE_mask_layer_evaluate_deform(), BKE_mask_spline_ensure_deform(), BKE_mask_spline_free(), and delete_exec().
void BKE_mask_point_handle | ( | const MaskSplinePoint * | point, |
eMaskWhichHandle | which_handle, | ||
float | r_handle[2] | ||
) |
Definition at line 674 of file mask.c.
References BLI_assert_msg, copy_v2_v2(), MASK_WHICH_HANDLE_LEFT, MASK_WHICH_HANDLE_RIGHT, MASK_WHICH_HANDLE_STICK, point, sub_v2_v2v2(), and BezTriple::vec.
eMaskhandleMode BKE_mask_point_handles_mode_get | ( | const MaskSplinePoint * | point | ) |
Definition at line 663 of file mask.c.
References BezTriple::h1, BezTriple::h2, HD_ALIGN, MASK_HANDLE_MODE_INDIVIDUAL_HANDLES, MASK_HANDLE_MODE_STICK, and point.
void BKE_mask_point_normal | ( | MaskSpline * | spline, |
MaskSplinePoint * | point, | ||
float | u, | ||
float | n[2] | ||
) |
Definition at line 776 of file mask.c.
References add_v2_v2v2(), BKE_mask_get_handle_point_adjacent(), BKE_mask_point_segment_co(), normalize_v2(), NULL, orthogonal_direction_get(), point, and sub_v2_v2v2().
Referenced by BKE_mask_point_segment_feather_diff(), BKE_mask_spline_feather_points(), BKE_mask_spline_project_co(), mask_spline_feather_differentiated_points_with_resolution__even(), slide_point_customdata(), and slide_point_modal().
void BKE_mask_point_parent_matrix_get | ( | MaskSplinePoint * | point, |
float | ctime, | ||
float | parent_matrix[3][3] | ||
) |
Definition at line 1277 of file mask.c.
References BKE_mask_coord_from_movieclip(), BKE_movieclip_get_aspect(), BKE_movieclip_get_size_fl(), BKE_movieclip_remap_scene_to_clip_frame(), BKE_movieclip_user_set_frame(), BKE_tracking_homography_between_two_quads(), BKE_tracking_marker_get_subframe_position(), BKE_tracking_object_get_named(), BKE_tracking_plane_marker_get_subframe_corners(), BKE_tracking_plane_track_get_named(), BKE_tracking_track_get_named(), DNA_struct_default_get, H, MaskParent::id, ID_MC, MaskParent::id_type, invert_m3_m3(), MASK_PARENT_POINT_TRACK, mul_m3_series, MaskParent::parent, MaskParent::parent_corners_orig, MaskParent::parent_orig, point, MaskParent::sub_parent, sub_v2_v2v2(), MovieClip::tracking, MaskParent::type, and unit_m3().
Referenced by mask_evaluate_apply_point_parent(), MaskPointToTransData(), and setup_vertex_point().
void BKE_mask_point_segment_co | ( | MaskSpline * | spline, |
MaskSplinePoint * | point, | ||
float | u, | ||
float | co[2] | ||
) |
Definition at line 752 of file mask.c.
References BKE_mask_spline_point_array_from_point(), BKE_mask_spline_point_next_bezt(), copy_v2_v2(), interp_v2_v2v2v2v2_cubic(), point, and BezTriple::vec.
Referenced by BKE_mask_point_normal(), BKE_mask_point_segment_feather_diff(), BKE_mask_spline_feather_points(), BKE_mask_spline_project_co(), mask_spline_feather_differentiated_points_with_resolution__double(), mask_spline_feather_differentiated_points_with_resolution__even(), slide_point_customdata(), slide_point_modal(), and slide_spline_curvature_customdata().
void BKE_mask_point_select_set | ( | MaskSplinePoint * | point, |
const bool | do_select | ||
) |
Definition at line 955 of file mask.c.
References MASKPOINT_DESEL_ALL, MASKPOINT_SEL_ALL, point, and SELECT.
Referenced by box_select_exec(), circle_select_exec(), create_primitive_from_points(), do_lasso_select_mask(), ED_mask_select_toggle_all(), ED_mask_spline_select_set(), mask_duplicate_exec(), mask_select_more_less(), select_exec(), and select_sliding_point().
void BKE_mask_point_select_set_handle | ( | MaskSplinePoint * | point, |
const eMaskWhichHandle | which_handle, | ||
const bool | do_select | ||
) |
Definition at line 974 of file mask.c.
References BLI_assert_msg, ELEM, MASK_WHICH_HANDLE_BOTH, MASK_WHICH_HANDLE_LEFT, MASK_WHICH_HANDLE_RIGHT, MASK_WHICH_HANDLE_STICK, point, and SELECT.
Referenced by box_select_exec(), circle_select_exec(), do_lasso_select_mask(), and select_exec().
void BKE_mask_point_set_handle | ( | MaskSplinePoint * | point, |
eMaskWhichHandle | which_handle, | ||
float | loc[2], | ||
bool | keep_direction, | ||
float | orig_handle[2], | ||
float | orig_vec[3][3] | ||
) |
Definition at line 699 of file mask.c.
References add_v2_v2v2(), BLI_assert_msg, copy_v2_v2(), copy_v3_v3(), dot_v2v2(), len, len_v2(), MASK_WHICH_HANDLE_LEFT, MASK_WHICH_HANDLE_RIGHT, MASK_WHICH_HANDLE_STICK, mul_v2_fl(), point, project_v2_v2v2(), sub_v2_v2v2(), v1, v2, and BezTriple::vec.
Referenced by flushTransMasking(), and slide_point_modal().
MaskSplinePointUW* BKE_mask_point_sort_uw | ( | MaskSplinePoint * | point, |
MaskSplinePointUW * | uw | ||
) |
Definition at line 912 of file mask.c.
References point, SWAP, and MaskSplinePointUW::u.
Referenced by BKE_mask_point_add_uw(), and slide_point_modal().
float BKE_mask_point_weight | ( | MaskSpline * | spline, |
MaskSplinePoint * | point, | ||
const float | u | ||
) |
Definition at line 857 of file mask.c.
References BKE_mask_spline_point_array_from_point(), BKE_mask_spline_point_next_bezt(), mask_point_interp_weight(), MASK_SPLINE_INTERP_EASE, point, BezTriple::weight, and MaskSpline::weight_interp.
Referenced by add_feather_vertex_exec(), BKE_mask_point_segment_feather_diff(), BKE_mask_spline_feather_points(), mask_spline_feather_differentiated_points_with_resolution__double(), and mask_spline_feather_differentiated_points_with_resolution__even().
float BKE_mask_point_weight_scalar | ( | MaskSpline * | spline, |
MaskSplinePoint * | point, | ||
const float | u | ||
) |
Definition at line 837 of file mask.c.
References BKE_mask_spline_point_array_from_point(), BKE_mask_spline_point_next_bezt(), mask_point_interp_weight(), point, and BezTriple::weight.
Referenced by add_feather_vertex_exec(), mask_spline_feather_differentiated_points_with_resolution__double(), slide_point_customdata(), and slide_point_modal().
MaskSpline* BKE_mask_spline_add | ( | MaskLayer * | masklay | ) |
Definition at line 469 of file mask.c.
References BKE_mask_parent_init(), BLI_addtail(), MaskSpline::flag, MASK_SPLINE_CYCLIC, MASK_SPLINE_INTERP_EASE, MEM_callocN, MaskSpline::parent, MaskSpline::points, MaskLayer::splines, MaskSpline::tot_point, and MaskSpline::weight_interp.
Referenced by add_vertex_new(), create_primitive_from_points(), and mask_duplicate_exec().
MaskSpline* BKE_mask_spline_copy | ( | const MaskSpline * | spline | ) |
Definition at line 1104 of file mask.c.
References mask_spline_points_copy(), MEM_callocN, NULL, MaskSpline::points, MaskSpline::points_deform, and MaskSpline::tot_point.
Referenced by BKE_mask_clipboard_copy_from_layer(), BKE_mask_clipboard_paste_to_layer(), and BKE_mask_layer_copy().
void BKE_mask_spline_direction_switch | ( | MaskLayer * | masklay, |
MaskSpline * | spline | ||
) |
Definition at line 535 of file mask.c.
References BKE_mask_layer_shape_spline_to_index(), BKE_mask_point_direction_switch(), MaskLayerShape::data, ListBase::first, MaskLayerShape::next, MaskSpline::points, spline_index, MaskLayer::splines_shapes, SWAP, MaskSpline::tot_point, MaskSplinePoint::tot_uw, and MaskSplinePoint::uw.
Referenced by mask_switch_direction_exec().
void BKE_mask_spline_ensure_deform | ( | MaskSpline * | spline | ) |
Definition at line 1533 of file mask.c.
References BKE_mask_point_free(), MEM_allocN_len, MEM_callocN, MEM_freeN, NULL, point, MaskSpline::points_deform, and MaskSpline::tot_point.
Referenced by BKE_mask_layer_evaluate_deform().
void BKE_mask_spline_free | ( | MaskSpline * | spline | ) |
Definition at line 1052 of file mask.c.
References BKE_mask_point_free(), MEM_freeN, point, MaskSpline::points, MaskSpline::points_deform, and MaskSpline::tot_point.
Referenced by BKE_mask_spline_free_list(), BKE_mask_spline_remove(), delete_exec(), free_slide_point_data(), and slide_point_modal().
Definition at line 1076 of file mask.c.
References BKE_mask_spline_free(), BLI_remlink(), ListBase::first, MaskSpline::next, and splines.
Referenced by BKE_mask_layer_free(), and mask_clipboard_free_ex().
MaskSplinePoint* BKE_mask_spline_point_array | ( | MaskSpline * | spline | ) |
Definition at line 314 of file mask.c.
References MaskSpline::points, and MaskSpline::points_deform.
Referenced by BKE_mask_spline_differentiate_with_resolution(), BKE_mask_spline_feather_points(), box_select_exec(), circle_select_exec(), do_lasso_select_mask(), draw_spline_points(), ED_mask_point_find_nearest(), ED_mask_selected_minmax(), mask_spline_feather_differentiated_points_with_resolution__double(), mask_spline_feather_differentiated_points_with_resolution__even(), and spline_under_mouse_get().
MaskSplinePoint* BKE_mask_spline_point_array_from_point | ( | MaskSpline * | spline, |
const MaskSplinePoint * | point_ref | ||
) |
Definition at line 319 of file mask.c.
References BLI_assert_msg, NULL, MaskSpline::points, MaskSpline::points_deform, and MaskSpline::tot_point.
Referenced by BKE_mask_get_handle_point_adjacent(), BKE_mask_point_segment_co(), BKE_mask_point_weight(), and BKE_mask_point_weight_scalar().
BezTriple* BKE_mask_spline_point_next_bezt | ( | MaskSpline * | spline, |
MaskSplinePoint * | points_array, | ||
MaskSplinePoint * | point | ||
) |
Definition at line 299 of file mask.c.
References MaskSplinePoint::bezt, MaskSpline::flag, MASK_SPLINE_CYCLIC, NULL, point, and MaskSpline::tot_point.
Referenced by BKE_mask_point_segment_co(), BKE_mask_point_segment_diff(), BKE_mask_point_weight(), BKE_mask_point_weight_scalar(), BKE_mask_spline_resolution(), and slide_spline_curvature_customdata().
float BKE_mask_spline_project_co | ( | MaskSpline * | spline, |
MaskSplinePoint * | point, | ||
float | start_u, | ||
const float | co[2], | ||
const eMaskSign | sign | ||
) |
Definition at line 583 of file mask.c.
References blender::math::abs(), angle_v2v2(), BKE_mask_point_normal(), BKE_mask_point_segment_co(), BLI_assert, dot_v2v2(), e, float(), len_squared_v2(), M_PI, M_PI_2, MASK_PROJ_ANY, MASK_PROJ_NEG, MASK_PROJ_POS, N, point, KDL::sign(), sub_v2_v2v2(), u1, u2, v1, and v2.
Referenced by ED_mask_find_nearest_diff_point(), and slide_point_modal().
bool BKE_mask_spline_remove | ( | MaskLayer * | mask_layer, |
MaskSpline * | spline | ||
) |
Definition at line 493 of file mask.c.
References BKE_mask_spline_free(), BLI_remlink_safe(), and MaskLayer::splines.
|
static |
Definition at line 212 of file mask.c.
References BLO_expand, and MaskParent::id.
Referenced by mask_blend_read_expand().
BLI_INLINE void interp_v2_v2v2_flfl | ( | float | target[2], |
const float | a[2], | ||
const float | b[2], | ||
const float | t, | ||
const float | s | ||
) |
Definition at line 1665 of file mask.c.
References Freestyle::a, usdtokens::b(), and t.
Referenced by BKE_mask_layer_shape_to_mask_interp().
|
static |
Definition at line 1879 of file mask.c.
References madd_v2_v2v2fl().
Referenced by BKE_mask_layer_shape_changed_add().
|
static |
Definition at line 1859 of file mask.c.
References closest_to_line_v2(), len_v2v2(), and line_point_side_v2().
Referenced by BKE_mask_layer_shape_changed_add().
|
static |
Definition at line 186 of file mask.c.
References BLO_read_id_address, MaskParent::id, and mask().
Referenced by mask_blend_read_lib().
Definition at line 1011 of file mask.c.
References BKE_libblock_alloc(), id_fake_user_set(), ID_MSK, and mask().
Referenced by BKE_mask_new().
|
static |
Definition at line 134 of file mask.c.
References BLI_endian_switch_float_array(), BLO_read_data_address, BLO_read_list(), BLO_read_requires_endian_switch(), LISTBASE_FOREACH, mask(), MASK_OBJECT_SHAPE_ELEM_SIZE, NULL, and point.
|
static |
Definition at line 219 of file mask.c.
References expand_mask_parent(), LISTBASE_FOREACH, mask(), and point.
|
static |
Definition at line 191 of file mask.c.
References lib_link_mask_parent(), LISTBASE_FOREACH, mask(), MaskSpline::next, MaskSpline::parent, point, MaskSpline::points, and MaskSpline::tot_point.
|
static |
Definition at line 86 of file mask.c.
References BKE_animdata_blend_write(), BKE_id_blend_write(), BLO_write_float_array(), BLO_write_id_struct, BLO_write_struct, BLO_write_struct_array, MaskLayerShape::data, ListBase::first, mask(), MASK_OBJECT_SHAPE_ELEM_SIZE, MaskSpline::next, MaskLayerShape::next, MaskLayer::next, NULL, point, MaskSpline::points, MaskSpline::points_deform, MaskLayer::splines, MaskLayer::splines_shapes, MaskSpline::tot_point, and MaskLayerShape::tot_vert.
|
static |
Definition at line 1350 of file mask.c.
References add_v3_v3v3(), MaskSplinePoint::bezt, BKE_nurb_handle_calc(), copy_v3_v3(), ELEM, HD_ALIGN, HD_ALIGN_DOUBLESIDE, HD_AUTO, HD_VECT, len_squared_v3(), NULL, point, sub_v3_v3v3(), v1, v2, and BezTriple::vec.
Referenced by BKE_mask_calc_handle_point(), and BKE_mask_calc_handle_point_auto().
Definition at line 2035 of file mask.c.
References BKE_mask_spline_free_list(), BLI_ghash_clear(), BLI_ghash_free(), BLI_listbase_clear(), mask_clipboard, MEM_freeN, and NULL.
Referenced by BKE_mask_clipboard_copy_from_layer(), and BKE_mask_clipboard_free().
|
static |
Definition at line 47 of file mask.c.
References BKE_mask_layer_copy_list(), BLI_listbase_clear(), Mask::id, id_fake_user_set(), and Mask::masklayers.
|
static |
Definition at line 72 of file mask.c.
References BKE_LIB_FOREACHID_PROCESS_ID, data, IDWALK_CB_USER, LISTBASE_FOREACH, mask(), and point.
Definition at line 64 of file mask.c.
References BKE_mask_layer_free_list(), and mask().
|
static |
Definition at line 1597 of file mask.c.
References copy_v2_v2(), BezTriple::radius, BezTriple::vec, and BezTriple::weight.
Referenced by BKE_mask_layer_shape_changed_add(), and BKE_mask_layer_shape_from_mask().
|
static |
Definition at line 1806 of file mask.c.
References MaskLayerShape::frame.
Referenced by BKE_mask_layer_shape_sort().
|
static |
Definition at line 1607 of file mask.c.
References copy_v2_v2(), BezTriple::radius, BezTriple::vec, and BezTriple::weight.
Referenced by BKE_mask_layer_shape_to_mask().
|
static |
Definition at line 832 of file mask.c.
References BezTriple::weight.
Referenced by BKE_mask_point_weight(), and BKE_mask_point_weight_scalar().
|
static |
Definition at line 269 of file mask.c.
References MaskSpline::flag, MASK_SPLINE_CYCLIC, NULL, point, and MaskSpline::tot_point.
Referenced by BKE_mask_get_handle_point_adjacent().
|
static |
Definition at line 284 of file mask.c.
References MaskSpline::flag, MASK_SPLINE_CYCLIC, NULL, point, and MaskSpline::tot_point.
Referenced by BKE_mask_get_handle_point_adjacent().
|
static |
Definition at line 1089 of file mask.c.
References MEM_dupallocN, and point.
Referenced by BKE_mask_spline_copy().
BLI_INLINE void orthogonal_direction_get | ( | const float | vec[2], |
float | result[2] | ||
) |
Definition at line 769 of file mask.c.
References normalize_v2(), and result.
Referenced by BKE_mask_point_normal().
IDTypeInfo IDType_ID_MSK |
|
static |
Definition at line 45 of file mask.c.
Referenced by BKE_mask_layer_shape_changed_add(), BKE_mask_layer_shape_changed_remove(), BKE_mask_layer_shape_from_mask(), BKE_mask_layer_shape_to_mask(), and BKE_mask_layer_shape_to_mask_interp().
struct { ... } mask_clipboard |
ListBase splines |
Definition at line 265 of file mask.c.
Referenced by BKE_mask_spline_free_list(), blender::nodes::node_geo_curve_to_points_cc::calculate_spline_point_offsets(), blender::nodes::node_geo_curve_to_points_cc::copy_evaluated_point_attributes(), blender::nodes::node_geo_curve_to_points_cc::copy_uniform_sample_point_attributes(), blender::bke::create_point_attribute(), curve_eval_from_dna_curve(), blender::bke::BuiltinPointAttributeProvider< T >::exists(), blender::bke::DynamicPointAttributeProvider::foreach_attribute(), blender::nodes::node_geo_curve_trim_cc::geometry_set_curve_trim(), blender::bke::VArrayImpl_For_BezierHandles::get_handle_spans(), blender::nodes::node_geo_curve_to_points_cc::node_geo_exec(), blender::bke::BuiltinPointAttributeProvider< T >::try_get_for_read(), blender::bke::BezierHandleAttributeProvider::try_get_for_read(), blender::bke::DynamicPointAttributeProvider::try_get_for_read(), blender::bke::BuiltinPointAttributeProvider< T >::try_get_for_write(), blender::bke::DynamicPointAttributeProvider::try_get_for_write(), and blender::bke::varray_from_initializer().