Blender  V3.3
Functions | Variables
mask.c File Reference
#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.

Functions

static void mask_copy_data (Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
 
static void mask_free_data (ID *id)
 
static void mask_foreach_id (ID *id, LibraryForeachIDData *data)
 
static void mask_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static void mask_blend_read_data (BlendDataReader *reader, ID *id)
 
static void lib_link_mask_parent (BlendLibReader *reader, Mask *mask, MaskParent *parent)
 
static void mask_blend_read_lib (BlendLibReader *reader, ID *id)
 
static void expand_mask_parent (BlendExpander *expander, MaskParent *parent)
 
static void mask_blend_read_expand (BlendExpander *expander, ID *id)
 
static MaskSplinePointmask_spline_point_next (MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
 
static MaskSplinePointmask_spline_point_prev (MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
 
BezTripleBKE_mask_spline_point_next_bezt (MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
 
MaskSplinePointBKE_mask_spline_point_array (MaskSpline *spline)
 
MaskSplinePointBKE_mask_spline_point_array_from_point (MaskSpline *spline, const MaskSplinePoint *point_ref)
 
MaskLayerBKE_mask_layer_new (Mask *mask, const char *name)
 
MaskLayerBKE_mask_layer_active (Mask *mask)
 
void BKE_mask_layer_active_set (Mask *mask, MaskLayer *masklay)
 
void BKE_mask_layer_remove (Mask *mask, MaskLayer *masklay)
 
void BKE_mask_layer_unique_name (Mask *mask, MaskLayer *masklay)
 
void BKE_mask_layer_rename (Mask *mask, MaskLayer *masklay, char *oldname, char *newname)
 
MaskLayerBKE_mask_layer_copy (const MaskLayer *masklay)
 
void BKE_mask_layer_copy_list (ListBase *masklayers_new, const ListBase *masklayers)
 
MaskSplineBKE_mask_spline_add (MaskLayer *masklay)
 
bool BKE_mask_spline_remove (MaskLayer *mask_layer, MaskSpline *spline)
 
void BKE_mask_point_direction_switch (MaskSplinePoint *point)
 
void BKE_mask_spline_direction_switch (MaskLayer *masklay, MaskSpline *spline)
 
float BKE_mask_spline_project_co (MaskSpline *spline, MaskSplinePoint *point, float start_u, const float co[2], const eMaskSign sign)
 
eMaskhandleMode BKE_mask_point_handles_mode_get (const MaskSplinePoint *point)
 
void BKE_mask_point_handle (const MaskSplinePoint *point, eMaskWhichHandle which_handle, float r_handle[2])
 
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])
 
void BKE_mask_point_segment_co (MaskSpline *spline, MaskSplinePoint *point, float u, float co[2])
 
BLI_INLINE void orthogonal_direction_get (const float vec[2], float result[2])
 
void BKE_mask_point_normal (MaskSpline *spline, MaskSplinePoint *point, float u, float n[2])
 
static float mask_point_interp_weight (BezTriple *bezt, BezTriple *bezt_next, const float u)
 
float BKE_mask_point_weight_scalar (MaskSpline *spline, MaskSplinePoint *point, const float u)
 
float BKE_mask_point_weight (MaskSpline *spline, MaskSplinePoint *point, const float u)
 
MaskSplinePointUWBKE_mask_point_sort_uw (MaskSplinePoint *point, MaskSplinePointUW *uw)
 
void BKE_mask_point_add_uw (MaskSplinePoint *point, float u, float w)
 
void BKE_mask_point_select_set (MaskSplinePoint *point, const bool do_select)
 
void BKE_mask_point_select_set_handle (MaskSplinePoint *point, const eMaskWhichHandle which_handle, const bool do_select)
 
static Maskmask_alloc (Main *bmain, const char *name)
 
MaskBKE_mask_new (Main *bmain, const char *name)
 
void BKE_mask_point_free (MaskSplinePoint *point)
 
void BKE_mask_spline_free (MaskSpline *spline)
 
void BKE_mask_spline_free_list (ListBase *splines)
 
static MaskSplinePointmask_spline_points_copy (const MaskSplinePoint *points, int tot_point)
 
MaskSplineBKE_mask_spline_copy (const MaskSpline *spline)
 
MaskLayerShapeBKE_mask_layer_shape_alloc (MaskLayer *masklay, const int frame)
 
void BKE_mask_layer_shape_free (MaskLayerShape *masklay_shape)
 
void BKE_mask_layer_free_shapes (MaskLayer *masklay)
 Free all animation keys for a mask layer. More...
 
void BKE_mask_layer_free (MaskLayer *masklay)
 
void BKE_mask_layer_free_list (ListBase *masklayers)
 
void BKE_mask_coord_from_frame (float r_co[2], const float co[2], const float frame_size[2])
 
void BKE_mask_coord_from_movieclip (MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
 
void BKE_mask_coord_from_image (Image *image, ImageUser *iuser, float r_co[2], const float co[2])
 
void BKE_mask_coord_to_frame (float r_co[2], const float co[2], const float frame_size[2])
 
void BKE_mask_coord_to_movieclip (MovieClip *clip, MovieClipUser *user, float r_co[2], const float co[2])
 
void BKE_mask_coord_to_image (Image *image, ImageUser *iuser, float r_co[2], const float co[2])
 
void BKE_mask_point_parent_matrix_get (MaskSplinePoint *point, float ctime, float parent_matrix[3][3])
 
static void mask_calc_point_handle (MaskSplinePoint *point, MaskSplinePoint *point_prev, MaskSplinePoint *point_next)
 
void BKE_mask_get_handle_point_adjacent (MaskSpline *spline, MaskSplinePoint *point, MaskSplinePoint **r_point_prev, MaskSplinePoint **r_point_next)
 
void BKE_mask_calc_tangent_polyline (MaskSpline *spline, MaskSplinePoint *point, float t[2])
 
void BKE_mask_calc_handle_point (MaskSpline *spline, MaskSplinePoint *point)
 
void BKE_mask_calc_handle_adjacent_interp (MaskSpline *spline, MaskSplinePoint *point, const float u)
 
void BKE_mask_calc_handle_point_auto (MaskSpline *spline, MaskSplinePoint *point, const bool do_recalc_length)
 Resets auto handles even for non-auto bezier points. More...
 
void BKE_mask_layer_calc_handles (MaskLayer *masklay)
 
void BKE_mask_spline_ensure_deform (MaskSpline *spline)
 
void BKE_mask_layer_evaluate (MaskLayer *masklay, const float ctime, const bool do_newframe)
 
void BKE_mask_evaluate (Mask *mask, const float ctime, const bool do_newframe)
 
void BKE_mask_parent_init (MaskParent *parent)
 
int BKE_mask_layer_shape_totvert (MaskLayer *masklay)
 
static void mask_layer_shape_from_mask_point (BezTriple *bezt, float fp[MASK_OBJECT_SHAPE_ELEM_SIZE])
 
static void mask_layer_shape_to_mask_point (BezTriple *bezt, const float fp[MASK_OBJECT_SHAPE_ELEM_SIZE])
 
void BKE_mask_layer_shape_from_mask (MaskLayer *masklay, MaskLayerShape *masklay_shape)
 
void BKE_mask_layer_shape_to_mask (MaskLayer *masklay, MaskLayerShape *masklay_shape)
 
BLI_INLINE void interp_v2_v2v2_flfl (float target[2], const float a[2], const float b[2], const float t, const float s)
 
void BKE_mask_layer_shape_to_mask_interp (MaskLayer *masklay, MaskLayerShape *masklay_shape_a, MaskLayerShape *masklay_shape_b, const float fac)
 
MaskLayerShapeBKE_mask_layer_shape_find_frame (MaskLayer *masklay, const int frame)
 
int BKE_mask_layer_shape_find_frame_range (MaskLayer *masklay, const float frame, MaskLayerShape **r_masklay_shape_a, MaskLayerShape **r_masklay_shape_b)
 
MaskLayerShapeBKE_mask_layer_shape_verify_frame (MaskLayer *masklay, const int frame)
 
MaskLayerShapeBKE_mask_layer_shape_duplicate (MaskLayerShape *masklay_shape)
 
void BKE_mask_layer_shape_unlink (MaskLayer *masklay, MaskLayerShape *masklay_shape)
 
static int mask_layer_shape_sort_cb (const void *masklay_shape_a_ptr, const void *masklay_shape_b_ptr)
 
void BKE_mask_layer_shape_sort (MaskLayer *masklay)
 
bool BKE_mask_layer_shape_spline_from_index (MaskLayer *masklay, int index, MaskSpline **r_masklay_shape, int *r_index)
 
int BKE_mask_layer_shape_spline_to_index (MaskLayer *masklay, MaskSpline *spline)
 
static void interp_weights_uv_v2_calc (float r_uv[2], const float pt[2], const float pt_a[2], const float pt_b[2])
 
static void interp_weights_uv_v2_apply (const float uv[2], float r_pt[2], const float pt_a[2], const float pt_b[2])
 
void BKE_mask_layer_shape_changed_add (MaskLayer *masklay, int index, bool do_init, bool do_init_interpolate)
 
void BKE_mask_layer_shape_changed_remove (MaskLayer *masklay, int index, int count)
 
int BKE_mask_get_duration (Mask *mask)
 
static void mask_clipboard_free_ex (bool final_free)
 
void BKE_mask_clipboard_free (void)
 
void BKE_mask_clipboard_copy_from_layer (MaskLayer *mask_layer)
 
bool BKE_mask_clipboard_is_empty (void)
 
void BKE_mask_clipboard_paste_to_layer (Main *bmain, MaskLayer *mask_layer)
 

Variables

static CLG_LogRef LOG = {"bke.mask"}
 
IDTypeInfo IDType_ID_MSK
 
struct {
   ListBase   splines
 
   struct GHash *   id_hash
 
mask_clipboard = {{NULL}}
 

Function Documentation

◆ BKE_mask_calc_handle_adjacent_interp()

void BKE_mask_calc_handle_adjacent_interp ( MaskSpline spline,
MaskSplinePoint point,
const float  u 
)

◆ BKE_mask_calc_handle_point()

void BKE_mask_calc_handle_point ( MaskSpline spline,
MaskSplinePoint point 
)

◆ BKE_mask_calc_handle_point_auto()

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().

◆ BKE_mask_calc_tangent_polyline()

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().

◆ BKE_mask_clipboard_copy_from_layer()

void BKE_mask_clipboard_copy_from_layer ( struct MaskLayer mask_layer)

◆ BKE_mask_clipboard_free()

void BKE_mask_clipboard_free ( void  )

Free the clipboard.

Definition at line 2049 of file mask.c.

References mask_clipboard_free_ex().

Referenced by WM_exit_ex().

◆ BKE_mask_clipboard_is_empty()

bool BKE_mask_clipboard_is_empty ( void  )

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().

◆ BKE_mask_clipboard_paste_to_layer()

void BKE_mask_clipboard_paste_to_layer ( struct Main bmain,
struct MaskLayer mask_layer 
)

◆ BKE_mask_coord_from_frame()

void BKE_mask_coord_from_frame ( float  r_co[2],
const float  co[2],
const float  frame_size[2] 
)

◆ BKE_mask_coord_from_image()

void BKE_mask_coord_from_image ( Image image,
ImageUser iuser,
float  r_co[2],
const float  co[2] 
)

◆ BKE_mask_coord_from_movieclip()

void BKE_mask_coord_from_movieclip ( MovieClip clip,
MovieClipUser user,
float  r_co[2],
const float  co[2] 
)

◆ BKE_mask_coord_to_frame()

void BKE_mask_coord_to_frame ( float  r_co[2],
const float  co[2],
const float  frame_size[2] 
)

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().

◆ BKE_mask_coord_to_image()

void BKE_mask_coord_to_image ( Image image,
ImageUser iuser,
float  r_co[2],
const float  co[2] 
)

◆ BKE_mask_coord_to_movieclip()

void BKE_mask_coord_to_movieclip ( MovieClip clip,
MovieClipUser user,
float  r_co[2],
const float  co[2] 
)

◆ BKE_mask_evaluate()

void BKE_mask_evaluate ( Mask mask,
const float  ctime,
const bool  do_newframe 
)

◆ BKE_mask_get_duration()

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().

◆ BKE_mask_get_handle_point_adjacent()

void BKE_mask_get_handle_point_adjacent ( MaskSpline spline,
MaskSplinePoint point,
MaskSplinePoint **  r_point_prev,
MaskSplinePoint **  r_point_next 
)

◆ BKE_mask_layer_active()

MaskLayer* BKE_mask_layer_active ( struct Mask mask)

◆ BKE_mask_layer_active_set()

void BKE_mask_layer_active_set ( Mask mask,
MaskLayer masklay 
)

Definition at line 366 of file mask.c.

References BLI_findindex(), and mask().

Referenced by mask_hide_view_set_exec().

◆ BKE_mask_layer_calc_handles()

void BKE_mask_layer_calc_handles ( MaskLayer masklay)

◆ BKE_mask_layer_copy()

MaskLayer* BKE_mask_layer_copy ( const MaskLayer masklay)

◆ BKE_mask_layer_copy_list()

void BKE_mask_layer_copy_list ( ListBase masklayers_new,
const ListBase masklayers 
)

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().

◆ BKE_mask_layer_evaluate()

void BKE_mask_layer_evaluate ( MaskLayer masklay,
const float  ctime,
const bool  do_newframe 
)

◆ BKE_mask_layer_free()

void BKE_mask_layer_free ( MaskLayer masklay)

◆ BKE_mask_layer_free_list()

void BKE_mask_layer_free_list ( ListBase masklayers)

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().

◆ BKE_mask_layer_free_shapes()

void BKE_mask_layer_free_shapes ( MaskLayer masklay)

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().

◆ BKE_mask_layer_new()

MaskLayer* BKE_mask_layer_new ( Mask mask,
const char *  name 
)

◆ BKE_mask_layer_remove()

void BKE_mask_layer_remove ( Mask mask,
MaskLayer masklay 
)

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().

◆ BKE_mask_layer_rename()

void BKE_mask_layer_rename ( Mask mask,
MaskLayer masklay,
char *  oldname,
char *  newname 
)

◆ BKE_mask_layer_shape_alloc()

MaskLayerShape* BKE_mask_layer_shape_alloc ( struct MaskLayer masklay,
int  frame 
)

◆ BKE_mask_layer_shape_changed_add()

void BKE_mask_layer_shape_changed_add ( struct MaskLayer masklay,
int  index,
bool  do_init,
bool  do_init_interpolate 
)

◆ BKE_mask_layer_shape_changed_remove()

void BKE_mask_layer_shape_changed_remove ( struct MaskLayer masklay,
int  index,
int  count 
)

◆ BKE_mask_layer_shape_duplicate()

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().

◆ BKE_mask_layer_shape_find_frame()

MaskLayerShape* BKE_mask_layer_shape_find_frame ( MaskLayer masklay,
const int  frame 
)

◆ BKE_mask_layer_shape_find_frame_range()

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().

◆ BKE_mask_layer_shape_free()

void BKE_mask_layer_shape_free ( MaskLayerShape masklay_shape)

◆ BKE_mask_layer_shape_from_mask()

void BKE_mask_layer_shape_from_mask ( struct MaskLayer masklay,
struct MaskLayerShape masklay_shape 
)

◆ BKE_mask_layer_shape_sort()

void BKE_mask_layer_shape_sort ( MaskLayer masklay)

◆ BKE_mask_layer_shape_spline_from_index()

bool BKE_mask_layer_shape_spline_from_index ( MaskLayer masklay,
int  index,
MaskSpline **  r_masklay_shape,
int *  r_index 
)

◆ BKE_mask_layer_shape_spline_to_index()

int BKE_mask_layer_shape_spline_to_index ( MaskLayer masklay,
MaskSpline spline 
)

◆ BKE_mask_layer_shape_to_mask()

void BKE_mask_layer_shape_to_mask ( struct MaskLayer masklay,
struct MaskLayerShape masklay_shape 
)

◆ BKE_mask_layer_shape_to_mask_interp()

void BKE_mask_layer_shape_to_mask_interp ( struct MaskLayer masklay,
struct MaskLayerShape masklay_shape_a,
struct MaskLayerShape masklay_shape_b,
float  fac 
)

◆ BKE_mask_layer_shape_totvert()

int BKE_mask_layer_shape_totvert ( MaskLayer masklay)

◆ BKE_mask_layer_shape_unlink()

void BKE_mask_layer_shape_unlink ( MaskLayer masklay,
MaskLayerShape masklay_shape 
)

◆ BKE_mask_layer_shape_verify_frame()

MaskLayerShape* BKE_mask_layer_shape_verify_frame ( MaskLayer masklay,
const int  frame 
)

◆ BKE_mask_layer_unique_name()

void BKE_mask_layer_unique_name ( Mask mask,
MaskLayer masklay 
)

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().

◆ BKE_mask_new()

Mask* BKE_mask_new ( Main bmain,
const char *  name 
)

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().

◆ BKE_mask_parent_init()

void BKE_mask_parent_init ( MaskParent parent)

◆ BKE_mask_point_add_uw()

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().

◆ BKE_mask_point_direction_switch()

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().

◆ BKE_mask_point_free()

void BKE_mask_point_free ( MaskSplinePoint point)

◆ BKE_mask_point_handle()

void BKE_mask_point_handle ( const MaskSplinePoint point,
eMaskWhichHandle  which_handle,
float  r_handle[2] 
)

◆ BKE_mask_point_handles_mode_get()

eMaskhandleMode BKE_mask_point_handles_mode_get ( const MaskSplinePoint point)

◆ BKE_mask_point_normal()

void BKE_mask_point_normal ( MaskSpline spline,
MaskSplinePoint point,
float  u,
float  n[2] 
)

◆ BKE_mask_point_parent_matrix_get()

void BKE_mask_point_parent_matrix_get ( MaskSplinePoint point,
float  ctime,
float  parent_matrix[3][3] 
)

◆ BKE_mask_point_segment_co()

void BKE_mask_point_segment_co ( MaskSpline spline,
MaskSplinePoint point,
float  u,
float  co[2] 
)

◆ BKE_mask_point_select_set()

void BKE_mask_point_select_set ( MaskSplinePoint point,
const bool  do_select 
)

◆ BKE_mask_point_select_set_handle()

void BKE_mask_point_select_set_handle ( MaskSplinePoint point,
const eMaskWhichHandle  which_handle,
const bool  do_select 
)

◆ BKE_mask_point_set_handle()

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] 
)

◆ BKE_mask_point_sort_uw()

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().

◆ BKE_mask_point_weight()

float BKE_mask_point_weight ( MaskSpline spline,
MaskSplinePoint point,
const float  u 
)

◆ BKE_mask_point_weight_scalar()

float BKE_mask_point_weight_scalar ( MaskSpline spline,
MaskSplinePoint point,
const float  u 
)

◆ BKE_mask_spline_add()

MaskSpline* BKE_mask_spline_add ( MaskLayer masklay)

◆ BKE_mask_spline_copy()

MaskSpline* BKE_mask_spline_copy ( const MaskSpline spline)

◆ BKE_mask_spline_direction_switch()

void BKE_mask_spline_direction_switch ( MaskLayer masklay,
MaskSpline spline 
)

◆ BKE_mask_spline_ensure_deform()

void BKE_mask_spline_ensure_deform ( MaskSpline spline)

◆ BKE_mask_spline_free()

void BKE_mask_spline_free ( MaskSpline spline)

◆ BKE_mask_spline_free_list()

void BKE_mask_spline_free_list ( ListBase splines)

◆ BKE_mask_spline_point_array()

MaskSplinePoint* BKE_mask_spline_point_array ( MaskSpline spline)

◆ BKE_mask_spline_point_array_from_point()

MaskSplinePoint* BKE_mask_spline_point_array_from_point ( MaskSpline spline,
const MaskSplinePoint point_ref 
)

◆ BKE_mask_spline_point_next_bezt()

BezTriple* BKE_mask_spline_point_next_bezt ( MaskSpline spline,
MaskSplinePoint points_array,
MaskSplinePoint point 
)

◆ BKE_mask_spline_project_co()

float BKE_mask_spline_project_co ( MaskSpline spline,
MaskSplinePoint point,
float  start_u,
const float  co[2],
const eMaskSign  sign 
)

◆ BKE_mask_spline_remove()

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.

◆ expand_mask_parent()

static void expand_mask_parent ( BlendExpander expander,
MaskParent parent 
)
static

Definition at line 212 of file mask.c.

References BLO_expand, and MaskParent::id.

Referenced by mask_blend_read_expand().

◆ interp_v2_v2v2_flfl()

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().

◆ interp_weights_uv_v2_apply()

static void interp_weights_uv_v2_apply ( const float  uv[2],
float  r_pt[2],
const float  pt_a[2],
const float  pt_b[2] 
)
static

Definition at line 1879 of file mask.c.

References madd_v2_v2v2fl().

Referenced by BKE_mask_layer_shape_changed_add().

◆ interp_weights_uv_v2_calc()

static void interp_weights_uv_v2_calc ( float  r_uv[2],
const float  pt[2],
const float  pt_a[2],
const float  pt_b[2] 
)
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().

◆ lib_link_mask_parent()

static void lib_link_mask_parent ( BlendLibReader reader,
Mask mask,
MaskParent parent 
)
static

Definition at line 186 of file mask.c.

References BLO_read_id_address, MaskParent::id, and mask().

Referenced by mask_blend_read_lib().

◆ mask_alloc()

static Mask* mask_alloc ( Main bmain,
const char *  name 
)
static

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().

◆ mask_blend_read_data()

static void mask_blend_read_data ( BlendDataReader reader,
ID id 
)
static

◆ mask_blend_read_expand()

static void mask_blend_read_expand ( BlendExpander expander,
ID id 
)
static

Definition at line 219 of file mask.c.

References expand_mask_parent(), LISTBASE_FOREACH, mask(), and point.

◆ mask_blend_read_lib()

static void mask_blend_read_lib ( BlendLibReader reader,
ID id 
)
static

◆ mask_blend_write()

static void mask_blend_write ( BlendWriter writer,
ID id,
const void id_address 
)
static

◆ mask_calc_point_handle()

static void mask_calc_point_handle ( MaskSplinePoint point,
MaskSplinePoint point_prev,
MaskSplinePoint point_next 
)
static

◆ mask_clipboard_free_ex()

static void mask_clipboard_free_ex ( bool  final_free)
static

◆ mask_copy_data()

static void mask_copy_data ( Main UNUSEDbmain,
ID id_dst,
const ID id_src,
const int   UNUSEDflag 
)
static

◆ mask_foreach_id()

static void mask_foreach_id ( ID id,
LibraryForeachIDData data 
)
static

Definition at line 72 of file mask.c.

References BKE_LIB_FOREACHID_PROCESS_ID, data, IDWALK_CB_USER, LISTBASE_FOREACH, mask(), and point.

◆ mask_free_data()

static void mask_free_data ( ID id)
static

Definition at line 64 of file mask.c.

References BKE_mask_layer_free_list(), and mask().

◆ mask_layer_shape_from_mask_point()

static void mask_layer_shape_from_mask_point ( BezTriple bezt,
float  fp[MASK_OBJECT_SHAPE_ELEM_SIZE] 
)
static

◆ mask_layer_shape_sort_cb()

static int mask_layer_shape_sort_cb ( const void masklay_shape_a_ptr,
const void masklay_shape_b_ptr 
)
static

Definition at line 1806 of file mask.c.

References MaskLayerShape::frame.

Referenced by BKE_mask_layer_shape_sort().

◆ mask_layer_shape_to_mask_point()

static void mask_layer_shape_to_mask_point ( BezTriple bezt,
const float  fp[MASK_OBJECT_SHAPE_ELEM_SIZE] 
)
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().

◆ mask_point_interp_weight()

static float mask_point_interp_weight ( BezTriple bezt,
BezTriple bezt_next,
const float  u 
)
static

Definition at line 832 of file mask.c.

References BezTriple::weight.

Referenced by BKE_mask_point_weight(), and BKE_mask_point_weight_scalar().

◆ mask_spline_point_next()

static MaskSplinePoint* mask_spline_point_next ( MaskSpline spline,
MaskSplinePoint points_array,
MaskSplinePoint point 
)
static

◆ mask_spline_point_prev()

static MaskSplinePoint* mask_spline_point_prev ( MaskSpline spline,
MaskSplinePoint points_array,
MaskSplinePoint point 
)
static

◆ mask_spline_points_copy()

static MaskSplinePoint* mask_spline_points_copy ( const MaskSplinePoint points,
int  tot_point 
)
static

Definition at line 1089 of file mask.c.

References MEM_dupallocN, and point.

Referenced by BKE_mask_spline_copy().

◆ orthogonal_direction_get()

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().

Variable Documentation

◆ id_hash

struct GHash* id_hash

Definition at line 266 of file mask.c.

◆ IDType_ID_MSK

IDTypeInfo IDType_ID_MSK
Initial value:
= {
.id_code = ID_MSK,
.id_filter = FILTER_ID_MSK,
.main_listbase_index = INDEX_ID_MSK,
.struct_size = sizeof(Mask),
.name = "Mask",
.name_plural = "masks",
.translation_context = BLT_I18NCONTEXT_ID_MASK,
.asset_type_info = NULL,
.copy_data = mask_copy_data,
.free_data = mask_free_data,
.make_local = NULL,
.foreach_id = mask_foreach_id,
.foreach_cache = NULL,
.foreach_path = NULL,
.owner_get = NULL,
.blend_write = mask_blend_write,
.blend_read_data = mask_blend_read_data,
.blend_read_lib = mask_blend_read_lib,
.blend_read_expand = mask_blend_read_expand,
.blend_read_undo_preserve = NULL,
.lib_override_apply_post = NULL,
}
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition: BKE_idtype.h:39
#define BLT_I18NCONTEXT_ID_MASK
@ INDEX_ID_MSK
Definition: DNA_ID.h:1006
#define FILTER_ID_MSK
Definition: DNA_ID.h:914
@ ID_MSK
Definition: DNA_ID_enums.h:74
struct Mask Mask
static void init_data(ModifierData *md)
static void mask_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition: mask.c:86
static void mask_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, const int UNUSED(flag))
Definition: mask.c:47
static void mask_foreach_id(ID *id, LibraryForeachIDData *data)
Definition: mask.c:72
static void mask_blend_read_data(BlendDataReader *reader, ID *id)
Definition: mask.c:134
static void mask_free_data(ID *id)
Definition: mask.c:64
static void mask_blend_read_expand(BlendExpander *expander, ID *id)
Definition: mask.c:219
static void mask_blend_read_lib(BlendLibReader *reader, ID *id)
Definition: mask.c:191

Definition at line 234 of file mask.c.

◆ LOG

CLG_LogRef LOG = {"bke.mask"}
static

◆ 

struct { ... } mask_clipboard

◆ splines

ListBase splines