Blender  V3.3
rna_gpencil.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stdlib.h>
8 
9 #include "BLI_math.h"
10 
11 #include "DNA_brush_types.h"
12 #include "DNA_curve_types.h"
13 #include "DNA_gpencil_types.h"
14 #include "DNA_meshdata_types.h"
15 #include "DNA_object_types.h"
16 #include "DNA_scene_types.h"
17 
18 #include "MEM_guardedalloc.h"
19 
20 #include "BLI_utildefines.h"
21 
22 #include "BLT_translation.h"
23 
24 #include "RNA_access.h"
25 #include "RNA_define.h"
26 #include "RNA_enum_types.h"
27 
28 #include "rna_internal.h"
29 
30 #include "WM_types.h"
31 
32 /* parent type */
34  {PAROBJECT, "OBJECT", 0, "Object", "The layer is parented to an object"},
35  {PARSKEL, "ARMATURE", 0, "Armature", ""},
36  {PARBONE, "BONE", 0, "Bone", "The layer is parented to a bone"},
37  {0, NULL, 0, NULL, NULL},
38 };
39 
40 #ifndef RNA_RUNTIME
43  "2D",
44  0,
45  "2D Layers",
46  "Display strokes using grease pencil layers to define order"},
47  {GP_DRAWMODE_3D, "3D", 0, "3D Location", "Display strokes using real 3D position in 3D space"},
48  {0, NULL, 0, NULL, NULL},
49 };
50 
53  "ABSOLUTE",
54  0,
55  "Frames",
56  "Frames in absolute range of the scene frame"},
58  "RELATIVE",
59  0,
60  "Keyframes",
61  "Frames in relative range of the Grease Pencil keyframes"},
62  {GP_ONION_MODE_SELECTED, "SELECTED", 0, "Selected", "Only selected keyframes"},
63  {0, NULL, 0, NULL, NULL},
64 };
65 
68  "KEYFRAME",
69  ICON_KEYTYPE_KEYFRAME_VEC,
70  "Keyframe",
71  "Normal keyframe - e.g. for key poses"},
73  "BREAKDOWN",
74  ICON_KEYTYPE_BREAKDOWN_VEC,
75  "Breakdown",
76  "A breakdown pose - e.g. for transitions between key poses"},
78  "MOVING_HOLD",
79  ICON_KEYTYPE_MOVING_HOLD_VEC,
80  "Moving Hold",
81  "A keyframe that is part of a moving hold"},
83  "EXTREME",
84  ICON_KEYTYPE_EXTREME_VEC,
85  "Extreme",
86  "An 'extreme' pose, or some other purpose as needed"},
88  "JITTER",
89  ICON_KEYTYPE_JITTER_VEC,
90  "Jitter",
91  "A filler or baked keyframe for keying on ones, or some other purpose as needed"},
92  {0, NULL, 0, NULL, NULL},
93 };
94 
96  {-1, "ALL", 0, "All", "Include all Keyframe types"},
98  "KEYFRAME",
99  ICON_KEYTYPE_KEYFRAME_VEC,
100  "Keyframe",
101  "Normal keyframe - e.g. for key poses"},
103  "BREAKDOWN",
104  ICON_KEYTYPE_BREAKDOWN_VEC,
105  "Breakdown",
106  "A breakdown pose - e.g. for transitions between key poses"},
108  "MOVING_HOLD",
109  ICON_KEYTYPE_MOVING_HOLD_VEC,
110  "Moving Hold",
111  "A keyframe that is part of a moving hold"},
113  "EXTREME",
114  ICON_KEYTYPE_EXTREME_VEC,
115  "Extreme",
116  "An 'extreme' pose, or some other purpose as needed"},
118  "JITTER",
119  ICON_KEYTYPE_JITTER_VEC,
120  "Jitter",
121  "A filler or baked keyframe for keying on ones, or some other purpose as needed"},
122  {0, NULL, 0, NULL, NULL},
123 };
124 
126  {-1, "UP", 0, "Up", ""},
127  {1, "DOWN", 0, "Down", ""},
128  {0, NULL, 0, NULL, NULL},
129 };
130 
132  {eGplBlendMode_Regular, "REGULAR", 0, "Regular", ""},
133  {eGplBlendMode_HardLight, "HARDLIGHT", 0, "Hard Light", ""},
134  {eGplBlendMode_Add, "ADD", 0, "Add", ""},
135  {eGplBlendMode_Subtract, "SUBTRACT", 0, "Subtract", ""},
136  {eGplBlendMode_Multiply, "MULTIPLY", 0, "Multiply", ""},
137  {eGplBlendMode_Divide, "DIVIDE", 0, "Divide", ""},
138  {0, NULL, 0, NULL, NULL}};
139 
141  {GP_STROKE_CAP_ROUND, "ROUND", 0, "Rounded", ""},
142  {GP_STROKE_CAP_FLAT, "FLAT", 0, "Flat", ""},
143  {0, NULL, 0, NULL, NULL},
144 };
145 #endif
146 
147 #ifdef RNA_RUNTIME
148 
149 # include "BLI_ghash.h"
150 # include "BLI_listbase.h"
151 # include "BLI_string_utils.h"
152 
153 # include "WM_api.h"
154 
155 # include "BKE_action.h"
156 # include "BKE_animsys.h"
157 # include "BKE_deform.h"
158 # include "BKE_gpencil.h"
159 # include "BKE_gpencil_curve.h"
160 # include "BKE_gpencil_geom.h"
161 # include "BKE_gpencil_update_cache.h"
162 # include "BKE_icons.h"
163 
164 # include "DEG_depsgraph.h"
165 # include "DEG_depsgraph_build.h"
166 
167 static void rna_GPencil_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
168 {
169 # if 0
170  /* In case a property on a layer changed, tag it with a light update. */
171  if (ptr->type == &RNA_GPencilLayer) {
173  }
174 # endif
177 }
178 
179 static void rna_GpencilLayerMatrix_update(Main *bmain, Scene *scene, PointerRNA *ptr)
180 {
181  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
182 
183  loc_eul_size_to_mat4(gpl->layer_mat, gpl->location, gpl->rotation, gpl->scale);
184  invert_m4_m4(gpl->layer_invmat, gpl->layer_mat);
185 
186  rna_GPencil_update(bmain, scene, ptr);
187 }
188 
189 static void rna_GPencil_curve_edit_mode_toggle(Main *bmain, Scene *scene, PointerRNA *ptr)
190 {
192  bGPdata *gpd = (bGPdata *)ptr->owner_id;
193 
194  /* Curve edit mode is turned on. */
196  /* If the current select mode is segment and the Bezier mode is on, change
197  * to Point because segment is not supported. */
200  }
201 
203  }
204  /* Curve edit mode is turned off. */
205  else {
207  }
208 
209  /* Standard update. */
210  rna_GPencil_update(bmain, scene, ptr);
211 }
212 
213 static void rna_GPencil_stroke_curve_update(Main *bmain, Scene *scene, PointerRNA *ptr)
214 {
215  bGPdata *gpd = (bGPdata *)ptr->owner_id;
216 
218  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
219  if (gpl->actframe != NULL) {
220  bGPDframe *gpf = gpl->actframe;
221  LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
222  if (gps->editcurve != NULL) {
223  gps->flag |= GP_STROKE_NEEDS_CURVE_UPDATE;
225  }
226  }
227  }
228  }
229  }
230 
231  rna_GPencil_update(bmain, scene, ptr);
232 }
233 
234 static void rna_GPencil_stroke_curve_resolution_update(Main *bmain, Scene *scene, PointerRNA *ptr)
235 {
236  bGPdata *gpd = (bGPdata *)ptr->owner_id;
237 
239  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
240  if (gpl->actframe != NULL) {
241  bGPDframe *gpf = gpl->actframe;
242  LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
243  if (gps->editcurve != NULL) {
244  gps->flag |= GP_STROKE_NEEDS_CURVE_UPDATE;
246  }
247  }
248  }
249  }
250  }
251  rna_GPencil_update(bmain, scene, ptr);
252 }
253 
254 static void rna_GPencil_dependency_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
255 {
259 
262 }
263 
264 static void rna_GPencil_uv_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
265 {
266  bGPdata *gpd = (bGPdata *)ptr->owner_id;
267  /* Force to recalc the UVs. */
268  bGPDstroke *gps = (bGPDstroke *)ptr->data;
269 
270  /* Calc geometry data. */
272 
275 }
276 
277 static void rna_GPencil_autolock(Main *bmain, Scene *scene, PointerRNA *ptr)
278 {
279  bGPdata *gpd = (bGPdata *)ptr->owner_id;
281 
282  /* standard update */
283  rna_GPencil_update(bmain, scene, ptr);
284 }
285 
286 static void rna_GPencil_editmode_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
287 {
288  bGPdata *gpd = (bGPdata *)ptr->owner_id;
290 
291  /* Notify all places where GPencil data lives that the editing state is different */
294 }
295 
296 /* Poll Callback to filter GP Datablocks to only show those for Annotations */
298 {
299  bGPdata *gpd = value.data;
300  return (gpd->flag & GP_DATA_ANNOTATIONS) != 0;
301 }
302 
303 /* Poll Callback to filter GP Datablocks to only show those for GP Objects */
305 {
306  bGPdata *gpd = value.data;
307  return (gpd->flag & GP_DATA_ANNOTATIONS) == 0;
308 }
309 
310 static char *rna_GPencilLayer_path(const PointerRNA *ptr)
311 {
312  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
313  char name_esc[sizeof(gpl->info) * 2];
314 
315  BLI_str_escape(name_esc, gpl->info, sizeof(name_esc));
316 
317  return BLI_sprintfN("layers[\"%s\"]", name_esc);
318 }
319 
320 static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr, const char **UNUSED(r_info))
321 {
322  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
323 
324  /* surely there must be other criteria too... */
325  if (gpl->flag & GP_LAYER_LOCKED) {
326  return 0;
327  }
328  else {
329  return PROP_EDITABLE;
330  }
331 }
332 
333 /* set parent */
334 static void set_parent(bGPDlayer *gpl, Object *par, const int type, const char *substr)
335 {
336  if (type == PAROBJECT) {
337  invert_m4_m4(gpl->inverse, par->obmat);
338  gpl->parent = par;
339  gpl->partype |= PAROBJECT;
340  gpl->parsubstr[0] = 0;
341  }
342  else if (type == PARSKEL) {
343  invert_m4_m4(gpl->inverse, par->obmat);
344  gpl->parent = par;
345  gpl->partype |= PARSKEL;
346  gpl->parsubstr[0] = 0;
347  }
348  else if (type == PARBONE) {
349  bPoseChannel *pchan = BKE_pose_channel_find_name(par->pose, substr);
350  if (pchan) {
351  float tmp_mat[4][4];
352  mul_m4_m4m4(tmp_mat, par->obmat, pchan->pose_mat);
353 
354  invert_m4_m4(gpl->inverse, tmp_mat);
355  gpl->parent = par;
356  gpl->partype |= PARBONE;
357  BLI_strncpy(gpl->parsubstr, substr, sizeof(gpl->parsubstr));
358  }
359  else {
360  invert_m4_m4(gpl->inverse, par->obmat);
361  gpl->parent = par;
362  gpl->partype |= PAROBJECT;
363  gpl->parsubstr[0] = 0;
364  }
365  }
366 }
367 
368 /* set parent object and inverse matrix */
369 static void rna_GPencilLayer_parent_set(PointerRNA *ptr,
370  PointerRNA value,
371  struct ReportList *UNUSED(reports))
372 {
373  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
374  Object *par = (Object *)value.data;
375 
376  if (par != NULL) {
377  set_parent(gpl, par, gpl->partype, gpl->parsubstr);
378  }
379  else {
380  /* clear parent */
381  gpl->parent = NULL;
382  }
383 }
384 
385 /* set parent type */
386 static void rna_GPencilLayer_parent_type_set(PointerRNA *ptr, int value)
387 {
388  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
389  Object *par = gpl->parent;
390  gpl->partype = value;
391 
392  if (par != NULL) {
393  set_parent(gpl, par, value, gpl->parsubstr);
394  }
395 }
396 
397 /* set parent bone */
398 static void rna_GPencilLayer_parent_bone_set(PointerRNA *ptr, const char *value)
399 {
400  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
401 
402  Object *par = gpl->parent;
403  gpl->partype = PARBONE;
404 
405  if (par != NULL) {
406  set_parent(gpl, par, gpl->partype, value);
407  }
408 }
409 
410 static char *rna_GPencilLayerMask_path(const PointerRNA *ptr)
411 {
412  bGPdata *gpd = (bGPdata *)ptr->owner_id;
415 
416  char gpl_info_esc[sizeof(gpl->info) * 2];
417  char mask_name_esc[sizeof(mask->name) * 2];
418 
419  BLI_str_escape(gpl_info_esc, gpl->info, sizeof(gpl_info_esc));
420  BLI_str_escape(mask_name_esc, mask->name, sizeof(mask_name_esc));
421 
422  return BLI_sprintfN("layers[\"%s\"].mask_layers[\"%s\"]", gpl_info_esc, mask_name_esc);
423 }
424 
425 static int rna_GPencil_active_mask_index_get(PointerRNA *ptr)
426 {
427  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
428  return gpl->act_mask - 1;
429 }
430 
431 static void rna_GPencil_active_mask_index_set(PointerRNA *ptr, int value)
432 {
433  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
434  gpl->act_mask = value + 1;
435 }
436 
437 static void rna_GPencil_active_mask_index_range(
438  PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
439 {
440  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
441 
442  *min = 0;
443  *max = max_ii(0, BLI_listbase_count(&gpl->mask_layers) - 1);
444 }
445 
446 /* parent types enum */
447 static const EnumPropertyItem *rna_Object_parent_type_itemf(bContext *UNUSED(C),
448  PointerRNA *ptr,
449  PropertyRNA *UNUSED(prop),
450  bool *r_free)
451 {
452  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
453  EnumPropertyItem *item = NULL;
454  int totitem = 0;
455 
457 
458  if (gpl->parent) {
459  Object *par = gpl->parent;
460 
461  if (par->type == OB_ARMATURE) {
462  /* special hack: prevents this being overridden */
463  RNA_enum_items_add_value(&item, &totitem, &parent_type_items[1], PARSKEL);
465  }
466  }
467 
468  RNA_enum_item_end(&item, &totitem);
469  *r_free = true;
470 
471  return item;
472 }
473 
474 static bool rna_GPencilLayer_is_parented_get(PointerRNA *ptr)
475 {
476  bGPDlayer *gpl = (bGPDlayer *)ptr->data;
477  return (gpl->parent != NULL);
478 }
479 
480 static PointerRNA rna_GPencil_active_layer_get(PointerRNA *ptr)
481 {
482  bGPdata *gpd = (bGPdata *)ptr->owner_id;
483 
484  if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */
485  bGPDlayer *gl;
486 
487  for (gl = gpd->layers.first; gl; gl = gl->next) {
488  if (gl->flag & GP_LAYER_ACTIVE) {
489  break;
490  }
491  }
492 
493  if (gl) {
494  return rna_pointer_inherit_refine(ptr, &RNA_GPencilLayer, gl);
495  }
496  }
497 
499 }
500 
501 static void rna_GPencil_active_layer_set(PointerRNA *ptr,
502  PointerRNA value,
503  struct ReportList *UNUSED(reports))
504 {
505  bGPdata *gpd = (bGPdata *)ptr->owner_id;
506 
507  /* Don't allow setting active layer to NULL if layers exist
508  * as this breaks various tools. Tools should be used instead
509  * if it's necessary to remove layers
510  */
511  if (value.data == NULL) {
512  printf("%s: Setting active layer to None is not allowed\n", __func__);
513  return;
514  }
515 
516  if (GS(gpd->id.name) == ID_GD) { /* why would this ever be not GD */
517  bGPDlayer *gl;
518 
519  for (gl = gpd->layers.first; gl; gl = gl->next) {
520  if (gl == value.data) {
521  gl->flag |= GP_LAYER_ACTIVE;
522  }
523  else {
524  gl->flag &= ~GP_LAYER_ACTIVE;
525  }
526  }
527 
529  }
530 }
531 
532 static int rna_GPencil_active_layer_index_get(PointerRNA *ptr)
533 {
534  bGPdata *gpd = (bGPdata *)ptr->owner_id;
536 
537  return BLI_findindex(&gpd->layers, gpl);
538 }
539 
540 static void rna_GPencil_active_layer_index_set(PointerRNA *ptr, int value)
541 {
542  bGPdata *gpd = (bGPdata *)ptr->owner_id;
543  bGPDlayer *gpl = BLI_findlink(&gpd->layers, value);
544 
546 
547  /* Now do standard updates... */
550 }
551 
552 static void rna_GPencil_active_layer_index_range(
553  PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
554 {
555  bGPdata *gpd = (bGPdata *)ptr->owner_id;
556 
557  *min = 0;
558  *max = max_ii(0, BLI_listbase_count(&gpd->layers) - 1);
559 
560  *softmin = *min;
561  *softmax = *max;
562 }
563 
564 static const EnumPropertyItem *rna_GPencil_active_layer_itemf(bContext *C,
565  PointerRNA *ptr,
566  PropertyRNA *UNUSED(prop),
567  bool *r_free)
568 {
569  bGPdata *gpd = (bGPdata *)ptr->owner_id;
570  bGPDlayer *gpl;
571  EnumPropertyItem *item = NULL, item_tmp = {0};
572  int totitem = 0;
573  int i = 0;
574 
575  if (ELEM(NULL, C, gpd)) {
576  return DummyRNA_NULL_items;
577  }
578 
579  /* Existing layers */
580  for (gpl = gpd->layers.first, i = 0; gpl; gpl = gpl->next, i++) {
581  item_tmp.identifier = gpl->info;
582  item_tmp.name = gpl->info;
583  item_tmp.value = i;
584 
585  item_tmp.icon = (gpd->flag & GP_DATA_ANNOTATIONS) ? BKE_icon_gplayer_color_ensure(gpl) :
586  ICON_GREASEPENCIL;
587 
588  RNA_enum_item_add(&item, &totitem, &item_tmp);
589  }
590 
591  RNA_enum_item_end(&item, &totitem);
592  *r_free = true;
593 
594  return item;
595 }
596 
597 static void rna_GPencilLayer_info_set(PointerRNA *ptr, const char *value)
598 {
599  bGPdata *gpd = (bGPdata *)ptr->owner_id;
600  bGPDlayer *gpl = ptr->data;
601 
602  char oldname[128] = "";
603  BLI_strncpy(oldname, gpl->info, sizeof(oldname));
604 
605  /* copy the new name into the name slot */
606  BLI_strncpy_utf8(gpl->info, value, sizeof(gpl->info));
607 
609  &gpd->layers, gpl, DATA_("GP_Layer"), '.', offsetof(bGPDlayer, info), sizeof(gpl->info));
610 
611  /* now fix animation paths */
612  BKE_animdata_fix_paths_rename_all(&gpd->id, "layers", oldname, gpl->info);
613 
614  /* Fix mask layers. */
615  LISTBASE_FOREACH (bGPDlayer *, gpl_, &gpd->layers) {
616  LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl_->mask_layers) {
617  if (STREQ(mask->name, oldname)) {
618  BLI_strncpy(mask->name, gpl->info, sizeof(mask->name));
619  }
620  }
621  }
622 }
623 
624 static void rna_GPencilLayer_mask_info_set(PointerRNA *ptr, const char *value)
625 {
626  bGPdata *gpd = (bGPdata *)ptr->owner_id;
628  char oldname[128] = "";
629  BLI_strncpy(oldname, mask->name, sizeof(oldname));
630 
631  /* Really is changing the layer name. */
632  bGPDlayer *gpl = BKE_gpencil_layer_named_get(gpd, oldname);
633  if (gpl) {
634  /* copy the new name into the name slot */
635  BLI_strncpy_utf8(gpl->info, value, sizeof(gpl->info));
636 
638  &gpd->layers, gpl, DATA_("GP_Layer"), '.', offsetof(bGPDlayer, info), sizeof(gpl->info));
639 
640  /* now fix animation paths */
641  BKE_animdata_fix_paths_rename_all(&gpd->id, "layers", oldname, gpl->info);
642 
643  /* Fix mask layers. */
644  LISTBASE_FOREACH (bGPDlayer *, gpl_, &gpd->layers) {
645  LISTBASE_FOREACH (bGPDlayer_Mask *, mask_, &gpl_->mask_layers) {
646  if (STREQ(mask_->name, oldname)) {
647  BLI_strncpy(mask_->name, gpl->info, sizeof(mask_->name));
648  }
649  }
650  }
651  }
652 }
653 
654 static bGPDstroke *rna_GPencil_stroke_point_find_stroke(const bGPdata *gpd,
655  const bGPDspoint *pt,
656  bGPDlayer **r_gpl,
657  bGPDframe **r_gpf)
658 {
659  bGPDlayer *gpl;
660  bGPDstroke *gps;
661 
662  /* sanity checks */
663  if (ELEM(NULL, gpd, pt)) {
664  return NULL;
665  }
666 
667  if (r_gpl) {
668  *r_gpl = NULL;
669  }
670  if (r_gpf) {
671  *r_gpf = NULL;
672  }
673 
674  /* there's no faster alternative than just looping over everything... */
675  for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
676  if (gpl->actframe) {
677  for (gps = gpl->actframe->strokes.first; gps; gps = gps->next) {
678  if ((pt >= gps->points) && (pt < &gps->points[gps->totpoints])) {
679  /* found it */
680  if (r_gpl) {
681  *r_gpl = gpl;
682  }
683  if (r_gpf) {
684  *r_gpf = gpl->actframe;
685  }
686 
687  return gps;
688  }
689  }
690  }
691  }
692 
693  /* didn't find it */
694  return NULL;
695 }
696 
697 static void rna_GPencil_stroke_point_select_set(PointerRNA *ptr, const bool value)
698 {
699  bGPdata *gpd = (bGPdata *)ptr->owner_id;
700  bGPDspoint *pt = ptr->data;
701  bGPDstroke *gps = NULL;
702 
703  /* Ensure that corresponding stroke is set
704  * - Since we don't have direct access, we're going to have to search
705  * - We don't apply selection value unless we can find the corresponding
706  * stroke, so that they don't get out of sync
707  */
708  gps = rna_GPencil_stroke_point_find_stroke(gpd, pt, NULL, NULL);
709  if (gps) {
710  /* Set the new selection state for the point */
711  if (value) {
712  pt->flag |= GP_SPOINT_SELECT;
713  }
714  else {
715  pt->flag &= ~GP_SPOINT_SELECT;
716  }
717 
718  /* Check if the stroke should be selected or not... */
720  }
721 }
722 
723 static void rna_GPencil_stroke_point_add(
724  ID *id, bGPDstroke *stroke, int count, float pressure, float strength)
725 {
726  bGPdata *gpd = (bGPdata *)id;
727 
728  if (count > 0) {
729  /* create space at the end of the array for extra points */
730  stroke->points = MEM_recallocN_id(
731  stroke->points, sizeof(bGPDspoint) * (stroke->totpoints + count), "gp_stroke_points");
732  stroke->dvert = MEM_recallocN_id(
733  stroke->dvert, sizeof(MDeformVert) * (stroke->totpoints + count), "gp_stroke_weight");
734 
735  /* init the pressure and strength values so that old scripts won't need to
736  * be modified to give these initial values...
737  */
738  for (int i = 0; i < count; i++) {
739  bGPDspoint *pt = stroke->points + (stroke->totpoints + i);
740  MDeformVert *dvert = stroke->dvert + (stroke->totpoints + i);
741  pt->pressure = pressure;
742  pt->strength = strength;
743 
744  dvert->totweight = 0;
745  dvert->dw = NULL;
746  }
747 
748  stroke->totpoints += count;
749 
750  /* Calc geometry data. */
752 
753  DEG_id_tag_update(&gpd->id,
755 
757  }
758 }
759 
760 static void rna_GPencil_stroke_point_pop(ID *id,
761  bGPDstroke *stroke,
762  ReportList *reports,
763  int index)
764 {
765  bGPdata *gpd = (bGPdata *)id;
766  bGPDspoint *pt_tmp = stroke->points;
767  MDeformVert *pt_dvert = stroke->dvert;
768 
769  /* python style negative indexing */
770  if (index < 0) {
771  index += stroke->totpoints;
772  }
773 
774  if (stroke->totpoints <= index || index < 0) {
775  BKE_report(reports, RPT_ERROR, "GPencilStrokePoints.pop: index out of range");
776  return;
777  }
778 
779  stroke->totpoints--;
780 
781  stroke->points = MEM_callocN(sizeof(bGPDspoint) * stroke->totpoints, "gp_stroke_points");
782  if (pt_dvert != NULL) {
783  stroke->dvert = MEM_callocN(sizeof(MDeformVert) * stroke->totpoints, "gp_stroke_weights");
784  }
785 
786  if (index > 0) {
787  memcpy(stroke->points, pt_tmp, sizeof(bGPDspoint) * index);
788  /* verify weight data is available */
789  if (pt_dvert != NULL) {
790  memcpy(stroke->dvert, pt_dvert, sizeof(MDeformVert) * index);
791  }
792  }
793 
794  if (index < stroke->totpoints) {
795  memcpy(&stroke->points[index],
796  &pt_tmp[index + 1],
797  sizeof(bGPDspoint) * (stroke->totpoints - index));
798  if (pt_dvert != NULL) {
799  memcpy(&stroke->dvert[index],
800  &pt_dvert[index + 1],
801  sizeof(MDeformVert) * (stroke->totpoints - index));
802  }
803  }
804 
805  /* free temp buffer */
806  MEM_freeN(pt_tmp);
807  if (pt_dvert != NULL) {
808  MEM_freeN(pt_dvert);
809  }
810 
811  /* Calc geometry data. */
813 
815 
817 }
818 
819 static void rna_GPencil_stroke_point_update(ID *id, bGPDstroke *stroke)
820 {
821  bGPdata *gpd = (bGPdata *)id;
822 
823  /* Calc geometry data. */
824  if (stroke) {
826 
827  DEG_id_tag_update(&gpd->id,
829 
831  }
832 }
833 
834 static float rna_GPencilStrokePoints_weight_get(bGPDstroke *stroke,
835  ReportList *reports,
836  int vertex_group_index,
837  int point_index)
838 {
839  MDeformVert *dvert = stroke->dvert;
840  if (dvert == NULL) {
841  BKE_report(reports, RPT_ERROR, "Groups: No groups for this stroke");
842  return -1.0f;
843  }
844 
845  if (stroke->totpoints <= point_index || point_index < 0) {
846  BKE_report(reports, RPT_ERROR, "GPencilStrokePoints: index out of range");
847  return -1.0f;
848  }
849 
850  MDeformVert *pt_dvert = stroke->dvert + point_index;
851 
852  MDeformWeight *dw = BKE_defvert_find_index(pt_dvert, vertex_group_index);
853  if (dw) {
854  return dw->weight;
855  }
856 
857  return -1.0f;
858 }
859 
860 static void rna_GPencilStrokePoints_weight_set(
861  bGPDstroke *stroke, ReportList *reports, int vertex_group_index, int point_index, float weight)
862 {
863  BKE_gpencil_dvert_ensure(stroke);
864 
865  MDeformVert *dvert = stroke->dvert;
866  if (dvert == NULL) {
867  BKE_report(reports, RPT_ERROR, "Groups: No groups for this stroke");
868  return;
869  }
870 
871  if (stroke->totpoints <= point_index || point_index < 0) {
872  BKE_report(reports, RPT_ERROR, "GPencilStrokePoints: index out of range");
873  return;
874  }
875 
876  MDeformVert *pt_dvert = stroke->dvert + point_index;
877  MDeformWeight *dw = BKE_defvert_ensure_index(pt_dvert, vertex_group_index);
878  if (dw) {
879  dw->weight = weight;
880  }
881 }
882 
883 static bGPDstroke *rna_GPencil_stroke_new(bGPDframe *frame)
884 {
885  bGPDstroke *stroke = BKE_gpencil_stroke_new(0, 0, 1.0f);
886  BLI_addtail(&frame->strokes, stroke);
887 
888  return stroke;
889 }
890 
891 static void rna_GPencil_stroke_remove(ID *id,
892  bGPDframe *frame,
893  ReportList *reports,
894  PointerRNA *stroke_ptr)
895 {
896  bGPdata *gpd = (bGPdata *)id;
897 
898  bGPDstroke *stroke = stroke_ptr->data;
899  if (BLI_findindex(&frame->strokes, stroke) == -1) {
900  BKE_report(reports, RPT_ERROR, "Stroke not found in grease pencil frame");
901  return;
902  }
903 
904  BLI_remlink(&frame->strokes, stroke);
905  BKE_gpencil_free_stroke(stroke);
906  RNA_POINTER_INVALIDATE(stroke_ptr);
907 
910 }
911 
912 static void rna_GPencil_stroke_close(ID *id,
913  bGPDframe *frame,
914  ReportList *reports,
915  PointerRNA *stroke_ptr)
916 {
917  bGPdata *gpd = (bGPdata *)id;
918  bGPDstroke *stroke = stroke_ptr->data;
919  if (BLI_findindex(&frame->strokes, stroke) == -1) {
920  BKE_report(reports, RPT_ERROR, "Stroke not found in grease pencil frame");
921  return;
922  }
923 
924  BKE_gpencil_stroke_close(stroke);
925 
928 }
929 
930 static void rna_GPencil_stroke_select_set(PointerRNA *ptr, const bool value)
931 {
932  bGPdata *gpd = (bGPdata *)ptr->owner_id;
933  bGPDstroke *gps = ptr->data;
934  bGPDspoint *pt;
935  int i;
936 
937  /* set new value */
938  if (value) {
939  gps->flag |= GP_STROKE_SELECT;
941  }
942  else {
943  gps->flag &= ~GP_STROKE_SELECT;
945  }
946 
947  /* ensure that the stroke's points are selected in the same way */
948  for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) {
949  if (value) {
950  pt->flag |= GP_SPOINT_SELECT;
951  }
952  else {
953  pt->flag &= ~GP_SPOINT_SELECT;
954  }
955  }
956 }
957 
958 static void rna_GPencil_curve_select_set(PointerRNA *ptr, const bool value)
959 {
960  bGPDcurve *gpc = ptr->data;
961 
962  /* Set new value. */
963  if (value) {
964  gpc->flag |= GP_CURVE_SELECT;
965  }
966  else {
967  gpc->flag &= ~GP_CURVE_SELECT;
968  }
969  /* Ensure that the curves's points are selected in the same way. */
970  for (int i = 0; i < gpc->tot_curve_points; i++) {
971  bGPDcurve_point *gpc_pt = &gpc->curve_points[i];
972  BezTriple *bezt = &gpc_pt->bezt;
973  if (value) {
974  gpc_pt->flag |= GP_CURVE_POINT_SELECT;
975  BEZT_SEL_ALL(bezt);
976  }
977  else {
978  gpc_pt->flag &= ~GP_CURVE_POINT_SELECT;
979  BEZT_DESEL_ALL(bezt);
980  }
981  }
982 }
983 
984 static bGPDframe *rna_GPencil_frame_new(bGPDlayer *layer,
985  ReportList *reports,
986  int frame_number,
987  bool active)
988 {
989  bGPDframe *frame;
990 
991  if (BKE_gpencil_layer_frame_find(layer, frame_number)) {
992  BKE_reportf(reports, RPT_ERROR, "Frame already exists on this frame number %d", frame_number);
993  return NULL;
994  }
995 
996  frame = BKE_gpencil_frame_addnew(layer, frame_number);
997  if (active) {
998  layer->actframe = BKE_gpencil_layer_frame_get(layer, frame_number, GP_GETFRAME_USE_PREV);
999  }
1001 
1002  return frame;
1003 }
1004 
1005 static void rna_GPencil_frame_remove(bGPDlayer *layer, ReportList *reports, PointerRNA *frame_ptr)
1006 {
1007  bGPDframe *frame = frame_ptr->data;
1008  if (BLI_findindex(&layer->frames, frame) == -1) {
1009  BKE_report(reports, RPT_ERROR, "Frame not found in grease pencil layer");
1010  return;
1011  }
1012 
1013  BKE_gpencil_layer_frame_delete(layer, frame);
1014  RNA_POINTER_INVALIDATE(frame_ptr);
1015 
1017 }
1018 
1019 static bGPDframe *rna_GPencil_frame_copy(bGPDlayer *layer, bGPDframe *src)
1020 {
1021  bGPDframe *frame = BKE_gpencil_frame_duplicate(src, true);
1022 
1023  while (BKE_gpencil_layer_frame_find(layer, frame->framenum)) {
1024  frame->framenum++;
1025  }
1026 
1027  BLI_addtail(&layer->frames, frame);
1028 
1030 
1031  return frame;
1032 }
1033 
1034 static bGPDlayer *rna_GPencil_layer_new(bGPdata *gpd, const char *name, bool setactive)
1035 {
1036  bGPDlayer *gpl = BKE_gpencil_layer_addnew(gpd, name, setactive != 0, false);
1037 
1039 
1040  return gpl;
1041 }
1042 
1043 static void rna_GPencil_layer_remove(bGPdata *gpd, ReportList *reports, PointerRNA *layer_ptr)
1044 {
1045  bGPDlayer *layer = layer_ptr->data;
1046  if (BLI_findindex(&gpd->layers, layer) == -1) {
1047  BKE_report(reports, RPT_ERROR, "Layer not found in grease pencil data");
1048  return;
1049  }
1050 
1051  BKE_gpencil_layer_delete(gpd, layer);
1052  RNA_POINTER_INVALIDATE(layer_ptr);
1053 
1055 }
1056 
1057 static void rna_GPencil_layer_move(bGPdata *gpd,
1058  ReportList *reports,
1059  PointerRNA *layer_ptr,
1060  int type)
1061 {
1062  bGPDlayer *gpl = layer_ptr->data;
1063  if (BLI_findindex(&gpd->layers, gpl) == -1) {
1064  BKE_report(reports, RPT_ERROR, "Layer not found in grease pencil data");
1065  return;
1066  }
1067 
1068  BLI_assert(ELEM(type, -1, 0, 1)); /* we use value below */
1069 
1070  const int direction = type * -1;
1071 
1072  if (BLI_listbase_link_move(&gpd->layers, gpl, direction)) {
1074  }
1075 
1077 }
1078 
1079 static void rna_GPencil_layer_mask_add(bGPDlayer *gpl, PointerRNA *layer_ptr)
1080 {
1081  bGPDlayer *gpl_mask = layer_ptr->data;
1082 
1083  BKE_gpencil_layer_mask_add(gpl, gpl_mask->info);
1084 
1086 }
1087 
1088 static void rna_GPencil_layer_mask_remove(bGPDlayer *gpl,
1089  ReportList *reports,
1090  PointerRNA *mask_ptr)
1091 {
1092  bGPDlayer_Mask *mask = mask_ptr->data;
1093  if (BLI_findindex(&gpl->mask_layers, mask) == -1) {
1094  BKE_report(reports, RPT_ERROR, "Mask not found in mask list");
1095  return;
1096  }
1097 
1099  RNA_POINTER_INVALIDATE(mask_ptr);
1100 
1102 }
1103 
1104 static void rna_GPencil_frame_clear(bGPDframe *frame)
1105 {
1106  BKE_gpencil_free_strokes(frame);
1107 
1109 }
1110 
1111 static void rna_GPencil_layer_clear(bGPDlayer *layer)
1112 {
1113  BKE_gpencil_free_frames(layer);
1114 
1116 }
1117 
1118 static void rna_GPencil_clear(bGPdata *gpd)
1119 {
1121 
1123 }
1124 
1125 static char *rna_GreasePencilGrid_path(const PointerRNA *UNUSED(ptr))
1126 {
1127  return BLI_strdup("grid");
1128 }
1129 
1130 static void rna_GpencilCurvePoint_BezTriple_handle1_get(PointerRNA *ptr, float *values)
1131 {
1133  copy_v3_v3(values, cpt->bezt.vec[0]);
1134 }
1135 
1136 static void rna_GpencilCurvePoint_BezTriple_handle1_set(PointerRNA *ptr, const float *values)
1137 {
1139  copy_v3_v3(cpt->bezt.vec[0], values);
1140 }
1141 
1142 static bool rna_GpencilCurvePoint_BezTriple_handle1_select_get(PointerRNA *ptr)
1143 {
1145  return cpt->bezt.f1;
1146 }
1147 
1148 static void rna_GpencilCurvePoint_BezTriple_handle1_select_set(PointerRNA *ptr, const bool value)
1149 {
1151  cpt->bezt.f1 = value;
1152 }
1153 
1154 static void rna_GpencilCurvePoint_BezTriple_handle2_get(PointerRNA *ptr, float *values)
1155 {
1157  copy_v3_v3(values, cpt->bezt.vec[2]);
1158 }
1159 
1160 static void rna_GpencilCurvePoint_BezTriple_handle2_set(PointerRNA *ptr, const float *values)
1161 {
1163  copy_v3_v3(cpt->bezt.vec[2], values);
1164 }
1165 
1166 static bool rna_GpencilCurvePoint_BezTriple_handle2_select_get(PointerRNA *ptr)
1167 {
1169  return cpt->bezt.f3;
1170 }
1171 
1172 static void rna_GpencilCurvePoint_BezTriple_handle2_select_set(PointerRNA *ptr, const bool value)
1173 {
1175  cpt->bezt.f3 = value;
1176 }
1177 
1178 static void rna_GpencilCurvePoint_BezTriple_ctrlpoint_get(PointerRNA *ptr, float *values)
1179 {
1181  copy_v3_v3(values, cpt->bezt.vec[1]);
1182 }
1183 
1184 static void rna_GpencilCurvePoint_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values)
1185 {
1187  copy_v3_v3(cpt->bezt.vec[1], values);
1188 }
1189 
1190 static bool rna_GpencilCurvePoint_BezTriple_ctrlpoint_select_get(PointerRNA *ptr)
1191 {
1193  return cpt->bezt.f2;
1194 }
1195 
1196 static void rna_GpencilCurvePoint_BezTriple_ctrlpoint_select_set(PointerRNA *ptr, const bool value)
1197 {
1199  cpt->bezt.f2 = value;
1200 }
1201 
1202 static bool rna_GpencilCurvePoint_BezTriple_hide_get(PointerRNA *ptr)
1203 {
1205  return (bool)cpt->bezt.hide;
1206 }
1207 
1208 static void rna_GpencilCurvePoint_BezTriple_hide_set(PointerRNA *ptr, const bool value)
1209 {
1211  cpt->bezt.hide = value;
1212 }
1213 
1214 static bool rna_stroke_has_edit_curve_get(PointerRNA *ptr)
1215 {
1216  bGPDstroke *gps = (bGPDstroke *)ptr->data;
1217  if (gps->editcurve != NULL) {
1218  return true;
1219  }
1220 
1221  return false;
1222 }
1223 
1224 #else
1225 
1227 {
1228  StructRNA *srna;
1229  PropertyRNA *prop;
1230 
1231  srna = RNA_def_struct(brna, "GPencilStrokePoint", NULL);
1232  RNA_def_struct_sdna(srna, "bGPDspoint");
1234  srna, "Grease Pencil Stroke Point", "Data point for freehand stroke curve");
1235 
1236  prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
1237  RNA_def_property_float_sdna(prop, NULL, "x");
1238  RNA_def_property_array(prop, 3);
1239  RNA_def_property_ui_text(prop, "Coordinates", "");
1240  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1241 
1242  prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_FACTOR);
1243  RNA_def_property_float_sdna(prop, NULL, "pressure");
1244  RNA_def_property_range(prop, 0.0f, FLT_MAX);
1245  RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it");
1246  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1247 
1248  prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
1249  RNA_def_property_float_sdna(prop, NULL, "strength");
1250  RNA_def_property_range(prop, 0.0f, 1.0f);
1251  RNA_def_property_ui_text(prop, "Strength", "Color intensity (alpha factor)");
1252  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1253 
1254  prop = RNA_def_property(srna, "uv_factor", PROP_FLOAT, PROP_FACTOR);
1255  RNA_def_property_float_sdna(prop, NULL, "uv_fac");
1256  RNA_def_property_range(prop, 0.0f, 1.0f);
1257  RNA_def_property_ui_text(prop, "UV Factor", "Internal UV factor");
1258  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1259 
1260  prop = RNA_def_property(srna, "uv_rotation", PROP_FLOAT, PROP_ANGLE);
1261  RNA_def_property_float_sdna(prop, NULL, "uv_rot");
1263  RNA_def_property_ui_text(prop, "UV Rotation", "Internal UV factor for dot mode");
1264  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1265 
1266  prop = RNA_def_property(srna, "uv_fill", PROP_FLOAT, PROP_XYZ);
1267  RNA_def_property_float_sdna(prop, NULL, "uv_fill");
1268  RNA_def_property_array(prop, 2);
1269  RNA_def_property_ui_text(prop, "UV Fill", "Internal UV factor for filling");
1270  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1271 
1272  prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
1274  RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencil_stroke_point_select_set");
1275  RNA_def_property_ui_text(prop, "Select", "Point is selected for viewport editing");
1276  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1277 
1278  /* Vertex color. */
1279  prop = RNA_def_property(srna, "vertex_color", PROP_FLOAT, PROP_COLOR);
1280  RNA_def_property_float_sdna(prop, NULL, "vert_color");
1281  RNA_def_property_array(prop, 4);
1282  RNA_def_property_range(prop, 0.0f, 1.0f);
1285  prop, "Vertex Color", "Color used to mix with point color to get final color");
1286  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1287 }
1288 
1290 {
1291  StructRNA *srna;
1292  FunctionRNA *func;
1293  PropertyRNA *parm;
1294 
1295  RNA_def_property_srna(cprop, "GPencilStrokePoints");
1296  srna = RNA_def_struct(brna, "GPencilStrokePoints", NULL);
1297  RNA_def_struct_sdna(srna, "bGPDstroke");
1299  srna, "Grease Pencil Stroke Points", "Collection of grease pencil stroke points");
1300 
1301  func = RNA_def_function(srna, "add", "rna_GPencil_stroke_point_add");
1302  RNA_def_function_ui_description(func, "Add a new grease pencil stroke point");
1304  parm = RNA_def_int(
1305  func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the stroke", 0, INT_MAX);
1307  RNA_def_float(func,
1308  "pressure",
1309  1.0f,
1310  0.0f,
1311  FLT_MAX,
1312  "Pressure",
1313  "Pressure for newly created points",
1314  0.0f,
1315  FLT_MAX);
1316  RNA_def_float(func,
1317  "strength",
1318  1.0f,
1319  0.0f,
1320  1.0f,
1321  "Strength",
1322  "Color intensity (alpha factor) for newly created points",
1323  0.0f,
1324  1.0f);
1325 
1326  func = RNA_def_function(srna, "pop", "rna_GPencil_stroke_point_pop");
1327  RNA_def_function_ui_description(func, "Remove a grease pencil stroke point");
1329  RNA_def_int(func, "index", -1, INT_MIN, INT_MAX, "Index", "point index", INT_MIN, INT_MAX);
1330 
1331  func = RNA_def_function(srna, "update", "rna_GPencil_stroke_point_update");
1332  RNA_def_function_ui_description(func, "Recalculate internal triangulation data");
1334 
1335  func = RNA_def_function(srna, "weight_get", "rna_GPencilStrokePoints_weight_get");
1336  RNA_def_function_ui_description(func, "Get vertex group point weight");
1338  RNA_def_int(func,
1339  "vertex_group_index",
1340  0,
1341  0,
1342  INT_MAX,
1343  "Vertex Group Index",
1344  "Index of Vertex Group in the array of groups",
1345  0,
1346  INT_MAX);
1347  RNA_def_int(func,
1348  "point_index",
1349  0,
1350  0,
1351  INT_MAX,
1352  "Point Index",
1353  "Index of the Point in the array",
1354  0,
1355  INT_MAX);
1356  parm = RNA_def_float(
1357  func, "weight", 0, -FLT_MAX, FLT_MAX, "Weight", "Point Weight", -FLT_MAX, FLT_MAX);
1358  RNA_def_function_return(func, parm);
1359 
1360  func = RNA_def_function(srna, "weight_set", "rna_GPencilStrokePoints_weight_set");
1361  RNA_def_function_ui_description(func, "Set vertex group point weight");
1363  RNA_def_int(func,
1364  "vertex_group_index",
1365  0,
1366  0,
1367  INT_MAX,
1368  "Vertex Group Index",
1369  "Index of Vertex Group in the array of groups",
1370  0,
1371  INT_MAX);
1372  RNA_def_int(func,
1373  "point_index",
1374  0,
1375  0,
1376  INT_MAX,
1377  "Point Index",
1378  "Index of the Point in the array",
1379  0,
1380  INT_MAX);
1381  RNA_def_float(func, "weight", 0, -FLT_MAX, FLT_MAX, "Weight", "Point Weight", -FLT_MAX, FLT_MAX);
1382 }
1383 
1384 /* This information is read only and it can be used by add-ons */
1386 {
1387  StructRNA *srna;
1388  PropertyRNA *prop;
1389 
1390  srna = RNA_def_struct(brna, "GPencilTriangle", NULL);
1391  RNA_def_struct_sdna(srna, "bGPDtriangle");
1392  RNA_def_struct_ui_text(srna, "Triangle", "Triangulation data for Grease Pencil fills");
1393 
1394  /* point v1 */
1395  prop = RNA_def_property(srna, "v1", PROP_INT, PROP_NONE);
1396  RNA_def_property_int_sdna(prop, NULL, "verts[0]");
1397  RNA_def_property_ui_text(prop, "v1", "First triangle vertex index");
1399 
1400  /* point v2 */
1401  prop = RNA_def_property(srna, "v2", PROP_INT, PROP_NONE);
1402  RNA_def_property_int_sdna(prop, NULL, "verts[1]");
1403  RNA_def_property_ui_text(prop, "v2", "Second triangle vertex index");
1405 
1406  /* point v3 */
1407  prop = RNA_def_property(srna, "v3", PROP_INT, PROP_NONE);
1408  RNA_def_property_int_sdna(prop, NULL, "verts[2]");
1409  RNA_def_property_ui_text(prop, "v3", "Third triangle vertex index");
1411 }
1412 
1414 {
1415  StructRNA *srna;
1416  PropertyRNA *prop;
1417 
1418  srna = RNA_def_struct(brna, "GPencilEditCurvePoint", NULL);
1419  RNA_def_struct_sdna(srna, "bGPDcurve_point");
1420  RNA_def_struct_ui_text(srna, "Bezier Curve Point", "Bezier curve point with two handles");
1421 
1422  /* Boolean values */
1423  prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
1425  "rna_GpencilCurvePoint_BezTriple_handle1_select_get",
1426  "rna_GpencilCurvePoint_BezTriple_handle1_select_set");
1427  RNA_def_property_ui_text(prop, "Handle 1 selected", "Handle 1 selection status");
1428  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1429 
1430  prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
1432  "rna_GpencilCurvePoint_BezTriple_handle2_select_get",
1433  "rna_GpencilCurvePoint_BezTriple_handle2_select_set");
1434  RNA_def_property_ui_text(prop, "Handle 2 selected", "Handle 2 selection status");
1435  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1436 
1437  prop = RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE);
1439  "rna_GpencilCurvePoint_BezTriple_ctrlpoint_select_get",
1440  "rna_GpencilCurvePoint_BezTriple_ctrlpoint_select_set");
1441  RNA_def_property_ui_text(prop, "Control Point selected", "Control point selection status");
1442  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1443 
1444  prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
1446  "rna_GpencilCurvePoint_BezTriple_hide_get",
1447  "rna_GpencilCurvePoint_BezTriple_hide_set");
1448  RNA_def_property_ui_text(prop, "Hide", "Visibility status");
1449  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1450 
1451  /* Vector values */
1452  prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
1453  RNA_def_property_array(prop, 3);
1455  "rna_GpencilCurvePoint_BezTriple_handle1_get",
1456  "rna_GpencilCurvePoint_BezTriple_handle1_set",
1457  NULL);
1459  RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
1460  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
1461  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_stroke_curve_update");
1462 
1463  prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
1464  RNA_def_property_array(prop, 3);
1466  "rna_GpencilCurvePoint_BezTriple_ctrlpoint_get",
1467  "rna_GpencilCurvePoint_BezTriple_ctrlpoint_set",
1468  NULL);
1470  RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
1471  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
1472  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_stroke_curve_update");
1473 
1474  prop = RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
1475  RNA_def_property_array(prop, 3);
1477  "rna_GpencilCurvePoint_BezTriple_handle2_get",
1478  "rna_GpencilCurvePoint_BezTriple_handle2_set",
1479  NULL);
1481  RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle");
1482  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
1483  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_stroke_curve_update");
1484 
1485  /* Pressure */
1486  prop = RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_FACTOR);
1487  RNA_def_property_float_sdna(prop, NULL, "pressure");
1488  RNA_def_property_range(prop, 0.0f, FLT_MAX);
1491  RNA_def_property_ui_text(prop, "Pressure", "Pressure of the grease pencil stroke point");
1492  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_stroke_curve_update");
1493 
1494  /* Strength */
1495  prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR);
1496  RNA_def_property_float_sdna(prop, NULL, "strength");
1497  RNA_def_property_range(prop, 0.0f, 1.0f);
1500  prop, "Strength", "Color intensity (alpha factor) of the grease pencil stroke point");
1501  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_stroke_curve_update");
1502 
1503  /* read-only index */
1504  prop = RNA_def_property(srna, "point_index", PROP_INT, PROP_UNSIGNED);
1505  RNA_def_property_int_sdna(prop, NULL, "point_index");
1509  prop, "Point Index", "Index of the corresponding grease pencil stroke point");
1510 
1511  prop = RNA_def_property(srna, "uv_factor", PROP_FLOAT, PROP_FACTOR);
1512  RNA_def_property_float_sdna(prop, NULL, "uv_fac");
1513  RNA_def_property_range(prop, 0.0f, 1.0f);
1515  RNA_def_property_ui_text(prop, "UV Factor", "Internal UV factor");
1516  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_stroke_curve_update");
1517 
1518  prop = RNA_def_property(srna, "uv_rotation", PROP_FLOAT, PROP_ANGLE);
1519  RNA_def_property_float_sdna(prop, NULL, "uv_rot");
1522  RNA_def_property_ui_text(prop, "UV Rotation", "Internal UV factor for dot mode");
1523  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_stroke_curve_update");
1524 
1525  prop = RNA_def_property(srna, "vertex_color", PROP_FLOAT, PROP_COLOR);
1526  RNA_def_property_float_sdna(prop, NULL, "vert_color");
1527  RNA_def_property_array(prop, 4);
1528  RNA_def_property_range(prop, 0.0f, 1.0f);
1530  RNA_def_property_ui_text(prop, "Vertex Color", "Vertex color of the grease pencil stroke point");
1531  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_stroke_curve_update");
1532 }
1533 
1534 /* Editing Curve data. */
1536 {
1537  StructRNA *srna;
1538  PropertyRNA *prop;
1539 
1540  srna = RNA_def_struct(brna, "GPencilEditCurve", NULL);
1541  RNA_def_struct_sdna(srna, "bGPDcurve");
1542  RNA_def_struct_ui_text(srna, "Edit Curve", "Edition Curve");
1543 
1544  prop = RNA_def_property(srna, "curve_points", PROP_COLLECTION, PROP_NONE);
1545  RNA_def_property_collection_sdna(prop, NULL, "curve_points", "tot_curve_points");
1546  RNA_def_property_struct_type(prop, "GPencilEditCurvePoint");
1547  RNA_def_property_ui_text(prop, "Curve Points", "Curve data points");
1548 
1549  prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
1551  RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencil_curve_select_set");
1552  RNA_def_property_ui_text(prop, "Select", "Curve is selected for viewport editing");
1553  RNA_def_property_update(prop, 0, "rna_GPencil_update");
1554 }
1555 
1557 {
1558  StructRNA *srna;
1559  PropertyRNA *prop;
1560 
1561  srna = RNA_def_struct(brna, "GpencilVertexGroupElement", NULL);
1562  RNA_def_struct_sdna(srna, "MDeformWeight");
1564  srna, "Vertex Group Element", "Weight value of a vertex in a vertex group");
1565  RNA_def_struct_ui_icon(srna, ICON_GROUP_VERTEX);
1566 
1567  /* we can't point to actual group, it is in the object and so
1568  * there is no unique group to point to, hence the index */
1569  prop = RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED);
1570  RNA_def_property_int_sdna(prop, NULL, "def_nr");
1572  RNA_def_property_ui_text(prop, "Group Index", "");
1573  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1574 
1575  prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_FACTOR);
1576  RNA_def_property_range(prop, 0.0f, 1.0f);
1577  RNA_def_property_ui_text(prop, "Weight", "Vertex Weight");
1578  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1579 }
1580 
1582 {
1583  StructRNA *srna;
1584  PropertyRNA *prop;
1585 
1586  static const EnumPropertyItem stroke_display_mode_items[] = {
1587  {0, "SCREEN", 0, "Screen", "Stroke is in screen-space"},
1588  {GP_STROKE_3DSPACE, "3DSPACE", 0, "3D Space", "Stroke is in 3D-space"},
1589  {GP_STROKE_2DSPACE, "2DSPACE", 0, "2D Space", "Stroke is in 2D-space"},
1591  "2DIMAGE",
1592  0,
1593  "2D Image",
1594  "Stroke is in 2D-space (but with special 'image' scaling)"},
1595  {0, NULL, 0, NULL, NULL},
1596  };
1597 
1598  srna = RNA_def_struct(brna, "GPencilStroke", NULL);
1599  RNA_def_struct_sdna(srna, "bGPDstroke");
1600  RNA_def_struct_ui_text(srna, "Grease Pencil Stroke", "Freehand curve defining part of a sketch");
1601 
1602  /* Points */
1603  prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
1604  RNA_def_property_collection_sdna(prop, NULL, "points", "totpoints");
1605  RNA_def_property_struct_type(prop, "GPencilStrokePoint");
1606  RNA_def_property_ui_text(prop, "Stroke Points", "Stroke data points");
1608 
1609  /* Triangles */
1610  prop = RNA_def_property(srna, "triangles", PROP_COLLECTION, PROP_NONE);
1611  RNA_def_property_collection_sdna(prop, NULL, "triangles", "tot_triangles");
1612  RNA_def_property_struct_type(prop, "GPencilTriangle");
1613  RNA_def_property_ui_text(prop, "Triangles", "Triangulation data for HQ fill");
1614 
1615  /* Edit Curve. */
1616  prop = RNA_def_property(srna, "edit_curve", PROP_POINTER, PROP_NONE);
1617  RNA_def_property_pointer_sdna(prop, NULL, "editcurve");
1618  RNA_def_property_struct_type(prop, "GPencilEditCurve");
1619  RNA_def_property_ui_text(prop, "Edit Curve", "Temporary data for Edit Curve");
1620 
1621  /* Material Index */
1622  prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_NONE);
1623  RNA_def_property_int_sdna(prop, NULL, "mat_nr");
1624  RNA_def_property_ui_text(prop, "Material Index", "Material slot index of this stroke");
1625  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1626 
1627  /* Settings */
1628  prop = RNA_def_property(srna, "display_mode", PROP_ENUM, PROP_NONE);
1630  RNA_def_property_enum_items(prop, stroke_display_mode_items);
1631  RNA_def_property_ui_text(prop, "Display Mode", "Coordinate space that stroke is in");
1632  RNA_def_property_update(prop, 0, "rna_GPencil_update");
1633 
1634  prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
1636  RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencil_stroke_select_set");
1637  RNA_def_property_ui_text(prop, "Select", "Stroke is selected for viewport editing");
1638  RNA_def_property_update(prop, 0, "rna_GPencil_update");
1639 
1640  /* Cyclic: Draw a line from end to start point */
1641  prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE);
1643  RNA_def_property_ui_text(prop, "Cyclic", "Enable cyclic drawing, closing the stroke");
1644  RNA_def_property_update(prop, 0, "rna_GPencil_update");
1645 
1646  /* The stroke has Curve Edit data. */
1647  prop = RNA_def_property(srna, "has_edit_curve", PROP_BOOLEAN, PROP_NONE);
1648  RNA_def_property_boolean_funcs(prop, "rna_stroke_has_edit_curve_get", NULL);
1650  RNA_def_property_ui_text(prop, "Has Curve Data", "Stroke has Curve data to edit shape");
1651 
1652  /* Caps mode */
1653  prop = RNA_def_property(srna, "start_cap_mode", PROP_ENUM, PROP_NONE);
1654  RNA_def_property_enum_sdna(prop, NULL, "caps[0]");
1656  RNA_def_property_ui_text(prop, "Start Cap", "Stroke start extreme cap style");
1657  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1658 
1659  prop = RNA_def_property(srna, "end_cap_mode", PROP_ENUM, PROP_NONE);
1660  RNA_def_property_enum_sdna(prop, NULL, "caps[1]");
1662  RNA_def_property_ui_text(prop, "End Cap", "Stroke end extreme cap style");
1663  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1664 
1665  /* No fill: The stroke never must fill area and must use fill color as stroke color
1666  * (this is a special flag for fill brush). */
1667  prop = RNA_def_property(srna, "is_nofill_stroke", PROP_BOOLEAN, PROP_NONE);
1669  RNA_def_property_ui_text(prop, "No Fill", "Special stroke to use as boundary for filling areas");
1670  RNA_def_property_update(prop, 0, "rna_GPencil_update");
1671 
1672  /* Line Thickness */
1673  prop = RNA_def_property(srna, "line_width", PROP_INT, PROP_PIXEL);
1674  RNA_def_property_int_sdna(prop, NULL, "thickness");
1675  RNA_def_property_range(prop, 1, 1000);
1676  RNA_def_property_ui_range(prop, 1, 10, 1, 0);
1677  RNA_def_property_ui_text(prop, "Thickness", "Thickness of stroke (in pixels)");
1678  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1679 
1680  /* gradient control along y */
1681  prop = RNA_def_property(srna, "hardness", PROP_FLOAT, PROP_FACTOR);
1682  RNA_def_property_float_sdna(prop, NULL, "hardeness");
1683  RNA_def_property_range(prop, 0.001f, 1.0f);
1684  RNA_def_property_float_default(prop, 1.0f);
1685  RNA_def_property_ui_text(prop, "Hardness", "Amount of gradient along section of stroke");
1687  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1688 
1689  /* Stroke bound box */
1690  prop = RNA_def_property(srna, "bound_box_min", PROP_FLOAT, PROP_XYZ);
1691  RNA_def_property_float_sdna(prop, NULL, "boundbox_min");
1692  RNA_def_property_array(prop, 3);
1694  RNA_def_property_ui_text(prop, "Boundbox Min", "");
1695 
1696  prop = RNA_def_property(srna, "bound_box_max", PROP_FLOAT, PROP_XYZ);
1697  RNA_def_property_float_sdna(prop, NULL, "boundbox_max");
1698  RNA_def_property_array(prop, 3);
1700  RNA_def_property_ui_text(prop, "Boundbox Max", "");
1701 
1702  /* gradient shape ratio */
1703  prop = RNA_def_property(srna, "aspect", PROP_FLOAT, PROP_XYZ);
1704  RNA_def_property_float_sdna(prop, NULL, "aspect_ratio");
1705  RNA_def_property_array(prop, 2);
1706  RNA_def_property_range(prop, 0.01f, 1.0f);
1707  RNA_def_property_float_default(prop, 1.0f);
1708  RNA_def_property_ui_text(prop, "Aspect", "");
1709  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1710 
1711  /* UV translation. */
1712  prop = RNA_def_property(srna, "uv_translation", PROP_FLOAT, PROP_XYZ);
1713  RNA_def_property_float_sdna(prop, NULL, "uv_translation");
1714  RNA_def_property_array(prop, 2);
1715  RNA_def_property_float_default(prop, 0.0f);
1716  RNA_def_property_ui_text(prop, "UV Translation", "Translation of default UV position");
1718  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_uv_update");
1719 
1720  /* UV rotation. */
1721  prop = RNA_def_property(srna, "uv_rotation", PROP_FLOAT, PROP_ANGLE);
1722  RNA_def_property_float_sdna(prop, NULL, "uv_rotation");
1723  RNA_def_property_float_default(prop, 0.0f);
1724  RNA_def_property_ui_text(prop, "UV Rotation", "Rotation of the UV");
1726  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_uv_update");
1727 
1728  /* UV scale. */
1729  prop = RNA_def_property(srna, "uv_scale", PROP_FLOAT, PROP_NONE);
1730  RNA_def_property_float_sdna(prop, NULL, "uv_scale");
1731  RNA_def_property_float_default(prop, 1.0f);
1732  RNA_def_property_range(prop, 0.01f, 100.0f);
1733  RNA_def_property_ui_text(prop, "UV Scale", "Scale of the UV");
1735  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_uv_update");
1736 
1737  /* Vertex Color for Fill. */
1738  prop = RNA_def_property(srna, "vertex_color_fill", PROP_FLOAT, PROP_COLOR);
1739  RNA_def_property_float_sdna(prop, NULL, "vert_color_fill");
1740  RNA_def_property_array(prop, 4);
1741  RNA_def_property_range(prop, 0.0f, 1.0f);
1744  prop, "Vertex Fill Color", "Color used to mix with fill color to get final color");
1745  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1746 
1747  /* Selection Index */
1748  prop = RNA_def_property(srna, "select_index", PROP_INT, PROP_NONE);
1749  RNA_def_property_int_sdna(prop, NULL, "select_index");
1750  RNA_def_property_ui_text(prop, "Select Index", "Index of selection used for interpolation");
1751 }
1752 
1754 {
1755  StructRNA *srna;
1756 
1757  FunctionRNA *func;
1758  PropertyRNA *parm;
1759 
1760  RNA_def_property_srna(cprop, "GPencilStrokes");
1761  srna = RNA_def_struct(brna, "GPencilStrokes", NULL);
1762  RNA_def_struct_sdna(srna, "bGPDframe");
1763  RNA_def_struct_ui_text(srna, "Grease Pencil Frames", "Collection of grease pencil stroke");
1764 
1765  func = RNA_def_function(srna, "new", "rna_GPencil_stroke_new");
1766  RNA_def_function_ui_description(func, "Add a new grease pencil stroke");
1767  parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "", "The newly created stroke");
1768  RNA_def_function_return(func, parm);
1769 
1770  func = RNA_def_function(srna, "remove", "rna_GPencil_stroke_remove");
1771  RNA_def_function_ui_description(func, "Remove a grease pencil stroke");
1773  parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "Stroke", "The stroke to remove");
1776 
1777  func = RNA_def_function(srna, "close", "rna_GPencil_stroke_close");
1778  RNA_def_function_ui_description(func, "Close a grease pencil stroke adding geometry");
1780  parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "Stroke", "The stroke to close");
1783 }
1784 
1786 {
1787  StructRNA *srna;
1788  PropertyRNA *prop;
1789 
1790  FunctionRNA *func;
1791 
1792  srna = RNA_def_struct(brna, "GPencilFrame", NULL);
1793  RNA_def_struct_sdna(srna, "bGPDframe");
1795  srna, "Grease Pencil Frame", "Collection of related sketches on a particular frame");
1796 
1797  /* Strokes */
1798  prop = RNA_def_property(srna, "strokes", PROP_COLLECTION, PROP_NONE);
1799  RNA_def_property_collection_sdna(prop, NULL, "strokes", NULL);
1800  RNA_def_property_struct_type(prop, "GPencilStroke");
1801  RNA_def_property_ui_text(prop, "Strokes", "Freehand curves defining the sketch on this frame");
1802  rna_def_gpencil_strokes_api(brna, prop);
1803 
1804  /* Frame Number */
1805  prop = RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE);
1806  RNA_def_property_int_sdna(prop, NULL, "framenum");
1807  /* XXX NOTE: this cannot occur on the same frame as another sketch. */
1809  RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears");
1810 
1811  prop = RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE);
1812  RNA_def_property_enum_sdna(prop, NULL, "key_type");
1815  RNA_def_property_ui_text(prop, "Keyframe Type", "Type of keyframe");
1816  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1817 
1818  /* Flags */
1819  prop = RNA_def_property(srna, "is_edited", PROP_BOOLEAN, PROP_NONE);
1821  prop, NULL, "flag", GP_FRAME_PAINT); /* XXX should it be editable? */
1822  RNA_def_property_ui_text(prop, "Paint Lock", "Frame is being edited (painted on)");
1823 
1824  prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
1826  RNA_def_property_ui_text(prop, "Select", "Frame is selected for editing in the Dope Sheet");
1827 
1828  /* API */
1829  func = RNA_def_function(srna, "clear", "rna_GPencil_frame_clear");
1830  RNA_def_function_ui_description(func, "Remove all the grease pencil frame data");
1831 }
1832 
1834 {
1835  StructRNA *srna;
1836 
1837  FunctionRNA *func;
1838  PropertyRNA *parm;
1839 
1840  RNA_def_property_srna(cprop, "GPencilFrames");
1841  srna = RNA_def_struct(brna, "GPencilFrames", NULL);
1842  RNA_def_struct_sdna(srna, "bGPDlayer");
1843  RNA_def_struct_ui_text(srna, "Grease Pencil Frames", "Collection of grease pencil frames");
1844 
1845  func = RNA_def_function(srna, "new", "rna_GPencil_frame_new");
1846  RNA_def_function_ui_description(func, "Add a new grease pencil frame");
1848  parm = RNA_def_int(func,
1849  "frame_number",
1850  1,
1851  MINAFRAME,
1852  MAXFRAME,
1853  "Frame Number",
1854  "The frame on which this sketch appears",
1855  MINAFRAME,
1856  MAXFRAME);
1858  RNA_def_boolean(func, "active", 0, "Active", "");
1859  parm = RNA_def_pointer(func, "frame", "GPencilFrame", "", "The newly created frame");
1860  RNA_def_function_return(func, parm);
1861 
1862  func = RNA_def_function(srna, "remove", "rna_GPencil_frame_remove");
1863  RNA_def_function_ui_description(func, "Remove a grease pencil frame");
1865  parm = RNA_def_pointer(func, "frame", "GPencilFrame", "Frame", "The frame to remove");
1868 
1869  func = RNA_def_function(srna, "copy", "rna_GPencil_frame_copy");
1870  RNA_def_function_ui_description(func, "Copy a grease pencil frame");
1871  parm = RNA_def_pointer(func, "source", "GPencilFrame", "Source", "The source frame");
1873  parm = RNA_def_pointer(func, "copy", "GPencilFrame", "", "The newly copied frame");
1874  RNA_def_function_return(func, parm);
1875 }
1876 
1878 {
1879  StructRNA *srna;
1880  PropertyRNA *prop;
1881 
1882  FunctionRNA *func;
1883  PropertyRNA *parm;
1884 
1885  RNA_def_property_srna(cprop, "GreasePencilMaskLayers");
1886  srna = RNA_def_struct(brna, "GreasePencilMaskLayers", NULL);
1887  RNA_def_struct_sdna(srna, "bGPDlayer");
1889  srna, "Grease Pencil Mask Layers", "Collection of grease pencil masking layers");
1890 
1891  prop = RNA_def_property(srna, "active_mask_index", PROP_INT, PROP_UNSIGNED);
1894  "rna_GPencil_active_mask_index_get",
1895  "rna_GPencil_active_mask_index_set",
1896  "rna_GPencil_active_mask_index_range");
1897  RNA_def_property_ui_text(prop, "Active Layer Mask Index", "Active index in layer mask array");
1898 
1899  func = RNA_def_function(srna, "add", "rna_GPencil_layer_mask_add");
1900  RNA_def_function_ui_description(func, "Add a layer to mask list");
1901  parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "Layer to add as mask");
1904 
1905  func = RNA_def_function(srna, "remove", "rna_GPencil_layer_mask_remove");
1906  RNA_def_function_ui_description(func, "Remove a layer from mask list");
1908  parm = RNA_def_pointer(func, "mask", "GPencilLayerMask", "", "Mask to remove");
1911 }
1912 
1914 {
1915  StructRNA *srna;
1916  PropertyRNA *prop;
1917 
1918  srna = RNA_def_struct(brna, "GPencilLayerMask", NULL);
1919  RNA_def_struct_sdna(srna, "bGPDlayer_Mask");
1920  RNA_def_struct_ui_text(srna, "Grease Pencil Masking Layers", "List of Mask Layers");
1921  RNA_def_struct_path_func(srna, "rna_GPencilLayerMask_path");
1922 
1923  /* Name */
1924  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1925  RNA_def_property_ui_text(prop, "Layer", "Mask layer name");
1926  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_mask_info_set");
1927  RNA_def_struct_name_property(srna, prop);
1930 
1931  /* Flags */
1932  prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
1934  RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
1935  RNA_def_property_ui_text(prop, "Hide", "Set mask Visibility");
1936  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1937 
1938  prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
1940  RNA_def_property_ui_icon(prop, ICON_CLIPUV_HLT, -1);
1941  RNA_def_property_ui_text(prop, "Invert", "Invert mask");
1942  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1943 }
1944 
1946 {
1947  StructRNA *srna;
1948  PropertyRNA *prop;
1949 
1950  FunctionRNA *func;
1951  static const float default_onion_color_b[] = {0.302f, 0.851f, 0.302f};
1952  static const float default_onion_color_a[] = {0.250f, 0.1f, 1.0f};
1953 
1954  srna = RNA_def_struct(brna, "GPencilLayer", NULL);
1955  RNA_def_struct_sdna(srna, "bGPDlayer");
1956  RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches");
1957  RNA_def_struct_path_func(srna, "rna_GPencilLayer_path");
1958 
1959  /* Name */
1960  prop = RNA_def_property(srna, "info", PROP_STRING, PROP_NONE);
1961  RNA_def_property_ui_text(prop, "Info", "Layer name");
1962  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_info_set");
1963  RNA_def_struct_name_property(srna, prop);
1964  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_RENAME, "rna_GPencil_update");
1965 
1966  /* Frames */
1967  prop = RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE);
1968  RNA_def_property_collection_sdna(prop, NULL, "frames", NULL);
1969  RNA_def_property_struct_type(prop, "GPencilFrame");
1970  RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames");
1971  rna_def_gpencil_frames_api(brna, prop);
1972 
1973  /* Mask Layers */
1974  prop = RNA_def_property(srna, "mask_layers", PROP_COLLECTION, PROP_NONE);
1975  RNA_def_property_collection_sdna(prop, NULL, "mask_layers", NULL);
1976  RNA_def_property_struct_type(prop, "GPencilLayerMask");
1977  RNA_def_property_ui_text(prop, "Masks", "List of Masking Layers");
1978  rna_def_gpencil_layers_mask_api(brna, prop);
1979 
1980  /* Active Frame */
1981  prop = RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE);
1982  RNA_def_property_pointer_sdna(prop, NULL, "actframe");
1983  RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer");
1984  RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable");
1986 
1987  /* Layer Opacity */
1988  prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE);
1989  RNA_def_property_float_sdna(prop, NULL, "opacity");
1990  RNA_def_property_range(prop, 0.0, 1.0f);
1991  RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity");
1992  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
1993 
1994  /* Layer channel color (grease pencil). */
1995  prop = RNA_def_property(srna, "channel_color", PROP_FLOAT, PROP_COLOR_GAMMA);
1996  RNA_def_property_float_sdna(prop, NULL, "color");
1997  RNA_def_property_array(prop, 3);
1998  RNA_def_property_range(prop, 0.0f, 1.0f);
2001  prop, "Custom Channel Color", "Custom color for animation channel in Dopesheet");
2002  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2003 
2004  /* Layer Opacity (Annotations). */
2005  prop = RNA_def_property(srna, "annotation_opacity", PROP_FLOAT, PROP_NONE);
2006  RNA_def_property_float_sdna(prop, NULL, "opacity");
2007  RNA_def_property_range(prop, 0.0, 1.0f);
2009  RNA_def_property_ui_text(prop, "Opacity", "Annotation Layer Opacity");
2010  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2011 
2012  /* Stroke Drawing Color (Annotations) */
2013  prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
2014  RNA_def_property_array(prop, 3);
2015  RNA_def_property_range(prop, 0.0f, 1.0f);
2017  RNA_def_property_ui_text(prop, "Color", "Color for all strokes in this layer");
2018  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2019 
2020  /* Line Thickness (Annotations) */
2021  prop = RNA_def_property(srna, "thickness", PROP_INT, PROP_PIXEL);
2022  RNA_def_property_int_sdna(prop, NULL, "thickness");
2023  RNA_def_property_range(prop, 1, 10);
2025  RNA_def_property_ui_text(prop, "Thickness", "Thickness of annotation strokes");
2026  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2027 
2028  /* Tint Color */
2029  prop = RNA_def_property(srna, "tint_color", PROP_FLOAT, PROP_COLOR);
2030  RNA_def_property_float_sdna(prop, NULL, "tintcolor");
2031  RNA_def_property_array(prop, 3);
2032  RNA_def_property_range(prop, 0.0f, 1.0f);
2033  RNA_def_property_ui_text(prop, "Tint Color", "Color for tinting stroke colors");
2034  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2035 
2036  /* Tint factor */
2037  prop = RNA_def_property(srna, "tint_factor", PROP_FLOAT, PROP_FACTOR);
2038  RNA_def_property_float_sdna(prop, NULL, "tintcolor[3]");
2039  RNA_def_property_range(prop, 0.0, 1.0f);
2040  RNA_def_property_ui_text(prop, "Tint Factor", "Factor of tinting color");
2041  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2042 
2043  /* Vertex Paint opacity factor */
2044  prop = RNA_def_property(srna, "vertex_paint_opacity", PROP_FLOAT, PROP_FACTOR);
2045  RNA_def_property_float_sdna(prop, NULL, "vertex_paint_opacity");
2046  RNA_def_property_range(prop, 0.0f, 1.0f);
2047  RNA_def_property_float_default(prop, 1.0f);
2048  RNA_def_property_ui_text(prop, "Vertex Paint Opacity", "Vertex Paint mix factor");
2049  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2050 
2051  /* Line Thickness Change */
2052  prop = RNA_def_property(srna, "line_change", PROP_INT, PROP_PIXEL);
2053  RNA_def_property_int_sdna(prop, NULL, "line_change");
2054  RNA_def_property_range(prop, -300, 300);
2055  RNA_def_property_ui_range(prop, -100, 100, 1.0, 1);
2057  prop, "Thickness Change", "Thickness change to apply to current strokes (in pixels)");
2058  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2059 
2060  /* Onion-Skinning */
2061  prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
2064  prop, "Onion Skinning", "Display onion skins before and after the current frame");
2065  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2066 
2067  prop = RNA_def_property(srna, "use_annotation_onion_skinning", PROP_BOOLEAN, PROP_NONE);
2071  prop, "Onion Skinning", "Display annotation onion skins before and after the current frame");
2072  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2073 
2074  prop = RNA_def_property(srna, "annotation_onion_before_range", PROP_INT, PROP_NONE);
2075  RNA_def_property_int_sdna(prop, NULL, "gstep");
2076  RNA_def_property_range(prop, -1, 120);
2079  prop, "Frames Before", "Maximum number of frames to show before current frame");
2080  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2081 
2082  prop = RNA_def_property(srna, "annotation_onion_after_range", PROP_INT, PROP_NONE);
2083  RNA_def_property_int_sdna(prop, NULL, "gstep_next");
2084  RNA_def_property_range(prop, -1, 120);
2087  prop, "Frames After", "Maximum number of frames to show after current frame");
2088  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2089 
2090  prop = RNA_def_property(srna, "annotation_onion_before_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2091  RNA_def_property_float_sdna(prop, NULL, "gcolor_prev");
2092  RNA_def_property_array(prop, 3);
2093  RNA_def_property_range(prop, 0.0f, 1.0f);
2094  RNA_def_property_float_array_default(prop, default_onion_color_b);
2096  RNA_def_property_ui_text(prop, "Before Color", "Base color for ghosts before the active frame");
2097  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2098 
2099  prop = RNA_def_property(srna, "annotation_onion_after_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2100  RNA_def_property_float_sdna(prop, NULL, "gcolor_next");
2101  RNA_def_property_array(prop, 3);
2102  RNA_def_property_range(prop, 0.0f, 1.0f);
2103  RNA_def_property_float_array_default(prop, default_onion_color_a);
2105  RNA_def_property_ui_text(prop, "After Color", "Base color for ghosts after the active frame");
2106  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2107 
2108  /* pass index for compositing and modifiers */
2109  prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
2110  RNA_def_property_int_sdna(prop, NULL, "pass_index");
2111  RNA_def_property_ui_text(prop, "Pass Index", "Index number for the \"Layer Index\" pass");
2112  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2113 
2114  prop = RNA_def_property(srna, "viewlayer_render", PROP_STRING, PROP_NONE);
2115  RNA_def_property_string_sdna(prop, NULL, "viewlayername");
2117  prop,
2118  "ViewLayer",
2119  "Only include Layer in this View Layer render output (leave blank to include always)");
2120 
2121  prop = RNA_def_property(srna, "use_viewlayer_masks", PROP_BOOLEAN, PROP_NONE);
2124  prop, "Use Masks in Render", "Include the mask layers when rendering the view-layer");
2125  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2126 
2127  /* blend mode */
2128  prop = RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
2129  RNA_def_property_enum_sdna(prop, NULL, "blend_mode");
2131  RNA_def_property_ui_text(prop, "Blend Mode", "Blend mode");
2132  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2133 
2134  /* Layer transforms. */
2135  prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION);
2136  RNA_def_property_float_sdna(prop, NULL, "location");
2137  RNA_def_property_ui_text(prop, "Location", "Values for change location");
2138  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
2139  RNA_def_property_update(prop, 0, "rna_GpencilLayerMatrix_update");
2140 
2141  prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
2142  RNA_def_property_float_sdna(prop, NULL, "rotation");
2143  RNA_def_property_ui_text(prop, "Rotation", "Values for changes in rotation");
2144  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
2145  RNA_def_property_update(prop, 0, "rna_GpencilLayerMatrix_update");
2146 
2147  prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
2148  RNA_def_property_float_sdna(prop, NULL, "scale");
2149  RNA_def_property_float_default(prop, 1.0f);
2150  RNA_def_property_ui_text(prop, "Scale", "Values for changes in scale");
2151  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
2152  RNA_def_property_update(prop, 0, "rna_GpencilLayerMatrix_update");
2153 
2154  /* Layer matrix. */
2155  prop = RNA_def_property(srna, "matrix_layer", PROP_FLOAT, PROP_MATRIX);
2156  RNA_def_property_float_sdna(prop, NULL, "layer_mat");
2161  RNA_def_property_ui_text(prop, "Matrix Layer", "Local Layer transformation matrix");
2162 
2163  /* Layer inverse matrix. */
2164  prop = RNA_def_property(srna, "matrix_inverse_layer", PROP_FLOAT, PROP_MATRIX);
2165  RNA_def_property_float_sdna(prop, NULL, "layer_invmat");
2171  prop, "Matrix Layer Inverse", "Local Layer transformation inverse matrix");
2172 
2173  /* Flags */
2174  prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
2176  RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
2177  RNA_def_property_ui_text(prop, "Hide", "Set layer Visibility");
2178  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2179 
2180  prop = RNA_def_property(srna, "annotation_hide", PROP_BOOLEAN, PROP_NONE);
2182  RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
2184  RNA_def_property_ui_text(prop, "Hide", "Set annotation Visibility");
2185  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2186 
2187  prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
2189  RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
2191  prop, "Locked", "Protect layer from further editing and/or frame changes");
2192  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2193 
2194  prop = RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE);
2196  RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
2198  RNA_def_property_ui_text(prop, "Frame Locked", "Lock current frame displayed by layer");
2199  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2200 
2201  prop = RNA_def_property(srna, "lock_material", PROP_BOOLEAN, PROP_NONE);
2205  prop, "Disallow Locked Materials Editing", "Avoids editing locked materials in the layer");
2207 
2208  prop = RNA_def_property(srna, "use_mask_layer", PROP_BOOLEAN, PROP_NONE);
2211  prop,
2212  "Use Mask",
2213  "The visibility of drawings on this layer is affected by the layers in its masks list");
2214  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2215 
2216  prop = RNA_def_property(srna, "use_lights", PROP_BOOLEAN, PROP_NONE);
2219  prop, "Use Lights", "Enable the use of lights on stroke and fill materials");
2220  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2221 
2222  /* solo mode: Only display frames with keyframe */
2223  prop = RNA_def_property(srna, "use_solo_mode", PROP_BOOLEAN, PROP_NONE);
2226  prop, "Solo Mode", "In Draw Mode only display layers with keyframe in current frame");
2227  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2228 
2229  /* Layer is used as Ruler. */
2230  prop = RNA_def_property(srna, "is_ruler", PROP_BOOLEAN, PROP_NONE);
2232  RNA_def_property_ui_text(prop, "Ruler", "This is a special ruler layer");
2234 
2235  prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
2237  RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the Dope Sheet");
2238  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_SELECTED, "rna_GPencil_update");
2239 
2240  prop = RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE);
2243  prop, "Show Points", "Show the points which make up the strokes (for debugging purposes)");
2244  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2245 
2246  /* In Front */
2247  prop = RNA_def_property(srna, "show_in_front", PROP_BOOLEAN, PROP_NONE);
2249  RNA_def_property_ui_text(prop, "In Front", "Make the layer display in front of objects");
2250  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2251 
2252  /* Parent object */
2253  prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
2254  RNA_def_property_pointer_funcs(prop, NULL, "rna_GPencilLayer_parent_set", NULL, NULL);
2257  RNA_def_property_ui_text(prop, "Parent", "Parent object");
2258  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_dependency_update");
2259 
2260  /* parent type */
2261  prop = RNA_def_property(srna, "parent_type", PROP_ENUM, PROP_NONE);
2262  RNA_def_property_enum_bitflag_sdna(prop, NULL, "partype");
2265  prop, NULL, "rna_GPencilLayer_parent_type_set", "rna_Object_parent_type_itemf");
2266  RNA_def_property_ui_text(prop, "Parent Type", "Type of parent relation");
2267  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_dependency_update");
2268 
2269  /* parent bone */
2270  prop = RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE);
2271  RNA_def_property_string_sdna(prop, NULL, "parsubstr");
2272  RNA_def_property_string_funcs(prop, NULL, NULL, "rna_GPencilLayer_parent_bone_set");
2274  prop, "Parent Bone", "Name of parent bone in case of a bone parenting relation");
2275  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_dependency_update");
2276 
2277  /* matrix */
2278  prop = RNA_def_property(srna, "matrix_inverse", PROP_FLOAT, PROP_MATRIX);
2279  RNA_def_property_float_sdna(prop, NULL, "inverse");
2282  RNA_def_property_ui_text(prop, "Inverse Matrix", "Parent inverse transformation matrix");
2283  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2284 
2285  /* read only parented flag */
2286  prop = RNA_def_property(srna, "is_parented", PROP_BOOLEAN, PROP_NONE);
2287  RNA_def_property_boolean_funcs(prop, "rna_GPencilLayer_is_parented_get", NULL);
2289  RNA_def_property_ui_text(prop, "Is Parented", "True when the layer parent object is set");
2290 
2291  /* Layers API */
2292  func = RNA_def_function(srna, "clear", "rna_GPencil_layer_clear");
2293  RNA_def_function_ui_description(func, "Remove all the grease pencil layer data");
2294 }
2295 
2297 {
2298  StructRNA *srna;
2299  PropertyRNA *prop;
2300 
2301  FunctionRNA *func;
2302  PropertyRNA *parm;
2303 
2304  RNA_def_property_srna(cprop, "GreasePencilLayers");
2305  srna = RNA_def_struct(brna, "GreasePencilLayers", NULL);
2306  RNA_def_struct_sdna(srna, "bGPdata");
2307  RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers");
2308 
2309  func = RNA_def_function(srna, "new", "rna_GPencil_layer_new");
2310  RNA_def_function_ui_description(func, "Add a new grease pencil layer");
2311  parm = RNA_def_string(func, "name", "GPencilLayer", MAX_NAME, "Name", "Name of the layer");
2314  func, "set_active", true, "Set Active", "Set the newly created layer to the active layer");
2315  parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The newly created layer");
2316  RNA_def_function_return(func, parm);
2317 
2318  func = RNA_def_function(srna, "remove", "rna_GPencil_layer_remove");
2319  RNA_def_function_ui_description(func, "Remove a grease pencil layer");
2321  parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The layer to remove");
2324 
2325  func = RNA_def_function(srna, "move", "rna_GPencil_layer_move");
2326  RNA_def_function_ui_description(func, "Move a grease pencil layer in the layer stack");
2328  parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The layer to move");
2331  parm = RNA_def_enum(
2332  func, "type", rna_enum_gplayer_move_type_items, 1, "", "Direction of movement");
2334 
2335  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
2336  RNA_def_property_struct_type(prop, "GPencilLayer");
2338  prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL);
2340  RNA_def_property_ui_text(prop, "Active Layer", "Active grease pencil layer");
2342 
2343  prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
2345  "rna_GPencil_active_layer_index_get",
2346  "rna_GPencil_active_layer_index_set",
2347  "rna_GPencil_active_layer_index_range");
2348  RNA_def_property_ui_text(prop, "Active Layer Index", "Index of active grease pencil layer");
2350 
2351  /* Active Layer - As an enum (for selecting active layer for annotations) */
2352  prop = RNA_def_property(srna, "active_note", PROP_ENUM, PROP_NONE);
2354  "rna_GPencil_active_layer_index_get",
2355  "rna_GPencil_active_layer_index_set",
2356  "rna_GPencil_active_layer_itemf");
2358  prop, DummyRNA_DEFAULT_items); /* purely dynamic, as it maps to user-data */
2359  RNA_def_property_ui_text(prop, "Active Note", "Note/Layer to add annotation strokes to");
2360  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2361 }
2362 
2364 {
2365  StructRNA *srna;
2366  PropertyRNA *prop;
2367 
2368  static const float default_grid_color[] = {0.5f, 0.5f, 0.5f};
2369 
2370  srna = RNA_def_struct(brna, "GreasePencilGrid", NULL);
2371  RNA_def_struct_sdna(srna, "bGPgrid");
2372  RNA_def_struct_nested(brna, srna, "GreasePencil");
2373 
2374  RNA_def_struct_path_func(srna, "rna_GreasePencilGrid_path");
2376  srna, "Grid and Canvas Settings", "Settings for grid and canvas in 3D viewport");
2377 
2378  prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
2379  RNA_def_property_float_sdna(prop, NULL, "scale");
2380  RNA_def_property_range(prop, 0.01f, FLT_MAX);
2381  RNA_def_property_float_default(prop, 1.0f);
2382  RNA_def_property_ui_text(prop, "Grid Scale", "Grid scale");
2383  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2384 
2385  prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA);
2386  RNA_def_property_float_sdna(prop, NULL, "color");
2387  RNA_def_property_array(prop, 3);
2388  RNA_def_property_range(prop, 0.0f, 1.0f);
2389  RNA_def_property_float_array_default(prop, default_grid_color);
2390  RNA_def_property_ui_text(prop, "Grid Color", "Color for grid lines");
2391  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2392 
2393  prop = RNA_def_property(srna, "lines", PROP_INT, PROP_NONE);
2394  RNA_def_property_int_sdna(prop, NULL, "lines");
2395  RNA_def_property_range(prop, 0, SHRT_MAX);
2398  prop, "Grid Subdivisions", "Number of subdivisions in each side of symmetry line");
2399  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2400 
2401  prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_TRANSLATION);
2402  RNA_def_property_float_sdna(prop, NULL, "offset");
2403  RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
2404  RNA_def_property_array(prop, 2);
2405  RNA_def_property_ui_text(prop, "Offset", "Offset of the canvas");
2406  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2407 }
2408 
2410 {
2411  StructRNA *srna;
2412  PropertyRNA *prop;
2413  FunctionRNA *func;
2414 
2415  static float default_1[4] = {0.6f, 0.6f, 0.6f, 0.5f};
2416  static float onion_dft1[3] = {0.145098f, 0.419608f, 0.137255f}; /* green */
2417  static float onion_dft2[3] = {0.125490f, 0.082353f, 0.529412f}; /* blue */
2418 
2419  static const EnumPropertyItem stroke_thickness_items[] = {
2420  {0, "WORLDSPACE", 0, "World Space", "Set stroke thickness relative to the world space"},
2422  "SCREENSPACE",
2423  0,
2424  "Screen Space",
2425  "Set stroke thickness relative to the screen space"},
2426  {0, NULL, 0, NULL, NULL},
2427  };
2428 
2429  srna = RNA_def_struct(brna, "GreasePencil", "ID");
2430  RNA_def_struct_sdna(srna, "bGPdata");
2431  RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation sketchbook");
2432  RNA_def_struct_ui_icon(srna, ICON_OUTLINER_DATA_GREASEPENCIL);
2433 
2434  /* Layers */
2435  prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
2436  RNA_def_property_collection_sdna(prop, NULL, "layers", NULL);
2437  RNA_def_property_struct_type(prop, "GPencilLayer");
2438  RNA_def_property_ui_text(prop, "Layers", "");
2439  rna_def_gpencil_layers_api(brna, prop);
2440 
2441  /* Animation Data */
2443 
2444  /* materials */
2445  prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
2446  RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
2447  RNA_def_property_struct_type(prop, "Material");
2448  RNA_def_property_ui_text(prop, "Materials", "");
2449  RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
2451  prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
2452 
2453  /* Depth */
2454  prop = RNA_def_property(srna, "stroke_depth_order", PROP_ENUM, PROP_NONE);
2455  RNA_def_property_enum_sdna(prop, NULL, "draw_mode");
2458  prop,
2459  "Stroke Depth Order",
2460  "Defines how the strokes are ordered in 3D space (for objects not displayed 'In Front')");
2461  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2462 
2463  /* Flags */
2464  prop = RNA_def_property(srna, "use_stroke_edit_mode", PROP_BOOLEAN, PROP_NONE);
2467  prop, "Stroke Edit Mode", "Edit Grease Pencil strokes instead of viewport data");
2469  prop, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, "rna_GPencil_editmode_update");
2470 
2471  prop = RNA_def_property(srna, "is_stroke_paint_mode", PROP_BOOLEAN, PROP_NONE);
2473  RNA_def_property_ui_text(prop, "Stroke Paint Mode", "Draw Grease Pencil strokes on click/drag");
2476  prop, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, "rna_GPencil_editmode_update");
2477 
2478  prop = RNA_def_property(srna, "is_stroke_sculpt_mode", PROP_BOOLEAN, PROP_NONE);
2481  prop, "Stroke Sculpt Mode", "Sculpt Grease Pencil strokes instead of viewport data");
2484  prop, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, "rna_GPencil_editmode_update");
2485 
2486  prop = RNA_def_property(srna, "is_stroke_weight_mode", PROP_BOOLEAN, PROP_NONE);
2488  RNA_def_property_ui_text(prop, "Stroke Weight Paint Mode", "Grease Pencil weight paint");
2491  prop, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, "rna_GPencil_editmode_update");
2492 
2493  prop = RNA_def_property(srna, "is_stroke_vertex_mode", PROP_BOOLEAN, PROP_NONE);
2495  RNA_def_property_ui_text(prop, "Stroke Vertex Paint Mode", "Grease Pencil vertex paint");
2498  prop, NC_GPENCIL | ND_DATA | ND_GPENCIL_EDITMODE, "rna_GPencil_editmode_update");
2499 
2500  prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
2504  prop, "Onion Skins", "Show ghosts of the keyframes before and after the current frame");
2506  prop, NC_SCREEN | NC_SCENE | ND_TOOLSETTINGS | ND_DATA | NC_GPENCIL, "rna_GPencil_update");
2507 
2508  prop = RNA_def_property(srna, "stroke_thickness_space", PROP_ENUM, PROP_NONE); /* as an enum */
2510  RNA_def_property_enum_items(prop, stroke_thickness_items);
2512  prop, "Stroke Thickness", "Set stroke thickness in screen space or world space");
2513  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2514 
2515  prop = RNA_def_property(srna, "pixel_factor", PROP_FLOAT, PROP_NONE);
2516  RNA_def_property_float_sdna(prop, NULL, "pixfactor");
2517  RNA_def_property_range(prop, 0.1f, 30.0f);
2518  RNA_def_property_ui_range(prop, 0.1f, 30.0f, 1, 2);
2520  prop,
2521  "Scale",
2522  "Scale conversion factor for pixel size (use larger values for thicker lines)");
2523  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2524 
2525  prop = RNA_def_property(srna, "edit_curve_resolution", PROP_INT, PROP_NONE);
2526  RNA_def_property_int_sdna(prop, NULL, "curve_edit_resolution");
2527  RNA_def_property_range(prop, 1, 256);
2528  RNA_def_property_ui_range(prop, 1, 64, 1, 1);
2532  prop,
2533  "Curve Resolution",
2534  "Number of segments generated between control points when editing strokes in curve mode");
2536  prop, NC_GPENCIL | ND_DATA, "rna_GPencil_stroke_curve_resolution_update");
2537 
2538  prop = RNA_def_property(srna, "use_adaptive_curve_resolution", PROP_BOOLEAN, PROP_NONE);
2542  "Adaptive Resolution",
2543  "Set the resolution of each editcurve segment dynamically depending on "
2544  "the length of the segment. The resolution is the number of points "
2545  "generated per unit distance");
2547  prop, NC_GPENCIL | ND_DATA, "rna_GPencil_stroke_curve_resolution_update");
2548 
2549  /* Curve editing error threshold. */
2550  prop = RNA_def_property(srna, "curve_edit_threshold", PROP_FLOAT, PROP_FACTOR);
2551  RNA_def_property_float_sdna(prop, NULL, "curve_edit_threshold");
2552  RNA_def_property_range(prop, FLT_MIN, 10.0);
2554  RNA_def_property_ui_text(prop, "Threshold", "Curve conversion error threshold");
2555  RNA_def_property_ui_range(prop, FLT_MIN, 10.0, 2, 5);
2557 
2558  /* Curve editing corner angle. */
2559  prop = RNA_def_property(srna, "curve_edit_corner_angle", PROP_FLOAT, PROP_ANGLE);
2560  RNA_def_property_float_sdna(prop, NULL, "curve_edit_corner_angle");
2561  RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
2563  RNA_def_property_ui_text(prop, "Corner Angle", "Angle threshold to be treated as corners");
2565 
2566  prop = RNA_def_property(srna, "use_multiedit", PROP_BOOLEAN, PROP_NONE);
2569  "Multiframe",
2570  "Edit strokes from multiple grease pencil keyframes at the same time "
2571  "(keyframes must be selected to be included)");
2572  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2573 
2574  prop = RNA_def_property(srna, "use_curve_edit", PROP_BOOLEAN, PROP_NONE);
2576  RNA_def_property_ui_text(prop, "Curve Editing", "Edit strokes using curve handles");
2577  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_curve_edit_mode_toggle");
2578 
2579  prop = RNA_def_property(srna, "use_autolock_layers", PROP_BOOLEAN, PROP_NONE);
2582  prop,
2583  "Auto-Lock Layers",
2584  "Automatically lock all layers except the active one to avoid accidental changes");
2585  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_autolock");
2586 
2587  prop = RNA_def_property(srna, "edit_line_color", PROP_FLOAT, PROP_COLOR_GAMMA);
2588  RNA_def_property_float_sdna(prop, NULL, "line_color");
2589  RNA_def_property_array(prop, 4);
2590  RNA_def_property_range(prop, 0.0f, 1.0f);
2591  RNA_def_property_float_array_default(prop, default_1);
2592  RNA_def_property_ui_text(prop, "Edit Line Color", "Color for editing line");
2593  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2594 
2595  /* onion skinning */
2596  prop = RNA_def_property(srna, "ghost_before_range", PROP_INT, PROP_NONE);
2597  RNA_def_property_int_sdna(prop, NULL, "gstep");
2598  RNA_def_property_range(prop, 0, 120);
2602  "Frames Before",
2603  "Maximum number of frames to show before current frame "
2604  "(0 = don't show any frames before current)");
2605  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2606 
2607  prop = RNA_def_property(srna, "ghost_after_range", PROP_INT, PROP_NONE);
2608  RNA_def_property_int_sdna(prop, NULL, "gstep_next");
2609  RNA_def_property_range(prop, 0, 120);
2613  "Frames After",
2614  "Maximum number of frames to show after current frame "
2615  "(0 = don't show any frames after current)");
2616  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2617 
2618  prop = RNA_def_property(srna, "use_ghost_custom_colors", PROP_BOOLEAN, PROP_NONE);
2620  prop, NULL, "onion_flag", GP_ONION_GHOST_PREVCOL | GP_ONION_GHOST_NEXTCOL);
2622  RNA_def_property_ui_text(prop, "Use Custom Ghost Colors", "Use custom colors for ghost frames");
2623  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2624 
2625  prop = RNA_def_property(srna, "before_color", PROP_FLOAT, PROP_COLOR);
2626  RNA_def_property_float_sdna(prop, NULL, "gcolor_prev");
2627  RNA_def_property_array(prop, 3);
2628  RNA_def_property_range(prop, 0.0f, 1.0f);
2629  RNA_def_property_float_array_default(prop, onion_dft1);
2631  RNA_def_property_ui_text(prop, "Before Color", "Base color for ghosts before the active frame");
2633  prop, NC_SCREEN | NC_SCENE | ND_TOOLSETTINGS | ND_DATA | NC_GPENCIL, "rna_GPencil_update");
2634 
2635  prop = RNA_def_property(srna, "after_color", PROP_FLOAT, PROP_COLOR);
2636  RNA_def_property_float_sdna(prop, NULL, "gcolor_next");
2637  RNA_def_property_array(prop, 3);
2638  RNA_def_property_range(prop, 0.0f, 1.0f);
2639  RNA_def_property_float_array_default(prop, onion_dft2);
2641  RNA_def_property_ui_text(prop, "After Color", "Base color for ghosts after the active frame");
2643  prop, NC_SCREEN | NC_SCENE | ND_TOOLSETTINGS | ND_DATA | NC_GPENCIL, "rna_GPencil_update");
2644 
2645  prop = RNA_def_property(srna, "use_ghosts_always", PROP_BOOLEAN, PROP_NONE);
2649  "Always Show Ghosts",
2650  "Ghosts are shown in renders and animation playback. Useful for "
2651  "special effects (e.g. motion blur)");
2652  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2653 
2654  prop = RNA_def_property(srna, "onion_mode", PROP_ENUM, PROP_NONE);
2655  RNA_def_property_enum_sdna(prop, NULL, "onion_mode");
2658  RNA_def_property_ui_text(prop, "Mode", "Mode to display frames");
2659  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2660 
2661  prop = RNA_def_property(srna, "onion_keyframe_type", PROP_ENUM, PROP_NONE);
2662  RNA_def_property_enum_sdna(prop, NULL, "onion_keytype");
2665  RNA_def_property_ui_text(prop, "Filter by Type", "Type of keyframe (for filtering)");
2666  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2667 
2668  prop = RNA_def_property(srna, "use_onion_fade", PROP_BOOLEAN, PROP_NONE);
2669  RNA_def_property_boolean_sdna(prop, NULL, "onion_flag", GP_ONION_FADE);
2672  prop, "Fade", "Display onion keyframes with a fade in color transparency");
2673  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2674 
2675  prop = RNA_def_property(srna, "use_onion_loop", PROP_BOOLEAN, PROP_NONE);
2676  RNA_def_property_boolean_sdna(prop, NULL, "onion_flag", GP_ONION_LOOP);
2679  prop, "Show Start Frame", "Display onion keyframes for looping animations");
2680  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2681 
2682  prop = RNA_def_property(srna, "onion_factor", PROP_FLOAT, PROP_NONE);
2683  RNA_def_property_float_sdna(prop, NULL, "onion_factor");
2684  RNA_def_property_float_default(prop, 0.5f);
2685  RNA_def_property_range(prop, 0.0, 1.0f);
2687  RNA_def_property_ui_text(prop, "Onion Opacity", "Change fade opacity of displayed onion frames");
2688  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2689 
2690  prop = RNA_def_property(srna, "zdepth_offset", PROP_FLOAT, PROP_NONE);
2691  RNA_def_property_float_sdna(prop, NULL, "zdepth_offset");
2692  RNA_def_property_range(prop, 0.0f, 1.0f);
2693  RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1f, 3);
2694  RNA_def_property_float_default(prop, 0.150f);
2695  RNA_def_property_ui_text(prop, "Surface Offset", "Offset amount when drawing in surface mode");
2696  RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
2697 
2698  prop = RNA_def_property(srna, "is_annotation", PROP_BOOLEAN, PROP_NONE);
2701  RNA_def_property_ui_text(prop, "Annotation", "Current data-block is an annotation");
2702 
2703  /* Nested Structs */
2704  prop = RNA_def_property(srna, "grid", PROP_POINTER, PROP_NONE);
2706  RNA_def_property_struct_type(prop, "GreasePencilGrid");
2708  prop, "Grid Settings", "Settings for grid and canvas in the 3D viewport");
2709 
2710  rna_def_gpencil_grid(brna);
2711 
2712  /* API Functions */
2713  func = RNA_def_function(srna, "clear", "rna_GPencil_clear");
2714  RNA_def_function_ui_description(func, "Remove all the Grease Pencil data");
2715 }
2716 
2717 /* --- */
2718 
2720 {
2721  rna_def_gpencil_data(brna);
2722 
2723  rna_def_gpencil_layer(brna);
2725  rna_def_gpencil_frame(brna);
2726 
2727  rna_def_gpencil_stroke(brna);
2730  rna_def_gpencil_curve(brna);
2732 
2734 }
2735 
2736 #endif
Blender kernel action and pose functionality.
struct bPoseChannel * BKE_pose_channel_find_name(const struct bPose *pose, const char *name)
void BKE_animdata_fix_paths_rename_all(struct ID *ref_id, const char *prefix, const char *oldName, const char *newName)
Definition: anim_data.c:1287
support for deformation groups and hooks.
struct MDeformWeight * BKE_defvert_find_index(const struct MDeformVert *dv, int defgroup)
struct MDeformWeight * BKE_defvert_ensure_index(struct MDeformVert *dv, int defgroup)
Definition: deform.c:748
bool BKE_gpencil_free_strokes(struct bGPDframe *gpf)
Definition: gpencil.c:414
void BKE_gpencil_stroke_select_index_set(struct bGPdata *gpd, struct bGPDstroke *gps)
Definition: gpencil.c:1155
struct bGPDframe * BKE_gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe)
Definition: gpencil.c:514
void BKE_gpencil_layer_active_set(struct bGPdata *gpd, struct bGPDlayer *active)
Definition: gpencil.c:1601
struct bGPDframe * BKE_gpencil_frame_duplicate(const struct bGPDframe *gpf_src, bool dup_strokes)
struct bGPDlayer * BKE_gpencil_layer_active_get(struct bGPdata *gpd)
Definition: gpencil.c:1558
void BKE_gpencil_stroke_select_index_reset(struct bGPDstroke *gps)
Definition: gpencil.c:1161
void BKE_gpencil_free_frames(struct bGPDlayer *gpl)
Definition: gpencil.c:427
void BKE_gpencil_layer_mask_remove(struct bGPDlayer *gpl, struct bGPDlayer_Mask *mask)
Definition: gpencil.c:1446
struct bGPDlayer_Mask * BKE_gpencil_layer_mask_add(struct bGPDlayer *gpl, const char *name)
Definition: gpencil.c:1435
struct bGPDlayer * BKE_gpencil_layer_addnew(struct bGPdata *gpd, const char *name, bool setactive, bool add_to_header)
Definition: gpencil.c:621
void BKE_gpencil_dvert_ensure(struct bGPDstroke *gps)
Definition: gpencil.c:1891
bool BKE_gpencil_layer_frame_delete(struct bGPDlayer *gpl, struct bGPDframe *gpf)
Definition: gpencil.c:1396
struct bGPDstroke * BKE_gpencil_stroke_new(int mat_idx, int totpoints, short thickness)
Definition: gpencil.c:756
struct bGPDlayer * BKE_gpencil_layer_named_get(struct bGPdata *gpd, const char *name)
Definition: gpencil.c:1419
struct bGPDframe * BKE_gpencil_layer_frame_find(struct bGPDlayer *gpl, int cframe)
Definition: gpencil.c:1216
void BKE_gpencil_free_stroke(struct bGPDstroke *gps)
Definition: gpencil.c:391
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
Definition: gpencil.c:1232
void BKE_gpencil_layer_delete(struct bGPdata *gpd, struct bGPDlayer *gpl)
Definition: gpencil.c:1653
void BKE_gpencil_free_layers(struct ListBase *list)
Definition: gpencil.c:456
@ GP_GETFRAME_USE_PREV
Definition: BKE_gpencil.h:338
void BKE_gpencil_layer_autolock_set(struct bGPdata *gpd, bool unlock)
Definition: gpencil.c:1623
void BKE_gpencil_stroke_sync_selection(struct bGPdata *gpd, struct bGPDstroke *gps)
Definition: gpencil.c:1092
void BKE_gpencil_strokes_selected_update_editcurve(struct bGPdata *gpd)
void BKE_gpencil_strokes_selected_sync_selection_editcurve(struct bGPdata *gpd)
void BKE_gpencil_stroke_geometry_update(struct bGPdata *gpd, struct bGPDstroke *gps)
bool BKE_gpencil_stroke_close(struct bGPDstroke *gps)
void BKE_gpencil_tag_light_update(struct bGPdata *gpd, struct bGPDlayer *gpl, struct bGPDframe *gpf, struct bGPDstroke *gps)
int BKE_icon_gplayer_color_ensure(struct bGPDlayer *gpl)
Definition: icons.cc:744
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.c:83
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:100
void void void bool BLI_listbase_link_move(ListBase *listbase, void *vlink, int step) ATTR_NONNULL()
Definition: listbase.c:405
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
#define M_PI_2
Definition: BLI_math_base.h:23
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
Definition: math_matrix.c:259
bool invert_m4_m4(float R[4][4], const float A[4][4])
Definition: math_matrix.c:1287
void loc_eul_size_to_mat4(float R[4][4], const float loc[3], const float eul[3], const float size[3])
Definition: math_matrix.c:2547
#define DEG2RADF(_deg)
MINLINE void copy_v3_v3(float r[3], const float a[3])
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:250
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL(1
bool BLI_uniquename(struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_len)
Definition: string_utils.c:309
#define UNUSED(x)
#define ELEM(...)
#define STREQ(a, b)
#define DATA_(msgid)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_TRANSFORM
Definition: DNA_ID.h:771
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:834
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
@ ID_GD
Definition: DNA_ID_enums.h:71
#define BEZT_SEL_ALL(bezt)
#define BEZT_DESEL_ALL(bezt)
@ BEZT_KEYTYPE_EXTREME
@ BEZT_KEYTYPE_JITTER
@ BEZT_KEYTYPE_BREAKDOWN
@ BEZT_KEYTYPE_MOVEHOLD
@ BEZT_KEYTYPE_KEYFRAME
#define MAX_NAME
Definition: DNA_defs.h:48
@ GP_ONION_MODE_RELATIVE
@ GP_ONION_MODE_SELECTED
@ GP_ONION_MODE_ABSOLUTE
@ GP_MASK_INVERT
@ GP_MASK_HIDE
@ GP_DRAWMODE_3D
@ GP_DRAWMODE_2D
@ GP_CURVE_SELECT
@ GP_STROKE_CAP_ROUND
@ GP_STROKE_CAP_FLAT
@ GP_STROKE_NOFILL
@ GP_STROKE_2DIMAGE
@ GP_STROKE_NEEDS_CURVE_UPDATE
@ GP_STROKE_SELECT
@ GP_STROKE_CYCLIC
@ GP_STROKE_2DSPACE
@ GP_STROKE_3DSPACE
#define GP_DEFAULT_CURVE_RESOLUTION
@ GP_LAYER_NO_XRAY
@ GP_LAYER_SOLO_MODE
@ GP_LAYER_IS_RULER
@ GP_LAYER_DISABLE_MASKS_IN_VIEWLAYER
@ GP_LAYER_LOCKED
@ GP_LAYER_DRAWDEBUG
@ GP_LAYER_FRAMELOCK
@ GP_LAYER_ACTIVE
@ GP_LAYER_SELECT
@ GP_LAYER_USE_MASK
@ GP_LAYER_UNLOCK_COLOR
@ GP_LAYER_HIDE
@ GP_LAYER_USE_LIGHTS
#define GP_DEFAULT_GRID_LINES
@ GP_LAYER_ONIONSKIN
#define GP_DEFAULT_CURVE_ERROR
@ GP_ONION_GHOST_NEXTCOL
@ GP_ONION_GHOST_ALWAYS
@ GP_ONION_GHOST_PREVCOL
@ GP_ONION_FADE
@ GP_ONION_LOOP
@ GP_FRAME_SELECT
@ GP_FRAME_PAINT
@ GP_DATA_SHOW_ONIONSKINS
@ GP_DATA_CURVE_ADAPTIVE_RESOLUTION
@ GP_DATA_STROKE_WEIGHTMODE
@ GP_DATA_STROKE_VERTEXMODE
@ GP_DATA_CURVE_EDIT_MODE
@ GP_DATA_STROKE_MULTIEDIT
@ GP_DATA_STROKE_PAINTMODE
@ GP_DATA_STROKE_SCULPTMODE
@ GP_DATA_AUTOLOCK_LAYERS
@ GP_DATA_STROKE_KEEPTHICKNESS
@ GP_DATA_ANNOTATIONS
@ GP_DATA_STROKE_EDITMODE
#define GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd)
@ GP_CURVE_POINT_SELECT
@ eGplBlendMode_Regular
@ eGplBlendMode_Add
@ eGplBlendMode_Multiply
@ eGplBlendMode_Divide
@ eGplBlendMode_Subtract
@ eGplBlendMode_HardLight
@ GP_SPOINT_SELECT
Object is a sort of wrapper for general info.
@ OB_ARMATURE
@ PARSKEL
@ PAROBJECT
@ PARBONE
#define MINAFRAME
@ GP_SELECTMODE_POINT
@ GP_SELECTMODE_SEGMENT
#define MAXFRAME
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
Read Guarded memory(de)allocation.
#define RNA_POINTER_INVALIDATE(ptr)
Definition: RNA_access.h:744
@ PARM_RNAPTR
Definition: RNA_types.h:354
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_USE_REPORTS
Definition: RNA_types.h:663
@ FUNC_USE_SELF_ID
Definition: RNA_types.h:650
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
#define RNA_TRANSLATION_PREC_DEFAULT
Definition: RNA_types.h:117
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:312
@ PROPOVERRIDE_NO_COMPARISON
Definition: RNA_types.h:320
@ PROP_THICK_WRAP
Definition: RNA_types.h:285
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_ID_SELF_CHECK
Definition: RNA_types.h:232
@ PROP_MATRIX
Definition: RNA_types.h:158
@ PROP_XYZ
Definition: RNA_types.h:162
@ PROP_COLOR
Definition: RNA_types.h:153
@ PROP_PIXEL
Definition: RNA_types.h:141
@ PROP_ANGLE
Definition: RNA_types.h:145
@ PROP_EULER
Definition: RNA_types.h:159
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_FACTOR
Definition: RNA_types.h:144
@ PROP_COLOR_GAMMA
Definition: RNA_types.h:165
@ PROP_TRANSLATION
Definition: RNA_types.h:154
@ PROP_UNSIGNED
Definition: RNA_types.h:142
#define C
Definition: RandGen.cpp:25
#define ND_DATA
Definition: WM_types.h:456
#define ND_GPENCIL_EDITMODE
Definition: WM_types.h:451
#define NC_SCREEN
Definition: WM_types.h:327
#define NC_MOVIECLIP
Definition: WM_types.h:347
#define ND_MODE
Definition: WM_types.h:393
#define ND_SPACE_PROPERTIES
Definition: WM_types.h:472
#define NC_SCENE
Definition: WM_types.h:328
#define ND_TOOLSETTINGS
Definition: WM_types.h:397
#define NA_EDITED
Definition: WM_types.h:523
#define ND_PARENT
Definition: WM_types.h:416
#define NC_GPENCIL
Definition: WM_types.h:349
#define NA_RENAME
Definition: WM_types.h:527
#define NC_OBJECT
Definition: WM_types.h:329
#define NA_SELECTED
Definition: WM_types.h:528
return(oflags[bm->toolflag_index].f &oflag) !=0
Scene scene
SyclQueue void void * src
int count
#define GS(x)
Definition: iris.c:225
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_recallocN_id)(void *vmemh, size_t len, const char *str)
Definition: mallocn.c:30
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
bool active
all scheduled work for the GPU.
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:186
void rna_def_animdata_common(StructRNA *srna)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
Definition: rna_define.c:3836
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2740
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1193
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4170
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1526
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3285
void RNA_def_property_float_default(PropertyRNA *prop, float value)
Definition: rna_define.c:2022
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3126
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2695
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Definition: rna_define.c:1653
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3474
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)
Definition: rna_define.c:3420
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
Definition: rna_define.c:1937
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
Definition: rna_define.c:1598
void RNA_def_property_int_default(PropertyRNA *prop, int value)
Definition: rna_define.c:1978
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1539
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1737
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2769
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
const int rna_matrix_dimsize_4x4[]
Definition: rna_define.c:1595
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
Definition: rna_define.c:2855
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2669
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
Definition: rna_define.c:4487
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
Definition: rna_define.c:1103
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4342
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
Definition: rna_define.c:4436
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3028
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3687
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_def_property_override_clear_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1508
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3597
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2493
void RNA_enum_items_add_value(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item, int value)
Definition: rna_define.c:4472
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1664
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3783
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2343
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
Definition: rna_define.c:2043
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2327
void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname)
Definition: rna_define.c:1119
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1503
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
static void rna_def_gpencil_stroke(BlenderRNA *brna)
Definition: rna_gpencil.c:1581
static EnumPropertyItem rna_enum_gpencil_stroke_depth_order_items[]
Definition: rna_gpencil.c:41
static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_gpencil.c:2296
static void rna_def_gpencil_mvert_group(BlenderRNA *brna)
Definition: rna_gpencil.c:1556
static EnumPropertyItem rna_enum_gpencil_onion_modes_items[]
Definition: rna_gpencil.c:51
static void rna_def_gpencil_frames_api(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_gpencil.c:1833
static const EnumPropertyItem rna_enum_layer_blend_modes_items[]
Definition: rna_gpencil.c:131
static void rna_def_gpencil_grid(BlenderRNA *brna)
Definition: rna_gpencil.c:2363
static const EnumPropertyItem parent_type_items[]
Definition: rna_gpencil.c:33
static void rna_def_gpencil_layers_mask_api(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_gpencil.c:1877
static const EnumPropertyItem rna_enum_gpencil_caps_modes_items[]
Definition: rna_gpencil.c:140
void RNA_def_gpencil(BlenderRNA *brna)
Definition: rna_gpencil.c:2719
static void rna_def_gpencil_stroke_points_api(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_gpencil.c:1289
static const EnumPropertyItem rna_enum_gplayer_move_type_items[]
Definition: rna_gpencil.c:125
static void rna_def_gpencil_data(BlenderRNA *brna)
Definition: rna_gpencil.c:2409
static void rna_def_gpencil_strokes_api(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_gpencil.c:1753
static void rna_def_gpencil_stroke_point(BlenderRNA *brna)
Definition: rna_gpencil.c:1226
static void rna_def_gpencil_curve_point(BlenderRNA *brna)
Definition: rna_gpencil.c:1413
static void rna_def_gpencil_triangle(BlenderRNA *brna)
Definition: rna_gpencil.c:1385
static void rna_def_gpencil_layer(BlenderRNA *brna)
Definition: rna_gpencil.c:1945
static const EnumPropertyItem rna_enum_keyframe_type_items[]
Definition: rna_gpencil.c:66
static const EnumPropertyItem rna_enum_onion_keyframe_type_items[]
Definition: rna_gpencil.c:95
static void rna_def_gpencil_curve(BlenderRNA *brna)
Definition: rna_gpencil.c:1535
static void rna_def_gpencil_frame(BlenderRNA *brna)
Definition: rna_gpencil.c:1785
static void rna_def_gpencil_layer_mask(BlenderRNA *brna)
Definition: rna_gpencil.c:1913
bool rna_GPencil_datablocks_obdata_poll(struct PointerRNA *ptr, const struct PointerRNA value)
bool rna_GPencil_datablocks_annotations_poll(struct PointerRNA *ptr, const struct PointerRNA value)
const EnumPropertyItem DummyRNA_DEFAULT_items[]
Definition: rna_rna.c:31
const EnumPropertyItem DummyRNA_NULL_items[]
Definition: rna_rna.c:26
#define min(a, b)
Definition: sort.c:35
uint8_t f3
float vec[3][3]
uint8_t f1
uint8_t f2
const char * identifier
Definition: RNA_types.h:461
Definition: DNA_ID.h:368
char name[66]
Definition: DNA_ID.h:378
void * first
Definition: DNA_listBase.h:31
struct MDeformWeight * dw
Definition: BKE_main.h:121
struct bPose * pose
float obmat[4][4]
struct StructRNA * type
Definition: RNA_types.h:37
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
struct ToolSettings * toolsettings
char gpencil_selectmode_edit
bGPDcurve_point * curve_points
ListBase strokes
float inverse[4][4]
struct Object * parent
char info[128]
struct bGPDlayer * next
bGPDframe * actframe
float layer_mat[4][4]
char parsubstr[64]
float layer_invmat[4][4]
ListBase frames
ListBase mask_layers
float rotation[3]
float scale[3]
float location[3]
bGPDspoint * points
struct bGPDcurve * editcurve
struct MDeformVert * dvert
struct bGPDstroke * next
ListBase layers
float pose_mat[4][4]
float max
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480