39# include <fmt/format.h>
70 if (tracking_object) {
79 float marker_pos_ofs[2], parmask_pos[2];
108 rna_Mask_update_data(bmain, scene,
ptr);
116 mpar->id =
static_cast<ID *
>(value.data);
126static void rna_MaskParent_id_type_set(
PointerRNA *
ptr,
int value)
131 mpar->id_type = value;
134 if ((mpar->id) && (
GS(mpar->id->name) != mpar->id_type)) {
150 return mask->masklay_act;
153static void rna_Mask_layer_active_index_set(
PointerRNA *
ptr,
int value)
157 mask->masklay_act = value;
160static void rna_Mask_layer_active_index_range(
166 *max =
max_ii(0, mask->masklay_tot - 1);
172static std::optional<std::string> rna_MaskLayer_path(
const PointerRNA *
ptr)
175 char name_esc[
sizeof(masklay->name) * 2];
177 return fmt::format(
"layers[\"{}\"]", name_esc);
203static void rna_MaskLayer_name_set(
PointerRNA *
ptr,
const char *value)
207 char oldname[
sizeof(masklay->
name)], newname[
sizeof(masklay->
name)];
246static void rna_MaskLayer_active_spline_point_set(
PointerRNA *
ptr,
257 if (point >= spline->points &&
point < spline->points + spline->tot_point) {
265static void rna_MaskSplinePoint_handle1_get(
PointerRNA *
ptr,
float *values)
272static void rna_MaskSplinePoint_handle1_set(
PointerRNA *
ptr,
const float *values)
279static void rna_MaskSplinePoint_handle2_get(
PointerRNA *
ptr,
float *values)
286static void rna_MaskSplinePoint_handle2_set(
PointerRNA *
ptr,
const float *values)
293static void rna_MaskSplinePoint_ctrlpoint_get(
PointerRNA *
ptr,
float *values)
300static void rna_MaskSplinePoint_ctrlpoint_set(
PointerRNA *
ptr,
const float *values)
307static int rna_MaskSplinePoint_handle_type_get(
PointerRNA *
ptr)
318 for (mask_layer =
static_cast<MaskLayer *
>(mask->masklayers.first); mask_layer;
319 mask_layer = mask_layer->
next)
323 spline = spline->
next)
325 if (point >= spline->points &&
point < spline->points + spline->tot_point) {
343static void rna_MaskSplinePoint_handle_type_set(
PointerRNA *
ptr,
int value)
349 bezt->
h1 = bezt->
h2 = value;
350 mask_point_check_stick(point);
354static int rna_MaskSplinePoint_handle_left_type_get(
PointerRNA *
ptr)
362static void rna_MaskSplinePoint_handle_left_type_set(
PointerRNA *
ptr,
int value)
369 mask_point_check_stick(point);
373static int rna_MaskSplinePoint_handle_right_type_get(
PointerRNA *
ptr)
381static void rna_MaskSplinePoint_handle_right_type_set(
PointerRNA *
ptr,
int value)
388 mask_point_check_stick(point);
394static MaskLayer *rna_Mask_layers_new(
Mask *mask,
const char *name)
409 "Mask layer '%s' not found in mask '%s'",
421static void rna_Mask_layers_clear(
Mask *mask)
440static void rna_MaskLayer_spline_remove(
ID *
id,
450 reports,
RPT_ERROR,
"Mask layer '%s' does not contain spline given", mask_layer->
name);
459static void rna_Mask_start_frame_set(
PointerRNA *
ptr,
int value)
466 if (data->sfra >= data->efra) {
467 data->efra = std::min(data->sfra,
MAXFRAME);
471static void rna_Mask_end_frame_set(
PointerRNA *
ptr,
int value)
477 if (data->sfra >= data->efra) {
478 data->sfra = std::max(data->efra,
MINFRAME);
486 int active_point_index = -1;
487 int i, spline_shape_index;
493 for (layer =
static_cast<MaskLayer *
>(mask->masklayers.first); layer; layer = layer->
next) {
505 if (layer->act_spline == spline) {
506 active_point_index = layer->act_point - spline->points;
511 spline->tot_point +=
count;
513 if (active_point_index >= 0) {
514 layer->act_point = spline->points + active_point_index;
519 for (i = 0; i <
count; i++) {
520 int point_index = spline->tot_point -
count + i;
534static void rna_MaskSpline_point_remove(
ID *
id,
543 int active_point_index = -1;
546 for (layer =
static_cast<MaskLayer *
>(mask->masklayers.first); layer; layer = layer->
next) {
558 if (
point < spline->points || point >= spline->points + spline->tot_point) {
563 if (layer->act_spline == spline) {
564 active_point_index = layer->act_point - spline->points;
567 point_index = point - spline->points;
572 memcpy(new_point_array, spline->points,
sizeof(
MaskSplinePoint) * point_index);
573 memcpy(new_point_array + point_index,
574 spline->points + point_index + 1,
578 spline->points = new_point_array;
581 if (active_point_index >= 0) {
582 if (active_point_index == point_index) {
583 layer->act_point =
nullptr;
585 else if (active_point_index < point_index) {
586 layer->act_point = spline->points + active_point_index;
589 layer->act_point = spline->points + active_point_index - 1;
609 {
ID_MC,
"MOVIECLIP", ICON_SEQUENCE,
"Movie Clip",
""},
610 {0,
nullptr, 0,
nullptr,
nullptr},
616 {0,
nullptr, 0,
nullptr,
nullptr},
629 prop,
nullptr,
"rna_MaskParent_id_set",
"rna_MaskParent_id_typef",
nullptr);
631 prop,
"ID",
"ID-block to which masking element would be parented to or to its property");
652 prop,
"Parent",
"Name of parent object in specified data-block to which parenting happens");
661 "Name of parent sub-object in specified data-block to which parenting happens");
673 srna,
"Mask Spline UW Point",
"Single point in spline segment defining feather");
702 {
HD_AUTO,
"AUTO", 0,
"Auto",
""},
703 {
HD_VECT,
"VECTOR", 0,
"Vector",
""},
704 {
HD_ALIGN,
"ALIGNED", 0,
"Aligned Single",
""},
706 {
HD_FREE,
"FREE", 0,
"Free",
""},
707 {0,
nullptr, 0,
nullptr,
nullptr},
714 srna,
"Mask Spline Point",
"Single point in spline used for defining mask");
720 prop,
"rna_MaskSplinePoint_handle1_get",
"rna_MaskSplinePoint_handle1_set",
nullptr);
727 prop,
"rna_MaskSplinePoint_ctrlpoint_get",
"rna_MaskSplinePoint_ctrlpoint_set",
nullptr);
734 prop,
"rna_MaskSplinePoint_handle2_get",
"rna_MaskSplinePoint_handle2_set",
nullptr);
741 prop,
"rna_MaskSplinePoint_handle_type_get",
"rna_MaskSplinePoint_handle_type_set",
nullptr);
749 "rna_MaskSplinePoint_handle_left_type_get",
750 "rna_MaskSplinePoint_handle_left_type_set",
759 "rna_MaskSplinePoint_handle_right_type_get",
760 "rna_MaskSplinePoint_handle_right_type_set",
805 parm =
RNA_def_pointer(func,
"spline",
"MaskSpline",
"",
"The newly created spline");
813 parm =
RNA_def_pointer(func,
"spline",
"MaskSpline",
"",
"The spline to remove");
821 "rna_MaskLayer_active_spline_get",
822 "rna_MaskLayer_active_spline_set",
832 "rna_MaskLayer_active_spline_point_get",
833 "rna_MaskLayer_active_spline_point_set",
855 func,
"count", 1, 0, INT_MAX,
"Number",
"Number of points to add to the spline", 0, INT_MAX);
863 parm =
RNA_def_pointer(func,
"point",
"MaskSplinePoint",
"",
"The point to remove");
873 {0,
nullptr, 0,
nullptr,
nullptr},
882 "Calculate feather offset as a second curve"},
883 {0,
nullptr, 0,
nullptr,
nullptr},
899 prop,
"Feather Offset",
"The method used for calculating the feather offset");
908 prop,
"Weight Interpolation",
"The type of weight interpolation for spline");
931 prop,
"Self Intersection Check",
"Prevent feather from self-intersections");
953 {0,
nullptr, 0,
nullptr,
nullptr},
978 "rna_MaskLayer_splines_begin",
979 "rna_iterator_listbase_next",
980 "rna_iterator_listbase_end",
981 "rna_iterator_listbase_get",
1047 prop,
"Calculate Holes",
"Calculate holes when filling overlapping curves");
1053 prop,
"Calculate Overlap",
"Calculate self intersections and overlap before filling");
1072 RNA_def_string(func,
"name",
nullptr, 0,
"Name",
"Name of new layer");
1073 parm =
RNA_def_pointer(func,
"layer",
"MaskLayer",
"",
"New mask layer");
1079 parm =
RNA_def_pointer(func,
"layer",
"MaskLayer",
"",
"Shape to be removed");
1091 prop,
"rna_Mask_layer_active_get",
"rna_Mask_layer_active_set",
nullptr,
nullptr);
1110 "rna_Mask_layers_begin",
1111 "rna_iterator_listbase_next",
1112 "rna_iterator_listbase_end",
1113 "rna_iterator_listbase_get",
1127 "rna_Mask_layer_active_index_get",
1128 "rna_Mask_layer_active_index_set",
1129 "rna_Mask_layer_active_index_range");
1131 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.
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)
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_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 struct 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])
#define STRNCPY(dst, 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_BLEND_MERGE_SUBTRACT
@ MASK_SPLINE_OFFSET_SMOOTH
@ MASK_SPLINE_OFFSET_EVEN
@ MASK_SPLINE_NOINTERSECT
@ MASK_PARENT_PLANE_TRACK
@ MASK_PARENT_POINT_TRACK
@ MASK_SPLINE_INTERP_EASE
@ MASK_SPLINE_INTERP_LINEAR
@ MASK_LAYERFLAG_FILL_OVERLAP
@ MASK_LAYERFLAG_FILL_DISCRETE
Object is a sort of wrapper for general info.
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
#define MEM_recallocN(vmemh, len)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
#define RNA_POINTER_INVALIDATE(ptr)
StructRNA * ID_code_to_RNA_type(short idcode)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
void rna_def_animdata_common(StructRNA *srna)
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_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
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_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)