Blender V4.3
rna_mask.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <climits>
10#include <cstdlib>
11
12#include "MEM_guardedalloc.h"
13
14#include "DNA_defaults.h"
15#include "DNA_mask_types.h"
16#include "DNA_object_types.h" /* SELECT */
17#include "DNA_scene_types.h"
18
19#include "BLI_math_vector.h"
20
21#include "BLT_translation.hh"
22
23#include "BKE_movieclip.h"
24#include "BKE_tracking.h"
25
26#include "RNA_define.hh"
27#include "RNA_enum_types.hh"
28
29#include "rna_internal.hh"
30
31#include "WM_types.hh"
32
33#include "IMB_imbuf.hh"
34#include "IMB_imbuf_types.hh"
35
36#ifdef RNA_RUNTIME
37
38# include <algorithm>
39# include <fmt/format.h>
40
41# include "DNA_movieclip_types.h"
42
43# include "BKE_mask.h"
44
45# include "DEG_depsgraph.hh"
46
47# include "RNA_access.hh"
48
49# include "WM_api.hh"
50
51static void rna_Mask_update_data(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
52{
53 Mask *mask = (Mask *)ptr->owner_id;
54
56 DEG_id_tag_update(&mask->id, 0);
57}
58
59static void rna_Mask_update_parent(Main *bmain, Scene *scene, PointerRNA *ptr)
60{
61 MaskParent *parent = static_cast<MaskParent *>(ptr->data);
62
63 if (parent->id) {
64 if (GS(parent->id->name) == ID_MC) {
65 MovieClip *clip = (MovieClip *)parent->id;
66 MovieTracking *tracking = &clip->tracking;
67 MovieTrackingObject *tracking_object = BKE_tracking_object_get_named(tracking,
68 parent->parent);
69
70 if (tracking_object) {
71 int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, scene->r.cfra);
72
73 if (parent->type == MASK_PARENT_POINT_TRACK) {
75 parent->sub_parent);
76
77 if (track) {
78 MovieTrackingMarker *marker = BKE_tracking_marker_get(track, clip_framenr);
79 float marker_pos_ofs[2], parmask_pos[2];
81
82 BKE_movieclip_user_set_frame(&user, scene->r.cfra);
83
84 add_v2_v2v2(marker_pos_ofs, marker->pos, track->offset);
85
86 BKE_mask_coord_from_movieclip(clip, &user, parmask_pos, marker_pos_ofs);
87
88 copy_v2_v2(parent->parent_orig, parmask_pos);
89 }
90 }
91 else /* if (parent->type == MASK_PARENT_PLANE_TRACK) */ {
93 tracking_object, parent->sub_parent);
94 if (plane_track) {
96 clip_framenr);
97
98 memcpy(parent->parent_corners_orig,
99 plane_marker->corners,
100 sizeof(parent->parent_corners_orig));
101 zero_v2(parent->parent_orig);
102 }
103 }
104 }
105 }
106 }
107
108 rna_Mask_update_data(bmain, scene, ptr);
109}
110
111/* NOTE: this function exists only to avoid id reference-counting. */
112static void rna_MaskParent_id_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
113{
114 MaskParent *mpar = (MaskParent *)ptr->data;
115
116 mpar->id = static_cast<ID *>(value.data);
117}
118
119static StructRNA *rna_MaskParent_id_typef(PointerRNA *ptr)
120{
121 MaskParent *mpar = (MaskParent *)ptr->data;
122
123 return ID_code_to_RNA_type(mpar->id_type);
124}
125
126static void rna_MaskParent_id_type_set(PointerRNA *ptr, int value)
127{
128 MaskParent *mpar = (MaskParent *)ptr->data;
129
130 /* change ID-type to the new type */
131 mpar->id_type = value;
132
133 /* clear the id-block if the type is invalid */
134 if ((mpar->id) && (GS(mpar->id->name) != mpar->id_type)) {
135 mpar->id = nullptr;
136 }
137}
138
139static void rna_Mask_layers_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
140{
141 Mask *mask = (Mask *)ptr->owner_id;
142
143 rna_iterator_listbase_begin(iter, &mask->masklayers, nullptr);
144}
145
146static int rna_Mask_layer_active_index_get(PointerRNA *ptr)
147{
148 Mask *mask = (Mask *)ptr->owner_id;
149
150 return mask->masklay_act;
151}
152
153static void rna_Mask_layer_active_index_set(PointerRNA *ptr, int value)
154{
155 Mask *mask = (Mask *)ptr->owner_id;
156
157 mask->masklay_act = value;
158}
159
160static void rna_Mask_layer_active_index_range(
161 PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
162{
163 Mask *mask = (Mask *)ptr->owner_id;
164
165 *min = 0;
166 *max = max_ii(0, mask->masklay_tot - 1);
167
168 *softmin = *min;
169 *softmax = *max;
170}
171
172static std::optional<std::string> rna_MaskLayer_path(const PointerRNA *ptr)
173{
174 const MaskLayer *masklay = (MaskLayer *)ptr->data;
175 char name_esc[sizeof(masklay->name) * 2];
176 BLI_str_escape(name_esc, masklay->name, sizeof(name_esc));
177 return fmt::format("layers[\"{}\"]", name_esc);
178}
179
180static PointerRNA rna_Mask_layer_active_get(PointerRNA *ptr)
181{
182 Mask *mask = (Mask *)ptr->owner_id;
183 MaskLayer *masklay = BKE_mask_layer_active(mask);
184
185 return rna_pointer_inherit_refine(ptr, &RNA_MaskLayer, masklay);
186}
187
188static void rna_Mask_layer_active_set(PointerRNA *ptr, PointerRNA value, ReportList * /*reports*/)
189{
190 Mask *mask = (Mask *)ptr->owner_id;
191 MaskLayer *masklay = (MaskLayer *)value.data;
192
193 BKE_mask_layer_active_set(mask, masklay);
194}
195
196static void rna_MaskLayer_splines_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
197{
198 MaskLayer *masklay = (MaskLayer *)ptr->data;
199
200 rna_iterator_listbase_begin(iter, &masklay->splines, nullptr);
201}
202
203static void rna_MaskLayer_name_set(PointerRNA *ptr, const char *value)
204{
205 Mask *mask = (Mask *)ptr->owner_id;
206 MaskLayer *masklay = (MaskLayer *)ptr->data;
207 char oldname[sizeof(masklay->name)], newname[sizeof(masklay->name)];
208
209 /* need to be on the stack */
210 STRNCPY(oldname, masklay->name);
211 STRNCPY_UTF8(newname, value);
212
213 BKE_mask_layer_rename(mask, masklay, oldname, newname);
214}
215
216static PointerRNA rna_MaskLayer_active_spline_get(PointerRNA *ptr)
217{
218 MaskLayer *masklay = (MaskLayer *)ptr->data;
219
220 return rna_pointer_inherit_refine(ptr, &RNA_MaskSpline, masklay->act_spline);
221}
222
223static void rna_MaskLayer_active_spline_set(PointerRNA *ptr,
224 PointerRNA value,
225 ReportList * /*reports*/)
226{
227 MaskLayer *masklay = (MaskLayer *)ptr->data;
228 MaskSpline *spline = (MaskSpline *)value.data;
229 int index = BLI_findindex(&masklay->splines, spline);
230
231 if (index != -1) {
232 masklay->act_spline = spline;
233 }
234 else {
235 masklay->act_spline = nullptr;
236 }
237}
238
239static PointerRNA rna_MaskLayer_active_spline_point_get(PointerRNA *ptr)
240{
241 MaskLayer *masklay = (MaskLayer *)ptr->data;
242
243 return rna_pointer_inherit_refine(ptr, &RNA_MaskSplinePoint, masklay->act_point);
244}
245
246static void rna_MaskLayer_active_spline_point_set(PointerRNA *ptr,
247 PointerRNA value,
248 ReportList * /*reports*/)
249{
250 MaskLayer *masklay = (MaskLayer *)ptr->data;
251 MaskSpline *spline;
252 MaskSplinePoint *point = (MaskSplinePoint *)value.data;
253
254 masklay->act_point = nullptr;
255
256 for (spline = static_cast<MaskSpline *>(masklay->splines.first); spline; spline = spline->next) {
257 if (point >= spline->points && point < spline->points + spline->tot_point) {
258 masklay->act_point = point;
259
260 break;
261 }
262 }
263}
264
265static void rna_MaskSplinePoint_handle1_get(PointerRNA *ptr, float *values)
266{
268 BezTriple *bezt = &point->bezt;
269 copy_v2_v2(values, bezt->vec[0]);
270}
271
272static void rna_MaskSplinePoint_handle1_set(PointerRNA *ptr, const float *values)
273{
275 BezTriple *bezt = &point->bezt;
276 copy_v2_v2(bezt->vec[0], values);
277}
278
279static void rna_MaskSplinePoint_handle2_get(PointerRNA *ptr, float *values)
280{
282 BezTriple *bezt = &point->bezt;
283 copy_v2_v2(values, bezt->vec[2]);
284}
285
286static void rna_MaskSplinePoint_handle2_set(PointerRNA *ptr, const float *values)
287{
289 BezTriple *bezt = &point->bezt;
290 copy_v2_v2(bezt->vec[2], values);
291}
292
293static void rna_MaskSplinePoint_ctrlpoint_get(PointerRNA *ptr, float *values)
294{
296 BezTriple *bezt = &point->bezt;
297 copy_v2_v2(values, bezt->vec[1]);
298}
299
300static void rna_MaskSplinePoint_ctrlpoint_set(PointerRNA *ptr, const float *values)
301{
303 BezTriple *bezt = &point->bezt;
304 copy_v2_v2(bezt->vec[1], values);
305}
306
307static int rna_MaskSplinePoint_handle_type_get(PointerRNA *ptr)
308{
310 BezTriple *bezt = &point->bezt;
311
312 return bezt->h1;
313}
314
315static MaskSpline *mask_spline_from_point(Mask *mask, MaskSplinePoint *point)
316{
317 MaskLayer *mask_layer;
318 for (mask_layer = static_cast<MaskLayer *>(mask->masklayers.first); mask_layer;
319 mask_layer = mask_layer->next)
320 {
321 MaskSpline *spline;
322 for (spline = static_cast<MaskSpline *>(mask_layer->splines.first); spline;
323 spline = spline->next)
324 {
325 if (point >= spline->points && point < spline->points + spline->tot_point) {
326 return spline;
327 }
328 }
329 }
330 return nullptr;
331}
332
333static void mask_point_check_stick(MaskSplinePoint *point)
334{
335 BezTriple *bezt = &point->bezt;
336 if (bezt->h1 == HD_ALIGN && bezt->h2 == HD_ALIGN) {
337 float vec[3];
338 sub_v3_v3v3(vec, bezt->vec[0], bezt->vec[1]);
339 add_v3_v3v3(bezt->vec[2], bezt->vec[1], vec);
340 }
341}
342
343static void rna_MaskSplinePoint_handle_type_set(PointerRNA *ptr, int value)
344{
346 BezTriple *bezt = &point->bezt;
347 MaskSpline *spline = mask_spline_from_point((Mask *)ptr->owner_id, point);
348
349 bezt->h1 = bezt->h2 = value;
350 mask_point_check_stick(point);
351 BKE_mask_calc_handle_point(spline, point);
352}
353
354static int rna_MaskSplinePoint_handle_left_type_get(PointerRNA *ptr)
355{
357 BezTriple *bezt = &point->bezt;
358
359 return bezt->h1;
360}
361
362static void rna_MaskSplinePoint_handle_left_type_set(PointerRNA *ptr, int value)
363{
365 BezTriple *bezt = &point->bezt;
366 MaskSpline *spline = mask_spline_from_point((Mask *)ptr->owner_id, point);
367
368 bezt->h1 = value;
369 mask_point_check_stick(point);
370 BKE_mask_calc_handle_point(spline, point);
371}
372
373static int rna_MaskSplinePoint_handle_right_type_get(PointerRNA *ptr)
374{
376 BezTriple *bezt = &point->bezt;
377
378 return bezt->h2;
379}
380
381static void rna_MaskSplinePoint_handle_right_type_set(PointerRNA *ptr, int value)
382{
384 BezTriple *bezt = &point->bezt;
385 MaskSpline *spline = mask_spline_from_point((Mask *)ptr->owner_id, point);
386
387 bezt->h2 = value;
388 mask_point_check_stick(point);
389 BKE_mask_calc_handle_point(spline, point);
390}
391
392/* ** API ** */
393
394static MaskLayer *rna_Mask_layers_new(Mask *mask, const char *name)
395{
396 MaskLayer *masklay = BKE_mask_layer_new(mask, name);
397
399
400 return masklay;
401}
402
403static void rna_Mask_layers_remove(Mask *mask, ReportList *reports, PointerRNA *masklay_ptr)
404{
405 MaskLayer *masklay = static_cast<MaskLayer *>(masklay_ptr->data);
406 if (BLI_findindex(&mask->masklayers, masklay) == -1) {
407 BKE_reportf(reports,
408 RPT_ERROR,
409 "Mask layer '%s' not found in mask '%s'",
410 masklay->name,
411 mask->id.name + 2);
412 return;
413 }
414
415 BKE_mask_layer_remove(mask, masklay);
416 RNA_POINTER_INVALIDATE(masklay_ptr);
417
419}
420
421static void rna_Mask_layers_clear(Mask *mask)
422{
423 BKE_mask_layer_free_list(&mask->masklayers);
424
426}
427
428static MaskSpline *rna_MaskLayer_spline_new(ID *id, MaskLayer *mask_layer)
429{
430 Mask *mask = (Mask *)id;
431 MaskSpline *new_spline;
432
433 new_spline = BKE_mask_spline_add(mask_layer);
434
436
437 return new_spline;
438}
439
440static void rna_MaskLayer_spline_remove(ID *id,
441 MaskLayer *mask_layer,
442 ReportList *reports,
443 PointerRNA *spline_ptr)
444{
445 Mask *mask = (Mask *)id;
446 MaskSpline *spline = static_cast<MaskSpline *>(spline_ptr->data);
447
448 if (BKE_mask_spline_remove(mask_layer, spline) == false) {
450 reports, RPT_ERROR, "Mask layer '%s' does not contain spline given", mask_layer->name);
451 return;
452 }
453
454 RNA_POINTER_INVALIDATE(spline_ptr);
455
457}
458
459static void rna_Mask_start_frame_set(PointerRNA *ptr, int value)
460{
461 Mask *data = (Mask *)ptr->data;
462 /* MINFRAME not MINAFRAME, since some output formats can't taken negative frames */
463 CLAMP(value, MINFRAME, MAXFRAME);
464 data->sfra = value;
465
466 if (data->sfra >= data->efra) {
467 data->efra = std::min(data->sfra, MAXFRAME);
468 }
469}
470
471static void rna_Mask_end_frame_set(PointerRNA *ptr, int value)
472{
473 Mask *data = (Mask *)ptr->data;
474 CLAMP(value, MINFRAME, MAXFRAME);
475 data->efra = value;
476
477 if (data->sfra >= data->efra) {
478 data->sfra = std::max(data->efra, MINFRAME);
479 }
480}
481
482static void rna_MaskSpline_points_add(ID *id, MaskSpline *spline, int count)
483{
484 Mask *mask = (Mask *)id;
485 MaskLayer *layer;
486 int active_point_index = -1;
487 int i, spline_shape_index;
488
489 if (count <= 0) {
490 return;
491 }
492
493 for (layer = static_cast<MaskLayer *>(mask->masklayers.first); layer; layer = layer->next) {
494 if (BLI_findindex(&layer->splines, spline) != -1) {
495 break;
496 }
497 }
498
499 if (!layer) {
500 /* Shall not happen actually */
501 BLI_assert_msg(0, "No layer found for the spline");
502 return;
503 }
504
505 if (layer->act_spline == spline) {
506 active_point_index = layer->act_point - spline->points;
507 }
508
509 spline->points = static_cast<MaskSplinePoint *>(
510 MEM_recallocN(spline->points, sizeof(MaskSplinePoint) * (spline->tot_point + count)));
511 spline->tot_point += count;
512
513 if (active_point_index >= 0) {
514 layer->act_point = spline->points + active_point_index;
515 }
516
517 spline_shape_index = BKE_mask_layer_shape_spline_to_index(layer, spline);
518
519 for (i = 0; i < count; i++) {
520 int point_index = spline->tot_point - count + i;
521 MaskSplinePoint *new_point = spline->points + point_index;
522 new_point->bezt.h1 = new_point->bezt.h2 = HD_ALIGN;
523 BKE_mask_calc_handle_point_auto(spline, new_point, true);
524 BKE_mask_parent_init(&new_point->parent);
525
526 /* Not efficient, but there's no other way for now */
527 BKE_mask_layer_shape_changed_add(layer, spline_shape_index + point_index, true, true);
528 }
529
531 DEG_id_tag_update(&mask->id, 0);
532}
533
534static void rna_MaskSpline_point_remove(ID *id,
535 MaskSpline *spline,
536 ReportList *reports,
537 PointerRNA *point_ptr)
538{
539 Mask *mask = (Mask *)id;
540 MaskSplinePoint *point = static_cast<MaskSplinePoint *>(point_ptr->data);
541 MaskSplinePoint *new_point_array;
542 MaskLayer *layer;
543 int active_point_index = -1;
544 int point_index;
545
546 for (layer = static_cast<MaskLayer *>(mask->masklayers.first); layer; layer = layer->next) {
547 if (BLI_findindex(&layer->splines, spline) != -1) {
548 break;
549 }
550 }
551
552 if (!layer) {
553 /* Shall not happen actually */
554 BKE_report(reports, RPT_ERROR, "Mask layer not found for given spline");
555 return;
556 }
557
558 if (point < spline->points || point >= spline->points + spline->tot_point) {
559 BKE_report(reports, RPT_ERROR, "Point is not found in given spline");
560 return;
561 }
562
563 if (layer->act_spline == spline) {
564 active_point_index = layer->act_point - spline->points;
565 }
566
567 point_index = point - spline->points;
568
569 new_point_array = static_cast<MaskSplinePoint *>(
570 MEM_mallocN(sizeof(MaskSplinePoint) * (spline->tot_point - 1), "remove mask point"));
571
572 memcpy(new_point_array, spline->points, sizeof(MaskSplinePoint) * point_index);
573 memcpy(new_point_array + point_index,
574 spline->points + point_index + 1,
575 sizeof(MaskSplinePoint) * (spline->tot_point - point_index - 1));
576
577 MEM_freeN(spline->points);
578 spline->points = new_point_array;
579 spline->tot_point--;
580
581 if (active_point_index >= 0) {
582 if (active_point_index == point_index) {
583 layer->act_point = nullptr;
584 }
585 else if (active_point_index < point_index) {
586 layer->act_point = spline->points + active_point_index;
587 }
588 else {
589 layer->act_point = spline->points + active_point_index - 1;
590 }
591 }
592
594 layer, BKE_mask_layer_shape_spline_to_index(layer, spline) + point_index, 1);
595
597 DEG_id_tag_update(&mask->id, 0);
598
599 RNA_POINTER_INVALIDATE(point_ptr);
600}
601
602#else
604{
605 StructRNA *srna;
606 PropertyRNA *prop;
607
608 static const EnumPropertyItem mask_id_type_items[] = {
609 {ID_MC, "MOVIECLIP", ICON_SEQUENCE, "Movie Clip", ""},
610 {0, nullptr, 0, nullptr, nullptr},
611 };
612
613 static const EnumPropertyItem parent_type_items[] = {
614 {MASK_PARENT_POINT_TRACK, "POINT_TRACK", 0, "Point Track", ""},
615 {MASK_PARENT_PLANE_TRACK, "PLANE_TRACK", 0, "Plane Track", ""},
616 {0, nullptr, 0, nullptr, nullptr},
617 };
618
619 srna = RNA_def_struct(brna, "MaskParent", nullptr);
620 RNA_def_struct_ui_text(srna, "Mask Parent", "Parenting settings for masking element");
621
622 /* Target Properties - ID-block to Drive */
623 prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE);
626 // RNA_def_property_editable_func(prop, "rna_maskSpline_id_editable");
627 /* NOTE: custom set function is ONLY to avoid rna setting a user for this. */
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");
632 RNA_def_property_update(prop, 0, "rna_Mask_update_parent");
633
634 prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
635 RNA_def_property_enum_sdna(prop, nullptr, "id_type");
636 RNA_def_property_enum_items(prop, mask_id_type_items);
638 RNA_def_property_enum_funcs(prop, nullptr, "rna_MaskParent_id_type_set", nullptr);
639 // RNA_def_property_editable_func(prop, "rna_MaskParent_id_type_editable");
640 RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used");
641 RNA_def_property_update(prop, 0, "rna_Mask_update_parent");
642
643 /* type */
644 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
646 RNA_def_property_ui_text(prop, "Parent Type", "Parent Type");
647 RNA_def_property_update(prop, 0, "rna_Mask_update_parent");
648
649 /* parent */
650 prop = RNA_def_property(srna, "parent", PROP_STRING, PROP_NONE);
652 prop, "Parent", "Name of parent object in specified data-block to which parenting happens");
654 RNA_def_property_update(prop, 0, "rna_Mask_update_parent");
655
656 /* sub_parent */
657 prop = RNA_def_property(srna, "sub_parent", PROP_STRING, PROP_NONE);
659 prop,
660 "Sub Parent",
661 "Name of parent sub-object in specified data-block to which parenting happens");
663 RNA_def_property_update(prop, 0, "rna_Mask_update_parent");
664}
665
667{
668 StructRNA *srna;
669 PropertyRNA *prop;
670
671 srna = RNA_def_struct(brna, "MaskSplinePointUW", nullptr);
673 srna, "Mask Spline UW Point", "Single point in spline segment defining feather");
674
675 /* u */
676 prop = RNA_def_property(srna, "u", PROP_FLOAT, PROP_NONE);
677 RNA_def_property_float_sdna(prop, nullptr, "u");
678 RNA_def_property_range(prop, 0.0, 1.0);
679 RNA_def_property_ui_text(prop, "U", "U coordinate of point along spline segment");
680 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
681
682 /* weight */
683 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
684 RNA_def_property_float_sdna(prop, nullptr, "w");
685 RNA_def_property_range(prop, 0.0, 1.0);
686 RNA_def_property_ui_text(prop, "Weight", "Weight of feather point");
687 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
688
689 /* select */
690 prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
691 RNA_def_property_boolean_sdna(prop, nullptr, "flag", SELECT);
692 RNA_def_property_ui_text(prop, "Select", "Selection status");
693 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
694}
695
697{
698 StructRNA *srna;
699 PropertyRNA *prop;
700
701 static const EnumPropertyItem handle_type_items[] = {
702 {HD_AUTO, "AUTO", 0, "Auto", ""},
703 {HD_VECT, "VECTOR", 0, "Vector", ""},
704 {HD_ALIGN, "ALIGNED", 0, "Aligned Single", ""},
705 {HD_ALIGN_DOUBLESIDE, "ALIGNED_DOUBLESIDE", 0, "Aligned", ""},
706 {HD_FREE, "FREE", 0, "Free", ""},
707 {0, nullptr, 0, nullptr, nullptr},
708 };
709
711
712 srna = RNA_def_struct(brna, "MaskSplinePoint", nullptr);
714 srna, "Mask Spline Point", "Single point in spline used for defining mask");
715
716 /* Vector values */
717 prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
718 RNA_def_property_array(prop, 2);
720 prop, "rna_MaskSplinePoint_handle1_get", "rna_MaskSplinePoint_handle1_set", nullptr);
721 RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
722 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
723
724 prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
725 RNA_def_property_array(prop, 2);
727 prop, "rna_MaskSplinePoint_ctrlpoint_get", "rna_MaskSplinePoint_ctrlpoint_set", nullptr);
728 RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
729 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
730
731 prop = RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
732 RNA_def_property_array(prop, 2);
734 prop, "rna_MaskSplinePoint_handle2_get", "rna_MaskSplinePoint_handle2_set", nullptr);
735 RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle");
736 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
737
738 /* handle_type */
739 prop = RNA_def_property(srna, "handle_type", PROP_ENUM, PROP_NONE);
741 prop, "rna_MaskSplinePoint_handle_type_get", "rna_MaskSplinePoint_handle_type_set", nullptr);
742 RNA_def_property_enum_items(prop, handle_type_items);
743 RNA_def_property_ui_text(prop, "Handle Type", "Handle type");
744 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
745
746 /* handle_type */
747 prop = RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE);
749 "rna_MaskSplinePoint_handle_left_type_get",
750 "rna_MaskSplinePoint_handle_left_type_set",
751 nullptr);
752 RNA_def_property_enum_items(prop, handle_type_items);
753 RNA_def_property_ui_text(prop, "Handle 1 Type", "Handle type");
754 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
755
756 /* handle_right */
757 prop = RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE);
759 "rna_MaskSplinePoint_handle_right_type_get",
760 "rna_MaskSplinePoint_handle_right_type_set",
761 nullptr);
762 RNA_def_property_enum_items(prop, handle_type_items);
763 RNA_def_property_ui_text(prop, "Handle 2 Type", "Handle type");
764 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
765
766 /* weight */
767 prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
768 RNA_def_property_float_sdna(prop, nullptr, "bezt.weight");
769 RNA_def_property_range(prop, 0.0, 1.0);
770 RNA_def_property_ui_text(prop, "Weight", "Weight of the point");
771 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
772
773 /* select */
774 prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
775 RNA_def_property_boolean_sdna(prop, nullptr, "bezt.f1", SELECT);
776 RNA_def_property_ui_text(prop, "Select", "Selection status");
777 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
778
779 /* parent */
780 prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
781 RNA_def_property_struct_type(prop, "MaskParent");
782
783 /* feather points */
784 prop = RNA_def_property(srna, "feather_points", PROP_COLLECTION, PROP_NONE);
785 RNA_def_property_struct_type(prop, "MaskSplinePointUW");
786 RNA_def_property_collection_sdna(prop, nullptr, "uw", "tot_uw");
787 RNA_def_property_ui_text(prop, "Feather Points", "Points defining feather");
788}
789
791{
792 StructRNA *srna;
793 FunctionRNA *func;
794 PropertyRNA *prop;
795 PropertyRNA *parm;
796
797 srna = RNA_def_struct(brna, "MaskSplines", nullptr);
798 RNA_def_struct_sdna(srna, "MaskLayer");
799 RNA_def_struct_ui_text(srna, "Mask Splines", "Collection of masking splines");
800
801 /* Create new spline */
802 func = RNA_def_function(srna, "new", "rna_MaskLayer_spline_new");
804 RNA_def_function_ui_description(func, "Add a new spline to the layer");
805 parm = RNA_def_pointer(func, "spline", "MaskSpline", "", "The newly created spline");
806 RNA_def_function_return(func, parm);
807
808 /* Remove the spline */
809 func = RNA_def_function(srna, "remove", "rna_MaskLayer_spline_remove");
811 RNA_def_function_ui_description(func, "Remove a spline from a layer");
813 parm = RNA_def_pointer(func, "spline", "MaskSpline", "", "The spline to remove");
816
817 /* active spline */
818 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
819 RNA_def_property_struct_type(prop, "MaskSpline");
821 "rna_MaskLayer_active_spline_get",
822 "rna_MaskLayer_active_spline_set",
823 nullptr,
824 nullptr);
826 RNA_def_property_ui_text(prop, "Active Spline", "Active spline of masking layer");
827
828 /* active point */
829 prop = RNA_def_property(srna, "active_point", PROP_POINTER, PROP_NONE);
830 RNA_def_property_struct_type(prop, "MaskSplinePoint");
832 "rna_MaskLayer_active_spline_point_get",
833 "rna_MaskLayer_active_spline_point_set",
834 nullptr,
835 nullptr);
837 RNA_def_property_ui_text(prop, "Active Point", "Active point of masking layer");
838}
839
841{
842 StructRNA *srna;
843 FunctionRNA *func;
844 PropertyRNA *parm;
845
846 srna = RNA_def_struct(brna, "MaskSplinePoints", nullptr);
847 RNA_def_struct_sdna(srna, "MaskSpline");
848 RNA_def_struct_ui_text(srna, "Mask Spline Points", "Collection of masking spline points");
849
850 /* Create new point */
851 func = RNA_def_function(srna, "add", "rna_MaskSpline_points_add");
853 RNA_def_function_ui_description(func, "Add a number of point to this spline");
854 parm = RNA_def_int(
855 func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
857
858 /* Remove the point */
859 func = RNA_def_function(srna, "remove", "rna_MaskSpline_point_remove");
861 RNA_def_function_ui_description(func, "Remove a point from a spline");
863 parm = RNA_def_pointer(func, "point", "MaskSplinePoint", "", "The point to remove");
866}
867
869{
870 static const EnumPropertyItem spline_interpolation_items[] = {
871 {MASK_SPLINE_INTERP_LINEAR, "LINEAR", 0, "Linear", ""},
872 {MASK_SPLINE_INTERP_EASE, "EASE", 0, "Ease", ""},
873 {0, nullptr, 0, nullptr, nullptr},
874 };
875
876 static const EnumPropertyItem spline_offset_mode_items[] = {
877 {MASK_SPLINE_OFFSET_EVEN, "EVEN", 0, "Even", "Calculate even feather offset"},
879 "SMOOTH",
880 0,
881 "Smooth",
882 "Calculate feather offset as a second curve"},
883 {0, nullptr, 0, nullptr, nullptr},
884 };
885
886 StructRNA *srna;
887 PropertyRNA *prop;
888
890
891 srna = RNA_def_struct(brna, "MaskSpline", nullptr);
892 RNA_def_struct_ui_text(srna, "Mask spline", "Single spline used for defining mask shape");
893
894 /* offset mode */
895 prop = RNA_def_property(srna, "offset_mode", PROP_ENUM, PROP_NONE);
896 RNA_def_property_enum_sdna(prop, nullptr, "offset_mode");
897 RNA_def_property_enum_items(prop, spline_offset_mode_items);
899 prop, "Feather Offset", "The method used for calculating the feather offset");
901 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
902
903 /* weight interpolation */
904 prop = RNA_def_property(srna, "weight_interpolation", PROP_ENUM, PROP_NONE);
905 RNA_def_property_enum_sdna(prop, nullptr, "weight_interp");
906 RNA_def_property_enum_items(prop, spline_interpolation_items);
908 prop, "Weight Interpolation", "The type of weight interpolation for spline");
909 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
910
911 /* cyclic */
912 prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
915 RNA_def_property_ui_text(prop, "Cyclic", "Make this spline a closed loop");
916 RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data");
917
918 /* fill */
919 prop = RNA_def_property(srna, "use_fill", PROP_BOOLEAN, PROP_NONE);
922 RNA_def_property_ui_text(prop, "Fill", "Make this spline filled");
924 RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data");
925
926 /* self-intersection check */
927 prop = RNA_def_property(srna, "use_self_intersection_check", PROP_BOOLEAN, PROP_NONE);
931 prop, "Self Intersection Check", "Prevent feather from self-intersections");
932 RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data");
933
934 prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
935 RNA_def_property_struct_type(prop, "MaskSplinePoint");
936 RNA_def_property_collection_sdna(prop, nullptr, "points", "tot_point");
937 RNA_def_property_ui_text(prop, "Points", "Collection of points");
938 RNA_def_property_srna(prop, "MaskSplinePoints");
939}
940
942{
943 static const EnumPropertyItem masklay_blend_mode_items[] = {
944 {MASK_BLEND_MERGE_ADD, "MERGE_ADD", 0, "Merge Add", ""},
945 {MASK_BLEND_MERGE_SUBTRACT, "MERGE_SUBTRACT", 0, "Merge Subtract", ""},
946 {MASK_BLEND_ADD, "ADD", 0, "Add", ""},
947 {MASK_BLEND_SUBTRACT, "SUBTRACT", 0, "Subtract", ""},
948 {MASK_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", ""},
949 {MASK_BLEND_DARKEN, "DARKEN", 0, "Darken", ""},
950 {MASK_BLEND_MUL, "MUL", 0, "Multiply", ""},
951 {MASK_BLEND_REPLACE, "REPLACE", 0, "Replace", ""},
952 {MASK_BLEND_DIFFERENCE, "DIFFERENCE", 0, "Difference", ""},
953 {0, nullptr, 0, nullptr, nullptr},
954 };
955
956 StructRNA *srna;
957 PropertyRNA *prop;
958
959 rna_def_maskSpline(brna);
962
963 srna = RNA_def_struct(brna, "MaskLayer", nullptr);
964 RNA_def_struct_ui_text(srna, "Mask Layer", "Single layer used for masking pixels");
965 RNA_def_struct_path_func(srna, "rna_MaskLayer_path");
966
967 /* name */
968 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
969 RNA_def_property_ui_text(prop, "Name", "Unique name of layer");
970 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_MaskLayer_name_set");
972 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
974
975 /* splines */
976 prop = RNA_def_property(srna, "splines", PROP_COLLECTION, PROP_NONE);
978 "rna_MaskLayer_splines_begin",
979 "rna_iterator_listbase_next",
980 "rna_iterator_listbase_end",
981 "rna_iterator_listbase_get",
982 nullptr,
983 nullptr,
984 nullptr,
985 nullptr);
986 RNA_def_property_struct_type(prop, "MaskSpline");
987 RNA_def_property_ui_text(prop, "Splines", "Collection of splines which defines this layer");
988 RNA_def_property_srna(prop, "MaskSplines");
989
990 /* restrict */
991 prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
992 RNA_def_property_boolean_sdna(prop, nullptr, "visibility_flag", MASK_HIDE_VIEW);
993 RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport");
994 RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1);
995 RNA_def_property_update(prop, NC_MASK | ND_DRAW, nullptr);
996
997 prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
998 RNA_def_property_boolean_sdna(prop, nullptr, "visibility_flag", MASK_HIDE_SELECT);
999 RNA_def_property_ui_text(prop, "Restrict Select", "Restrict selection in the viewport");
1000 RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, -1);
1001 RNA_def_property_update(prop, NC_MASK | ND_DRAW, nullptr);
1002
1003 prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
1004 RNA_def_property_boolean_sdna(prop, nullptr, "visibility_flag", MASK_HIDE_RENDER);
1005 RNA_def_property_ui_text(prop, "Restrict Render", "Restrict renderability");
1006 RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, -1);
1007 RNA_def_property_update(prop, NC_MASK | NA_EDITED, nullptr);
1008
1009 /* Select (for dope-sheet). */
1010 prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
1012 RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the Dope Sheet");
1013 // RNA_def_property_update(prop, NC_SCREEN | ND_MASK, nullptr);
1014
1015 /* render settings */
1016 prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE);
1017 RNA_def_property_float_sdna(prop, nullptr, "alpha");
1018 RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3);
1019 RNA_def_property_ui_text(prop, "Opacity", "Render Opacity");
1020 RNA_def_property_update(prop, NC_MASK | NA_EDITED, nullptr);
1021
1022 /* weight interpolation */
1023 prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
1024 RNA_def_property_enum_sdna(prop, nullptr, "blend");
1025 RNA_def_property_enum_items(prop, masklay_blend_mode_items);
1026 RNA_def_property_ui_text(prop, "Blend", "Method of blending mask layers");
1027 RNA_def_property_update(prop, 0, "rna_Mask_update_data");
1028 RNA_def_property_update(prop, NC_MASK | NA_EDITED, nullptr);
1029
1030 prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
1031 RNA_def_property_boolean_sdna(prop, nullptr, "blend_flag", MASK_BLENDFLAG_INVERT);
1032 RNA_def_property_ui_text(prop, "Restrict View", "Invert the mask black/white");
1033 RNA_def_property_update(prop, NC_MASK | NA_EDITED, nullptr);
1034
1035 prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE);
1036 RNA_def_property_enum_sdna(prop, nullptr, "falloff");
1038 RNA_def_property_ui_text(prop, "Falloff", "Falloff type of the feather");
1040 BLT_I18NCONTEXT_ID_CURVE_LEGACY); /* Abusing id_curve :/ */
1041 RNA_def_property_update(prop, NC_MASK | NA_EDITED, nullptr);
1042
1043 /* filling options */
1044 prop = RNA_def_property(srna, "use_fill_holes", PROP_BOOLEAN, PROP_NONE);
1047 prop, "Calculate Holes", "Calculate holes when filling overlapping curves");
1048 RNA_def_property_update(prop, NC_MASK | NA_EDITED, nullptr);
1049
1050 prop = RNA_def_property(srna, "use_fill_overlap", PROP_BOOLEAN, PROP_NONE);
1053 prop, "Calculate Overlap", "Calculate self intersections and overlap before filling");
1054 RNA_def_property_update(prop, NC_MASK | NA_EDITED, nullptr);
1055}
1056
1058{
1059 StructRNA *srna;
1060 PropertyRNA *prop;
1061
1062 FunctionRNA *func;
1063 PropertyRNA *parm;
1064
1065 RNA_def_property_srna(cprop, "MaskLayers");
1066 srna = RNA_def_struct(brna, "MaskLayers", nullptr);
1067 RNA_def_struct_sdna(srna, "Mask");
1068 RNA_def_struct_ui_text(srna, "Mask Layers", "Collection of layers used by mask");
1069
1070 func = RNA_def_function(srna, "new", "rna_Mask_layers_new");
1071 RNA_def_function_ui_description(func, "Add layer to this mask");
1072 RNA_def_string(func, "name", nullptr, 0, "Name", "Name of new layer");
1073 parm = RNA_def_pointer(func, "layer", "MaskLayer", "", "New mask layer");
1074 RNA_def_function_return(func, parm);
1075
1076 func = RNA_def_function(srna, "remove", "rna_Mask_layers_remove");
1078 RNA_def_function_ui_description(func, "Remove layer from this mask");
1079 parm = RNA_def_pointer(func, "layer", "MaskLayer", "", "Shape to be removed");
1082
1083 /* clear all layers */
1084 func = RNA_def_function(srna, "clear", "rna_Mask_layers_clear");
1085 RNA_def_function_ui_description(func, "Remove all mask layers");
1086
1087 /* active layer */
1088 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
1089 RNA_def_property_struct_type(prop, "MaskLayer");
1091 prop, "rna_Mask_layer_active_get", "rna_Mask_layer_active_set", nullptr, nullptr);
1093 RNA_def_property_ui_text(prop, "Active Shape", "Active layer in this mask");
1094}
1095
1096static void rna_def_mask(BlenderRNA *brna)
1097{
1098 StructRNA *srna;
1099 PropertyRNA *prop;
1100
1101 rna_def_mask_layer(brna);
1102
1103 srna = RNA_def_struct(brna, "Mask", "ID");
1104 RNA_def_struct_ui_text(srna, "Mask", "Mask data-block defining mask for compositing");
1105 RNA_def_struct_ui_icon(srna, ICON_MOD_MASK);
1106
1107 /* mask layers */
1108 prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
1110 "rna_Mask_layers_begin",
1111 "rna_iterator_listbase_next",
1112 "rna_iterator_listbase_end",
1113 "rna_iterator_listbase_get",
1114 nullptr,
1115 nullptr,
1116 nullptr,
1117 nullptr);
1118 RNA_def_property_struct_type(prop, "MaskLayer");
1119 RNA_def_property_ui_text(prop, "Layers", "Collection of layers which defines this mask");
1120 rna_def_masklayers(brna, prop);
1121
1122 /* active masklay index */
1123 prop = RNA_def_property(srna, "active_layer_index", PROP_INT, PROP_NONE);
1124 RNA_def_property_int_sdna(prop, nullptr, "masklay_act");
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");
1132 RNA_def_property_update(prop, NC_MASK | ND_DRAW, nullptr);
1133
1134 /* frame range */
1135 prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME);
1137 RNA_def_property_int_sdna(prop, nullptr, "sfra");
1138 RNA_def_property_int_funcs(prop, nullptr, "rna_Mask_start_frame_set", nullptr);
1140 RNA_def_property_ui_text(prop, "Start Frame", "First frame of the mask (used for sequencer)");
1141 RNA_def_property_update(prop, NC_MASK | ND_DRAW, nullptr);
1142
1143 prop = RNA_def_property(srna, "frame_end", PROP_INT, PROP_TIME);
1145 RNA_def_property_int_sdna(prop, nullptr, "efra");
1146 RNA_def_property_int_funcs(prop, nullptr, "rna_Mask_end_frame_set", nullptr);
1148 RNA_def_property_ui_text(prop, "End Frame", "Final frame of the mask (used for sequencer)");
1149 RNA_def_property_update(prop, NC_MASK | ND_DRAW, nullptr);
1150
1151 /* pointers */
1153}
1154
1156{
1157 rna_def_maskParent(brna);
1158 rna_def_mask(brna);
1159}
1160
1161#endif
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)
Definition report.cc:125
struct MovieTrackingPlaneTrack * BKE_tracking_object_find_plane_track_with_name(struct MovieTrackingObject *tracking_object, const char *name)
Definition tracking.cc:2005
struct MovieTrackingObject * BKE_tracking_object_get_named(struct MovieTracking *tracking, const char *name)
Definition tracking.cc:1966
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
Definition tracking.cc:1358
struct MovieTrackingPlaneMarker * BKE_tracking_plane_marker_get(struct MovieTrackingPlaneTrack *plane_track, int framenr)
Definition tracking.cc:1791
struct MovieTrackingTrack * BKE_tracking_object_find_track_with_name(struct MovieTrackingObject *tracking_object, const char *name)
Definition tracking.cc:1993
#define BLI_assert_msg(a, msg)
Definition BLI_assert.h:57
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)
Definition BLI_string.h:593
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 CLAMP(a, b, c)
#define BLT_I18NCONTEXT_ID_CURVE_LEGACY
#define BLT_I18NCONTEXT_ID_MASK
void DEG_id_tag_update(ID *id, unsigned int flags)
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1041
#define MAX_ID_NAME
Definition DNA_ID.h:377
@ ID_MC
@ HD_VECT
@ HD_FREE
@ HD_AUTO
@ HD_ALIGN_DOUBLESIDE
@ HD_ALIGN
#define DNA_struct_default_get(struct_name)
@ MASK_BLEND_ADD
@ MASK_BLEND_REPLACE
@ MASK_BLEND_DARKEN
@ MASK_BLEND_DIFFERENCE
@ MASK_BLEND_LIGHTEN
@ MASK_BLEND_MERGE_ADD
@ MASK_BLEND_SUBTRACT
@ MASK_BLEND_MUL
@ MASK_BLEND_MERGE_SUBTRACT
@ MASK_SPLINE_OFFSET_SMOOTH
@ MASK_SPLINE_OFFSET_EVEN
@ MASK_SPLINE_CYCLIC
@ MASK_SPLINE_NOINTERSECT
@ MASK_SPLINE_NOFILL
@ MASK_PARENT_PLANE_TRACK
@ MASK_PARENT_POINT_TRACK
@ MASK_HIDE_SELECT
@ MASK_HIDE_RENDER
@ MASK_HIDE_VIEW
@ MASK_SPLINE_INTERP_EASE
@ MASK_SPLINE_INTERP_LINEAR
@ MASK_BLENDFLAG_INVERT
@ MASK_LAYERFLAG_FILL_OVERLAP
@ MASK_LAYERFLAG_FILL_DISCRETE
@ MASK_LAYERFLAG_SELECT
Object is a sort of wrapper for general info.
#define MINFRAME
#define MAXFRAME
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)
ParameterFlag
Definition RNA_types.hh:396
@ PARM_RNAPTR
Definition RNA_types.hh:399
@ PARM_REQUIRED
Definition RNA_types.hh:397
@ FUNC_USE_REPORTS
Definition RNA_types.hh:680
@ FUNC_USE_SELF_ID
Definition RNA_types.hh:667
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_POINTER
Definition RNA_types.hh:70
@ PROP_COLLECTION
Definition RNA_types.hh:71
PropertyFlag
Definition RNA_types.hh:201
@ PROP_THICK_WRAP
Definition RNA_types.hh:312
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_NEVER_UNLINK
Definition RNA_types.hh:273
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_TIME
Definition RNA_types.hh:156
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_TRANSLATION
Definition RNA_types.hh:164
#define ND_DRAW
Definition WM_types.hh:428
#define ND_DATA
Definition WM_types.hh:475
#define NA_EDITED
Definition WM_types.hh:550
#define NC_MASK
Definition WM_types.hh:365
#define SELECT
int count
#define GS(x)
Definition iris.cc:202
void *(* MEM_mallocN)(size_t len, const char *str)
Definition mallocn.cc:44
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
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)
Definition rna_mask.cc:1096
static void rna_def_maskSplinePoints(BlenderRNA *brna)
Definition rna_mask.cc:840
static void rna_def_mask_layer(BlenderRNA *brna)
Definition rna_mask.cc:941
static void rna_def_masklayers(BlenderRNA *brna, PropertyRNA *cprop)
Definition rna_mask.cc:1057
static void rna_def_mask_splines(BlenderRNA *brna)
Definition rna_mask.cc:790
static void rna_def_maskSpline(BlenderRNA *brna)
Definition rna_mask.cc:868
static void rna_def_maskSplinePointUW(BlenderRNA *brna)
Definition rna_mask.cc:666
void RNA_def_mask(BlenderRNA *brna)
Definition rna_mask.cc:1155
static void rna_def_maskSplinePoint(BlenderRNA *brna)
Definition rna_mask.cc:696
static void rna_def_maskParent(BlenderRNA *brna)
Definition rna_mask.cc:603
static const EnumPropertyItem parent_type_items[]
const EnumPropertyItem rna_enum_proportional_falloff_curve_only_items[]
Definition rna_scene.cc:114
#define min(a, b)
Definition sort.c:32
float vec[3][3]
Definition DNA_ID.h:413
char name[66]
Definition DNA_ID.h:425
void * first
struct MaskLayer * next
ListBase splines
struct MaskSplinePoint * act_point
char name[64]
struct MaskSpline * act_spline
char parent[64]
float parent_orig[2]
float parent_corners_orig[4][2]
char sub_parent[64]
MaskParent parent
struct MaskSpline * next
ID * owner_id
Definition RNA_types.hh:40
void * data
Definition RNA_types.hh:42
float max
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126