28# include <fmt/format.h>
64 if (tracking_object) {
73 float marker_pos_ofs[2], parmask_pos[2];
102 rna_Mask_update_data(bmain, scene,
ptr);
112static void rna_MaskParent_id_type_set(
PointerRNA *
ptr,
int value)
117 mpar->id_type = value;
120 if ((mpar->id) && (
GS(mpar->id->name) != mpar->id_type)) {
136 return mask->masklay_act;
139static void rna_Mask_layer_active_index_set(
PointerRNA *
ptr,
int value)
143 mask->masklay_act = value;
146static void rna_Mask_layer_active_index_range(
158static std::optional<std::string> rna_MaskLayer_path(
const PointerRNA *
ptr)
161 char name_esc[
sizeof(masklay->name) * 2];
163 return fmt::format(
"layers[\"{}\"]", name_esc);
189static void rna_MaskLayer_name_set(
PointerRNA *
ptr,
const char *value)
193 char oldname[
sizeof(masklay->
name)], newname[
sizeof(masklay->
name)];
232static void rna_MaskLayer_active_spline_point_set(
PointerRNA *
ptr,
243 if (point >= spline->
points && point < spline->points + spline->
tot_point) {
251static void rna_MaskSplinePoint_handle1_get(
PointerRNA *
ptr,
float *values)
258static void rna_MaskSplinePoint_handle1_set(
PointerRNA *
ptr,
const float *values)
265static void rna_MaskSplinePoint_handle2_get(
PointerRNA *
ptr,
float *values)
272static void rna_MaskSplinePoint_handle2_set(
PointerRNA *
ptr,
const float *values)
279static void rna_MaskSplinePoint_ctrlpoint_get(
PointerRNA *
ptr,
float *values)
286static void rna_MaskSplinePoint_ctrlpoint_set(
PointerRNA *
ptr,
const float *values)
293static int rna_MaskSplinePoint_handle_type_get(
PointerRNA *
ptr)
304 for (mask_layer =
static_cast<MaskLayer *
>(
mask->masklayers.first); mask_layer;
305 mask_layer = mask_layer->
next)
309 spline = spline->
next)
311 if (point >= spline->
points && point < spline->points + spline->
tot_point) {
329static void rna_MaskSplinePoint_handle_type_set(
PointerRNA *
ptr,
int value)
335 bezt->
h1 = bezt->
h2 = value;
336 mask_point_check_stick(point);
340static int rna_MaskSplinePoint_handle_left_type_get(
PointerRNA *
ptr)
348static void rna_MaskSplinePoint_handle_left_type_set(
PointerRNA *
ptr,
int value)
355 mask_point_check_stick(point);
359static int rna_MaskSplinePoint_handle_right_type_get(
PointerRNA *
ptr)
367static void rna_MaskSplinePoint_handle_right_type_set(
PointerRNA *
ptr,
int value)
374 mask_point_check_stick(point);
395 "Mask layer '%s' not found in mask '%s'",
407static void rna_Mask_layers_clear(
Mask *
mask)
414static void rna_MaskSplinePoint_handle_single_select_set(
PointerRNA *
ptr,
bool value)
425static bool rna_MaskSplinePoint_handle_single_select_get(
PointerRNA *
ptr)
444static void rna_MaskLayer_spline_remove(
ID *
id,
454 reports,
RPT_ERROR,
"Mask layer '%s' does not contain spline given", mask_layer->
name);
463static void rna_Mask_start_frame_set(
PointerRNA *
ptr,
int value)
475static void rna_Mask_end_frame_set(
PointerRNA *
ptr,
int value)
490 int active_point_index = -1;
491 int i, spline_shape_index;
497 for (layer =
static_cast<MaskLayer *
>(
mask->masklayers.first); layer; layer = layer->
next) {
517 if (active_point_index >= 0) {
538static void rna_MaskSpline_point_remove(
ID *
id,
547 int active_point_index = -1;
550 for (layer =
static_cast<MaskLayer *
>(
mask->masklayers.first); layer; layer = layer->
next) {
562 if (point < spline->points || point >= spline->
points + spline->
tot_point) {
571 point_index = point - spline->
points;
574 "remove mask point");
577 memcpy(new_point_array + point_index,
578 spline->
points + point_index + 1,
582 spline->
points = new_point_array;
585 if (active_point_index >= 0) {
586 if (active_point_index == point_index) {
589 else if (active_point_index < point_index) {
613 {
ID_MC,
"MOVIECLIP", ICON_SEQUENCE,
"Movie Clip",
""},
614 {0,
nullptr, 0,
nullptr,
nullptr},
620 {0,
nullptr, 0,
nullptr,
nullptr},
634 prop,
"ID",
"ID-block to which masking element would be parented to or to its property");
655 prop,
"Parent",
"Name of parent object in specified data-block to which parenting happens");
664 "Name of parent sub-object in specified data-block to which parenting happens");
676 srna,
"Mask Spline UW Point",
"Single point in spline segment defining feather");
705 {
HD_AUTO,
"AUTO", 0,
"Auto",
""},
706 {
HD_VECT,
"VECTOR", 0,
"Vector",
""},
707 {
HD_ALIGN,
"ALIGNED", 0,
"Aligned Single",
""},
709 {
HD_FREE,
"FREE", 0,
"Free",
""},
710 {0,
nullptr, 0,
nullptr,
nullptr},
717 srna,
"Mask Spline Point",
"Single point in spline used for defining mask");
723 prop,
"rna_MaskSplinePoint_handle1_get",
"rna_MaskSplinePoint_handle1_set",
nullptr);
730 prop,
"rna_MaskSplinePoint_ctrlpoint_get",
"rna_MaskSplinePoint_ctrlpoint_set",
nullptr);
737 prop,
"rna_MaskSplinePoint_handle2_get",
"rna_MaskSplinePoint_handle2_set",
nullptr);
744 prop,
"rna_MaskSplinePoint_handle_type_get",
"rna_MaskSplinePoint_handle_type_set",
nullptr);
752 "rna_MaskSplinePoint_handle_left_type_get",
753 "rna_MaskSplinePoint_handle_left_type_set",
762 "rna_MaskSplinePoint_handle_right_type_get",
763 "rna_MaskSplinePoint_handle_right_type_set",
784 "Selection status of the control point. (Deprecated: use Select Control Point instead)");
804 "rna_MaskSplinePoint_handle_single_select_get",
805 "rna_MaskSplinePoint_handle_single_select_set");
807 prop,
"Select Aligned Single Handle",
"Selection status of the Aligned Single handle");
836 parm =
RNA_def_pointer(func,
"spline",
"MaskSpline",
"",
"The newly created spline");
844 parm =
RNA_def_pointer(func,
"spline",
"MaskSpline",
"",
"The spline to remove");
852 "rna_MaskLayer_active_spline_get",
853 "rna_MaskLayer_active_spline_set",
863 "rna_MaskLayer_active_spline_point_get",
864 "rna_MaskLayer_active_spline_point_set",
886 func,
"count", 1, 0, INT_MAX,
"Number",
"Number of points to add to the spline", 0, INT_MAX);
894 parm =
RNA_def_pointer(func,
"point",
"MaskSplinePoint",
"",
"The point to remove");
904 {0,
nullptr, 0,
nullptr,
nullptr},
913 "Calculate feather offset as a second curve"},
914 {0,
nullptr, 0,
nullptr,
nullptr},
930 prop,
"Feather Offset",
"The method used for calculating the feather offset");
939 prop,
"Weight Interpolation",
"The type of weight interpolation for spline");
962 prop,
"Self Intersection Check",
"Prevent feather from self-intersections");
984 {0,
nullptr, 0,
nullptr,
nullptr},
1009 "rna_MaskLayer_splines_begin",
1010 "rna_iterator_listbase_next",
1011 "rna_iterator_listbase_end",
1012 "rna_iterator_listbase_get",
1078 prop,
"Calculate Holes",
"Calculate holes when filling overlapping curves");
1084 prop,
"Calculate Overlap",
"Calculate self intersections and overlap before filling");
1103 RNA_def_string(func,
"name",
nullptr, 0,
"Name",
"Name of new layer");
1104 parm =
RNA_def_pointer(func,
"layer",
"MaskLayer",
"",
"New mask layer");
1110 parm =
RNA_def_pointer(func,
"layer",
"MaskLayer",
"",
"Shape to be removed");
1122 prop,
"rna_Mask_layer_active_get",
"rna_Mask_layer_active_set",
nullptr,
nullptr);
1141 "rna_Mask_layers_begin",
1142 "rna_iterator_listbase_next",
1143 "rna_iterator_listbase_end",
1144 "rna_iterator_listbase_get",
1158 "rna_Mask_layer_active_index_get",
1159 "rna_Mask_layer_active_index_set",
1160 "rna_Mask_layer_active_index_range");
1162 prop,
"Active Shape Index",
"Index of active layer in list of all mask's layers");
void BKE_mask_layer_shape_changed_add(struct MaskLayer *masklay, int index, bool do_init, bool do_init_interpolate)
void BKE_mask_layer_remove(struct Mask *mask, struct MaskLayer *masklay)
bool BKE_mask_spline_remove(struct MaskLayer *mask_layer, struct MaskSpline *spline)
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.
@ MASK_WHICH_HANDLE_STICK
struct MaskSpline * BKE_mask_spline_add(struct MaskLayer *masklay)
void BKE_mask_layer_free_list(struct ListBase *masklayers)
void BKE_mask_calc_handle_point(struct MaskSpline *spline, struct MaskSplinePoint *point)
void BKE_mask_layer_active_set(struct Mask *mask, struct MaskLayer *masklay)
struct MaskLayer * BKE_mask_layer_new(struct Mask *mask, const char *name)
#define MASKPOINT_ISSEL_HANDLE(point, which_handle)
void BKE_mask_layer_rename(struct Mask *mask, struct MaskLayer *masklay, const char *oldname, const char *newname)
int BKE_mask_layer_shape_spline_to_index(struct MaskLayer *masklay, struct MaskSpline *spline)
void BKE_mask_coord_from_movieclip(struct MovieClip *clip, struct MovieClipUser *user, float r_co[2], const float co[2])
void BKE_mask_layer_shape_changed_remove(struct MaskLayer *masklay, int index, int count)
void BKE_mask_point_select_set_handle(struct MaskSplinePoint *point, eMaskWhichHandle which_handle, bool do_select)
void BKE_mask_parent_init(struct MaskParent *parent)
struct MaskLayer * BKE_mask_layer_active(struct Mask *mask)
float BKE_movieclip_remap_scene_to_clip_frame(const struct MovieClip *clip, float framenr)
void BKE_movieclip_user_set_frame(struct MovieClipUser *user, int framenr)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
struct MovieTrackingPlaneTrack * BKE_tracking_object_find_plane_track_with_name(struct MovieTrackingObject *tracking_object, const char *name)
struct MovieTrackingObject * BKE_tracking_object_get_named(struct MovieTracking *tracking, const char *name)
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
struct MovieTrackingPlaneMarker * BKE_tracking_plane_marker_get(struct MovieTrackingPlaneTrack *plane_track, int framenr)
struct MovieTrackingTrack * BKE_tracking_object_find_track_with_name(struct MovieTrackingObject *tracking_object, const char *name)
#define BLI_assert_msg(a, msg)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void zero_v2(float r[2])
char * STRNCPY(char(&dst)[N], const char *src)
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define BLT_I18NCONTEXT_ID_MASK
void DEG_id_tag_update(ID *id, unsigned int flags)
#define DNA_struct_default_get(struct_name)
@ MASK_PARENT_PLANE_TRACK
@ MASK_PARENT_POINT_TRACK
@ MASK_BLEND_MERGE_SUBTRACT
@ MASK_LAYERFLAG_FILL_OVERLAP
@ MASK_LAYERFLAG_FILL_DISCRETE
@ MASK_SPLINE_NOINTERSECT
@ MASK_SPLINE_INTERP_EASE
@ MASK_SPLINE_INTERP_LINEAR
@ MASK_SPLINE_OFFSET_SMOOTH
@ MASK_SPLINE_OFFSET_EVEN
Object is a sort of wrapper for general info.
#define MEM_recallocN(vmemh, len)
StructRNA * ID_code_to_RNA_type(short idcode)
BMesh const char void * data
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
ccl_device_inline float2 mask(const MaskType mask, const float2 a)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
void rna_def_animdata_common(StructRNA *srna)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
static void rna_def_mask(BlenderRNA *brna)
static void rna_def_maskSplinePoints(BlenderRNA *brna)
static void rna_def_mask_layer(BlenderRNA *brna)
static void rna_def_masklayers(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_mask_splines(BlenderRNA *brna)
static void rna_def_maskSpline(BlenderRNA *brna)
static void rna_def_maskSplinePointUW(BlenderRNA *brna)
void RNA_def_mask(BlenderRNA *brna)
static void rna_def_maskSplinePoint(BlenderRNA *brna)
static void rna_def_maskParent(BlenderRNA *brna)
static const EnumPropertyItem parent_type_items[]
const EnumPropertyItem rna_enum_proportional_falloff_curve_only_items[]
struct MaskSplinePoint * act_point
struct MaskSpline * act_spline
float parent_corners_orig[4][2]
void WM_main_add_notifier(uint type, void *reference)