Blender V4.3
rna_grease_pencil.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2024 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include "BKE_attribute.h"
10#include "BKE_global.hh"
11
12#include "BLI_string.h"
13
15#include "DNA_scene_types.h"
16
17#include "RNA_access.hh"
18#include "RNA_define.hh"
19#include "RNA_enum_types.hh"
20
21#include "rna_internal.hh"
22
23#include "WM_api.hh"
24
25#ifdef RNA_RUNTIME
26
27# include <fmt/format.h>
28
29# include "BKE_attribute.hh"
30# include "BKE_curves.hh"
31# include "BKE_grease_pencil.hh"
32
33# include "BLI_math_matrix.hh"
34# include "BLI_span.hh"
35
36# include "DEG_depsgraph.hh"
37# include "DEG_depsgraph_build.hh"
38
39# include "ED_grease_pencil.hh"
40
41static GreasePencil *rna_grease_pencil(const PointerRNA *ptr)
42{
43 return reinterpret_cast<GreasePencil *>(ptr->owner_id);
44}
45
46static void rna_grease_pencil_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
47{
48 DEG_id_tag_update(&rna_grease_pencil(ptr)->id, ID_RECALC_GEOMETRY);
49 WM_main_add_notifier(NC_GPENCIL | NA_EDITED, rna_grease_pencil(ptr));
50}
51
52static void rna_grease_pencil_autolock(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
53{
54 using namespace blender::bke::greasepencil;
55 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
56 if (grease_pencil->flag & GREASE_PENCIL_AUTOLOCK_LAYERS) {
57 grease_pencil->autolock_inactive_layers();
58 }
59 else {
60 for (Layer *layer : grease_pencil->layers_for_write()) {
61 layer->set_locked(false);
62 }
63 }
64
65 rna_grease_pencil_update(nullptr, nullptr, ptr);
66}
67
68static void rna_grease_pencil_dependency_update(Main *bmain, Scene * /*scene*/, PointerRNA *ptr)
69{
70 DEG_id_tag_update(&rna_grease_pencil(ptr)->id, ID_RECALC_GEOMETRY);
72 WM_main_add_notifier(NC_GPENCIL | NA_EDITED, rna_grease_pencil(ptr));
73}
74
75static int rna_Drawing_user_count_get(PointerRNA *ptr)
76{
77 using namespace blender::bke::greasepencil;
78 const GreasePencilDrawing *drawing = static_cast<const GreasePencilDrawing *>(ptr->data);
79 return drawing->wrap().user_count();
80}
81
82static int rna_GreasePencilDrawing_curve_offset_data_length(PointerRNA *ptr)
83{
84 const GreasePencilDrawing *drawing = static_cast<GreasePencilDrawing *>(ptr->data);
85 return drawing->geometry.curve_num + 1;
86}
87
88static void rna_GreasePencilDrawing_curve_offset_data_begin(CollectionPropertyIterator *iter,
90{
91 GreasePencilDrawing *drawing = static_cast<GreasePencilDrawing *>(ptr->data);
93 drawing->geometry.wrap().offsets_for_write().data(),
94 sizeof(int),
95 drawing->geometry.curve_num + 1,
96 false,
97 nullptr);
98}
99
100static bool rna_GreasePencilDrawing_curve_offset_data_lookup_int(PointerRNA *ptr,
101 int index,
102 PointerRNA *r_ptr)
103{
104 GreasePencilDrawing *drawing = static_cast<GreasePencilDrawing *>(ptr->data);
105 if (index < 0 || index >= drawing->geometry.curve_num + 1) {
106 return false;
107 }
108 r_ptr->owner_id = ptr->owner_id;
109 r_ptr->type = &RNA_IntAttributeValue;
110 r_ptr->data = &drawing->geometry.wrap().offsets_for_write()[index];
111 return true;
112}
113
114static void rna_GreasePencilLayer_frames_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
115{
116 using namespace blender::bke::greasepencil;
117 Layer &layer = static_cast<GreasePencilLayer *>(ptr->data)->wrap();
118 blender::Span<FramesMapKeyT> sorted_keys = layer.sorted_keys();
119
121 iter, (void *)sorted_keys.data(), sizeof(FramesMapKeyT), sorted_keys.size(), false, nullptr);
122}
123
124static PointerRNA rna_GreasePencilLayer_frames_get(CollectionPropertyIterator *iter)
125{
126 using namespace blender::bke::greasepencil;
127 const FramesMapKeyT frame_key = *static_cast<FramesMapKeyT *>(rna_iterator_array_get(iter));
128 const Layer &layer = static_cast<GreasePencilLayer *>(iter->parent.data)->wrap();
129 const GreasePencilFrame *frame = layer.frames().lookup_ptr(frame_key);
131 &RNA_GreasePencilFrame,
132 static_cast<void *>(const_cast<GreasePencilFrame *>(frame)));
133}
134
135static int rna_GreasePencilLayer_frames_length(PointerRNA *ptr)
136{
137 using namespace blender::bke::greasepencil;
138 Layer &layer = static_cast<GreasePencilLayer *>(ptr->data)->wrap();
139 return layer.frames().size();
140}
141
142static bool rna_GreasePencilLayer_frames_lookup_int(PointerRNA *ptr, int index, PointerRNA *r_ptr)
143{
144 using namespace blender::bke::greasepencil;
145 GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
146 Layer &layer = static_cast<GreasePencilLayer *>(ptr->data)->wrap();
147 if (index < 0 || index >= layer.sorted_keys().size()) {
148 return false;
149 }
150 const FramesMapKeyT frame_key = layer.sorted_keys()[index];
151 const GreasePencilFrame *frame = layer.frames().lookup_ptr(frame_key);
152
153 r_ptr->owner_id = &grease_pencil.id;
154 r_ptr->type = &RNA_GreasePencilFrame;
155 r_ptr->data = static_cast<void *>(const_cast<GreasePencilFrame *>(frame));
156 return true;
157}
158
159static std::pair<int, const blender::bke::greasepencil::Layer *> find_layer_of_frame(
160 const GreasePencil &grease_pencil, const GreasePencilFrame &find_frame)
161{
162 using namespace blender::bke::greasepencil;
163 for (const Layer *layer : grease_pencil.layers()) {
164 for (const auto &[key, frame] : layer->frames().items()) {
165 if (&frame == &find_frame) {
166 return {int(key), layer};
167 }
168 }
169 }
170 return {0, nullptr};
171}
172
173static PointerRNA rna_Frame_drawing_get(PointerRNA *ptr)
174{
175 using namespace blender::bke::greasepencil;
176 const GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
177 GreasePencilFrame &frame_to_find = *static_cast<GreasePencilFrame *>(ptr->data);
178 if (frame_to_find.is_end()) {
179 return PointerRNA_NULL;
180 }
181
182 /* RNA doesn't give access to the parented layer object, so we have to iterate over all layers
183 * and search for the matching GreasePencilFrame pointer in the frames collection. */
184 auto [frame_number, this_layer] = find_layer_of_frame(grease_pencil, frame_to_find);
185 if (this_layer == nullptr) {
186 return PointerRNA_NULL;
187 }
188
189 const Drawing *drawing = grease_pencil.get_drawing_at(*this_layer, frame_number);
191 ptr, &RNA_GreasePencilDrawing, static_cast<void *>(const_cast<Drawing *>(drawing)));
192}
193
194static int rna_Frame_frame_number_get(PointerRNA *ptr)
195{
196 using namespace blender::bke::greasepencil;
197 const GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
198 GreasePencilFrame &frame_to_find = *static_cast<GreasePencilFrame *>(ptr->data);
199
200 /* RNA doesn't give access to the parented layer object, so we have to iterate over all layers
201 * and search for the matching GreasePencilFrame pointer in the frames collection. */
202 auto [frame_number, this_layer] = find_layer_of_frame(grease_pencil, frame_to_find);
203 /* Layer should exist. */
204 BLI_assert(this_layer != nullptr);
205 return frame_number;
206}
207
208static void rna_grease_pencil_layer_mask_name_get(PointerRNA *ptr, char *dst)
209{
210 using namespace blender;
211 GreasePencilLayerMask *mask = static_cast<GreasePencilLayerMask *>(ptr->data);
212 if (mask->layer_name != nullptr) {
213 strcpy(dst, mask->layer_name);
214 }
215 else {
216 dst[0] = '\0';
217 }
218}
219
220static int rna_grease_pencil_layer_mask_name_length(PointerRNA *ptr)
221{
222 using namespace blender;
223 GreasePencilLayerMask *mask = static_cast<GreasePencilLayerMask *>(ptr->data);
224 if (mask->layer_name != nullptr) {
225 return strlen(mask->layer_name);
226 }
227 return 0;
228}
229
230static void rna_grease_pencil_layer_mask_name_set(PointerRNA *ptr, const char *value)
231{
232 using namespace blender;
233 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
234 GreasePencilLayerMask *mask = static_cast<GreasePencilLayerMask *>(ptr->data);
235
236 const std::string oldname(mask->layer_name);
237 if (bke::greasepencil::TreeNode *node = grease_pencil->find_node_by_name(oldname)) {
238 grease_pencil->rename_node(*G_MAIN, *node, value);
239 }
240}
241
242static int rna_grease_pencil_active_mask_index_get(PointerRNA *ptr)
243{
244 GreasePencilLayer *layer = static_cast<GreasePencilLayer *>(ptr->data);
245 return layer->active_mask_index;
246}
247
248static void rna_grease_pencil_active_mask_index_set(PointerRNA *ptr, int value)
249{
250 GreasePencilLayer *layer = static_cast<GreasePencilLayer *>(ptr->data);
251 layer->active_mask_index = value;
252}
253
254static void rna_grease_pencil_active_mask_index_range(
255 PointerRNA *ptr, int *min, int *max, int * /*softmin*/, int * /*softmax*/)
256{
257 GreasePencilLayer *layer = static_cast<GreasePencilLayer *>(ptr->data);
258 *min = 0;
259 *max = max_ii(0, BLI_listbase_count(&layer->masks) - 1);
260}
261
262static void rna_iterator_grease_pencil_layers_begin(CollectionPropertyIterator *iter,
264{
265 using namespace blender::bke::greasepencil;
266 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
267 blender::Span<Layer *> layers = grease_pencil->layers_for_write();
268
270 iter, (void *)layers.data(), sizeof(Layer *), layers.size(), 0, nullptr);
271}
272
273static int rna_iterator_grease_pencil_layers_length(PointerRNA *ptr)
274{
275 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
276 return grease_pencil->layers().size();
277}
278
279static void tree_node_name_get(blender::bke::greasepencil::TreeNode &node, char *dst)
280{
281 if (!node.name().is_empty()) {
282 strcpy(dst, node.name().c_str());
283 }
284 else {
285 dst[0] = '\0';
286 }
287}
288
289static int tree_node_name_length(blender::bke::greasepencil::TreeNode &node)
290{
291 if (!node.name().is_empty()) {
292 return node.name().size();
293 }
294 return 0;
295}
296
297static std::optional<std::string> tree_node_name_path(blender::bke::greasepencil::TreeNode &node,
298 const char *prefix)
299{
300 using namespace blender::bke::greasepencil;
301 BLI_assert(!node.name().is_empty());
302 const size_t name_length = node.name().size();
303 std::string name_esc(name_length * 2, '\0');
304 BLI_str_escape(name_esc.data(), node.name().c_str(), name_length * 2);
305 return fmt::format("{}[\"{}\"]", prefix, name_esc.c_str());
306}
307
308static std::optional<std::string> rna_GreasePencilLayer_path(const PointerRNA *ptr)
309{
310 GreasePencilLayer *layer = static_cast<GreasePencilLayer *>(ptr->data);
311 return tree_node_name_path(layer->wrap().as_node(), "layers");
312}
313
314static void rna_GreasePencilLayer_name_get(PointerRNA *ptr, char *value)
315{
316 GreasePencilLayer *layer = static_cast<GreasePencilLayer *>(ptr->data);
317 tree_node_name_get(layer->wrap().as_node(), value);
318}
319
320static int rna_GreasePencilLayer_name_length(PointerRNA *ptr)
321{
322 GreasePencilLayer *layer = static_cast<GreasePencilLayer *>(ptr->data);
323 return tree_node_name_length(layer->wrap().as_node());
324}
325
326static void rna_GreasePencilLayer_name_set(PointerRNA *ptr, const char *value)
327{
328 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
329 GreasePencilLayer *layer = static_cast<GreasePencilLayer *>(ptr->data);
330
331 grease_pencil->rename_node(*G_MAIN, layer->wrap().as_node(), value);
332}
333
334static int rna_GreasePencilLayer_pass_index_get(PointerRNA *ptr)
335{
336 using namespace blender;
337 const GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
338 const bke::greasepencil::Layer &layer =
339 static_cast<const GreasePencilLayer *>(ptr->data)->wrap();
340 const int layer_idx = *grease_pencil.get_layer_index(layer);
341
342 const VArray layer_passes = *grease_pencil.attributes().lookup_or_default<int>(
343 "pass_index", bke::AttrDomain::Layer, 0);
344 return layer_passes[layer_idx];
345}
346
347static void rna_GreasePencilLayer_pass_index_set(PointerRNA *ptr, int value)
348{
349 using namespace blender;
350 GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
351 const bke::greasepencil::Layer &layer =
352 static_cast<const GreasePencilLayer *>(ptr->data)->wrap();
353 const int layer_idx = *grease_pencil.get_layer_index(layer);
354
355 bke::SpanAttributeWriter<int> layer_passes =
356 grease_pencil.attributes_for_write().lookup_or_add_for_write_span<int>(
357 "pass_index", bke::AttrDomain::Layer);
358 layer_passes.span[layer_idx] = std::max(0, value);
359 layer_passes.finish();
360}
361
362static void rna_GreasePencilLayer_parent_set(PointerRNA *ptr,
363 PointerRNA value,
364 ReportList * /*reports*/)
365{
366 using namespace blender;
367 bke::greasepencil::Layer &layer = static_cast<GreasePencilLayer *>(ptr->data)->wrap();
368 Object *parent = static_cast<Object *>(value.data);
369
370 ed::greasepencil::grease_pencil_layer_parent_set(layer, parent, layer.parent_bone_name(), false);
371}
372
373static void rna_GreasePencilLayer_bone_set(PointerRNA *ptr, const char *value)
374{
375 using namespace blender;
376 bke::greasepencil::Layer &layer = static_cast<GreasePencilLayer *>(ptr->data)->wrap();
377
378 ed::greasepencil::grease_pencil_layer_parent_set(layer, layer.parent, value, false);
379}
380
381static void rna_GreasePencilLayer_tint_color_get(PointerRNA *ptr, float *values)
382{
383 using namespace blender;
384 const GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
385 const bke::greasepencil::Layer &layer =
386 static_cast<const GreasePencilLayer *>(ptr->data)->wrap();
387 const int layer_idx = *grease_pencil.get_layer_index(layer);
388
389 const VArray tint_colors = *grease_pencil.attributes().lookup_or_default<ColorGeometry4f>(
390 "tint_color", bke::AttrDomain::Layer, ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f));
391 copy_v3_v3(values, tint_colors[layer_idx]);
392}
393
394static void rna_GreasePencilLayer_tint_color_set(PointerRNA *ptr, const float *values)
395{
396 using namespace blender;
397 GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
398 const bke::greasepencil::Layer &layer =
399 static_cast<const GreasePencilLayer *>(ptr->data)->wrap();
400 const int layer_idx = *grease_pencil.get_layer_index(layer);
401
403 grease_pencil.attributes_for_write().lookup_or_add_for_write_span<ColorGeometry4f>(
404 "tint_color",
405 bke::AttrDomain::Layer,
407 ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f), grease_pencil.layers().size())));
408
409 copy_v3_v3(tint_colors.span[layer_idx], values);
410 tint_colors.finish();
411}
412
413static float rna_GreasePencilLayer_tint_factor_get(PointerRNA *ptr)
414{
415 using namespace blender;
416 const GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
417 const bke::greasepencil::Layer &layer =
418 static_cast<const GreasePencilLayer *>(ptr->data)->wrap();
419 const int layer_idx = *grease_pencil.get_layer_index(layer);
420
421 const VArray tint_colors = *grease_pencil.attributes().lookup_or_default<ColorGeometry4f>(
422 "tint_color", bke::AttrDomain::Layer, ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f));
423 return tint_colors[layer_idx][3];
424}
425
426static void rna_GreasePencilLayer_tint_factor_set(PointerRNA *ptr, const float value)
427{
428 using namespace blender;
429 GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
430 const bke::greasepencil::Layer &layer =
431 static_cast<const GreasePencilLayer *>(ptr->data)->wrap();
432 const int layer_idx = *grease_pencil.get_layer_index(layer);
433
435 grease_pencil.attributes_for_write().lookup_or_add_for_write_span<ColorGeometry4f>(
436 "tint_color",
437 bke::AttrDomain::Layer,
439 ColorGeometry4f(0.0f, 0.0f, 0.0f, 0.0f), grease_pencil.layers().size())));
440
441 tint_colors.span[layer_idx][3] = value;
442 tint_colors.finish();
443}
444
445static float rna_GreasePencilLayer_radius_offset_get(PointerRNA *ptr)
446{
447 using namespace blender;
448 const GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
449 const bke::greasepencil::Layer &layer =
450 static_cast<const GreasePencilLayer *>(ptr->data)->wrap();
451 const int layer_idx = *grease_pencil.get_layer_index(layer);
452
453 const VArray radius_offsets = *grease_pencil.attributes().lookup_or_default<float>(
454 "radius_offset", bke::AttrDomain::Layer, 0.0f);
455 return radius_offsets[layer_idx];
456}
457
458static void rna_GreasePencilLayer_radius_offset_set(PointerRNA *ptr, const float value)
459{
460 using namespace blender;
461 GreasePencil &grease_pencil = *rna_grease_pencil(ptr);
462 const bke::greasepencil::Layer &layer =
463 static_cast<const GreasePencilLayer *>(ptr->data)->wrap();
464 const int layer_idx = *grease_pencil.get_layer_index(layer);
465
466 bke::SpanAttributeWriter<float> radius_offsets =
467 grease_pencil.attributes_for_write().lookup_or_add_for_write_span<float>(
468 "radius_offset",
469 bke::AttrDomain::Layer,
470 bke::AttributeInitVArray(VArray<float>::ForSingle(0.0f, grease_pencil.layers().size())));
471
472 radius_offsets.span[layer_idx] = value;
473 radius_offsets.finish();
474}
475
476static void rna_GreasePencilLayer_matrix_local_get(PointerRNA *ptr, float *values)
477{
479 static_cast<const GreasePencilLayer *>(ptr->data)->wrap();
480 std::copy_n(layer.local_transform().base_ptr(), 16, values);
481}
482
483static void rna_GreasePencilLayer_matrix_parent_inverse_get(PointerRNA *ptr, float *values)
484{
486 static_cast<const GreasePencilLayer *>(ptr->data)->wrap();
487 std::copy_n(layer.parent_inverse().base_ptr(), 16, values);
488}
489
490static PointerRNA rna_GreasePencilLayer_parent_layer_group_get(PointerRNA *ptr)
491{
493 blender::bke::greasepencil::LayerGroup *layer_group = &layer.parent_group();
494 /* Return None when layer is in the root group. */
495 if (!layer_group->as_node().parent_group()) {
496 return PointerRNA_NULL;
497 }
499 ptr, &RNA_GreasePencilLayerGroup, static_cast<void *>(layer_group));
500}
501
502static PointerRNA rna_GreasePencil_active_layer_get(PointerRNA *ptr)
503{
504 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
505 if (grease_pencil->has_active_layer()) {
507 ptr, &RNA_GreasePencilLayer, static_cast<void *>(grease_pencil->get_active_layer()));
508 }
509 return rna_pointer_inherit_refine(ptr, nullptr, nullptr);
510}
511
512static void rna_GreasePencil_active_layer_set(PointerRNA *ptr,
513 PointerRNA value,
514 ReportList * /*reports*/)
515{
516 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
517 grease_pencil->set_active_layer(static_cast<blender::bke::greasepencil::Layer *>(value.data));
519}
520
521static PointerRNA rna_GreasePencilLayerGroup_parent_group_get(PointerRNA *ptr)
522{
524 static_cast<GreasePencilLayerTreeGroup *>(ptr->data)->wrap();
525 blender::bke::greasepencil::LayerGroup *parent_group = layer_group.as_node().parent_group();
526 /* Return None when group is in the root group. */
527 if (!parent_group || parent_group == rna_grease_pencil(ptr)->root_group_ptr) {
528 return PointerRNA_NULL;
529 }
531 ptr, &RNA_GreasePencilLayerGroup, static_cast<void *>(parent_group));
532}
533
534static PointerRNA rna_GreasePencil_active_group_get(PointerRNA *ptr)
535{
536 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
537 if (grease_pencil->has_active_group()) {
539 ptr, &RNA_GreasePencilLayerGroup, static_cast<void *>(grease_pencil->get_active_group()));
540 }
541 return rna_pointer_inherit_refine(ptr, nullptr, nullptr);
542}
543
544static void rna_GreasePencil_active_group_set(PointerRNA *ptr,
545 PointerRNA value,
546 ReportList * /*reports*/)
547{
548 using namespace blender::bke::greasepencil;
549 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
550 TreeNode *node = static_cast<TreeNode *>(value.data);
551 if (node->is_group()) {
552 grease_pencil->set_active_node(node);
554 }
555}
556
557static std::optional<std::string> rna_GreasePencilLayerGroup_path(const PointerRNA *ptr)
558{
560 return tree_node_name_path(group->wrap().as_node(), "layer_groups");
561}
562
563static void rna_GreasePencilLayerGroup_name_get(PointerRNA *ptr, char *value)
564{
566 tree_node_name_get(group->wrap().as_node(), value);
567}
568
569static int rna_GreasePencilLayerGroup_name_length(PointerRNA *ptr)
570{
572 return tree_node_name_length(group->wrap().as_node());
573}
574
575static void rna_GreasePencilLayerGroup_name_set(PointerRNA *ptr, const char *value)
576{
577 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
579
580 grease_pencil->rename_node(*G_MAIN, group->wrap().as_node(), value);
581}
582
583static void rna_iterator_grease_pencil_layer_groups_begin(CollectionPropertyIterator *iter,
585{
586 using namespace blender::bke::greasepencil;
587 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
588
589 blender::Span<LayerGroup *> groups = grease_pencil->layer_groups_for_write();
590
592 iter, (void *)groups.data(), sizeof(LayerGroup *), groups.size(), 0, nullptr);
593}
594
595static int rna_iterator_grease_pencil_layer_groups_length(PointerRNA *ptr)
596{
597 GreasePencil *grease_pencil = rna_grease_pencil(ptr);
598 return grease_pencil->layer_groups().size();
599}
600
601#else
602
604{
605 StructRNA *srna;
606 PropertyRNA *prop;
607
608 static const EnumPropertyItem rna_enum_drawing_type_items[] = {
609 {GP_DRAWING, "DRAWING", 0, "Drawing", ""},
610 {GP_DRAWING_REFERENCE, "REFERENCE", 0, "Reference", ""},
611 {0, nullptr, 0, nullptr, nullptr}};
612
613 srna = RNA_def_struct(brna, "GreasePencilDrawing", nullptr);
614 RNA_def_struct_sdna(srna, "GreasePencilDrawing");
615 RNA_def_struct_ui_text(srna, "Grease Pencil Drawing", "A Grease Pencil drawing");
616
617 /* Type. */
618 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
619 RNA_def_property_enum_sdna(prop, nullptr, "base.type");
620 RNA_def_property_enum_items(prop, rna_enum_drawing_type_items);
622 RNA_def_property_ui_text(prop, "Type", "Drawing type");
623 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
624
625 /* User Count. */
626 prop = RNA_def_property(srna, "user_count", PROP_INT, PROP_NONE);
627 RNA_def_property_int_funcs(prop, "rna_Drawing_user_count_get", nullptr, nullptr);
629 RNA_def_property_ui_text(prop, "User Count", "The number of keyframes this drawing is used by");
630 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
631
632 /* Curve offsets. */
633 prop = RNA_def_property(srna, "curve_offsets", PROP_COLLECTION, PROP_NONE);
634 RNA_def_property_struct_type(prop, "IntAttributeValue");
637 "rna_GreasePencilDrawing_curve_offset_data_begin",
638 "rna_iterator_array_next",
639 "rna_iterator_array_end",
640 "rna_iterator_array_get",
641 "rna_GreasePencilDrawing_curve_offset_data_length",
642 "rna_GreasePencilDrawing_curve_offset_data_lookup_int",
643 nullptr,
644 nullptr);
647 prop, "Curve Offsets", "Offset indices of the first point of each curve");
648 RNA_def_property_update(prop, 0, "rna_grease_pencil_update");
649
651
652 /* Attributes. */
654}
655
657{
658 StructRNA *srna;
659 PropertyRNA *prop;
660
661 static const EnumPropertyItem rna_enum_keyframe_type_items[] = {
663 "KEYFRAME",
664 ICON_KEYTYPE_KEYFRAME_VEC,
665 "Keyframe",
666 "Normal keyframe, e.g. for key poses"},
668 "BREAKDOWN",
669 ICON_KEYTYPE_BREAKDOWN_VEC,
670 "Breakdown",
671 "A breakdown pose, e.g. for transitions between key poses"},
673 "MOVING_HOLD",
674 ICON_KEYTYPE_MOVING_HOLD_VEC,
675 "Moving Hold",
676 "A keyframe that is part of a moving hold"},
678 "EXTREME",
679 ICON_KEYTYPE_EXTREME_VEC,
680 "Extreme",
681 "An 'extreme' pose, or some other purpose as needed"},
683 "JITTER",
684 ICON_KEYTYPE_JITTER_VEC,
685 "Jitter",
686 "A filler or baked keyframe for keying on ones, or some other purpose as needed"},
688 "GENERATED",
689 ICON_KEYTYPE_GENERATED_VEC,
690 "Generated",
691 "A key generated automatically by a tool, not manually created"},
692 {0, nullptr, 0, nullptr, nullptr},
693 };
694
695 srna = RNA_def_struct(brna, "GreasePencilFrame", nullptr);
696 RNA_def_struct_sdna(srna, "GreasePencilFrame");
697 RNA_def_struct_ui_text(srna, "Grease Pencil Frame", "A Grease Pencil keyframe");
698
699 /* Drawing. */
700 prop = RNA_def_property(srna, "drawing", PROP_POINTER, PROP_NONE);
701 RNA_def_property_struct_type(prop, "GreasePencilDrawing");
702 RNA_def_property_pointer_funcs(prop, "rna_Frame_drawing_get", nullptr, nullptr, nullptr);
703 RNA_def_property_ui_text(prop, "Drawing", "A Grease Pencil drawing");
704 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
705
706 /* Frame number. */
707 prop = RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE);
708 /* TODO: Make property editable, ensure frame number isn't already in use. */
710 RNA_def_property_int_funcs(prop, "rna_Frame_frame_number_get", nullptr, nullptr);
712 RNA_def_property_ui_text(prop, "Frame Number", "The frame number in the scene");
713 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
714
715 /* Selection status. */
716 prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
717 RNA_def_property_boolean_sdna(prop, nullptr, "flag", GP_FRAME_SELECTED);
718 RNA_def_property_ui_text(prop, "Select", "Frame Selection in the Dope Sheet");
719 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
720
721 /* Keyframe type. */
722 prop = RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE);
723 RNA_def_property_enum_sdna(prop, nullptr, "type");
725 RNA_def_property_enum_items(prop, rna_enum_keyframe_type_items);
726 RNA_def_property_ui_text(prop, "Keyframe Type", "Type of keyframe");
727 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
728}
729
731{
732 StructRNA *srna;
733
734 RNA_def_property_srna(cprop, "GreasePencilFrames");
735 srna = RNA_def_struct(brna, "GreasePencilFrames", nullptr);
736 RNA_def_struct_sdna(srna, "GreasePencilLayer");
737 RNA_def_struct_ui_text(srna, "Grease Pencil Frames", "Collection of Grease Pencil frames");
738
740}
741
743{
744 StructRNA *srna;
745 PropertyRNA *prop;
746
747 srna = RNA_def_struct(brna, "GreasePencilLayerMask", nullptr);
748 RNA_def_struct_sdna(srna, "GreasePencilLayerMask");
749 RNA_def_struct_ui_text(srna, "Grease Pencil Masking Layers", "List of Mask Layers");
750 // RNA_def_struct_path_func(srna, "rna_GreasePencilLayerMask_path");
751
752 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
753 RNA_def_property_ui_text(prop, "Layer", "Mask layer name");
754 RNA_def_property_string_sdna(prop, nullptr, "layer_name");
756 "rna_grease_pencil_layer_mask_name_get",
757 "rna_grease_pencil_layer_mask_name_length",
758 "rna_grease_pencil_layer_mask_name_set");
762
763 prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
765 RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
766 RNA_def_property_ui_text(prop, "Hide", "Set mask Visibility");
767 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
768
769 prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
771 RNA_def_property_ui_icon(prop, ICON_SELECT_INTERSECT, 1);
772 RNA_def_property_ui_text(prop, "Invert", "Invert mask");
773 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
774}
775
777{
778 StructRNA *srna;
779 PropertyRNA *prop;
780
781 RNA_def_property_srna(cprop, "GreasePencilLayerMasks");
782 srna = RNA_def_struct(brna, "GreasePencilLayerMasks", nullptr);
783 RNA_def_struct_sdna(srna, "GreasePencilLayer");
785 srna, "Grease Pencil Mask Layers", "Collection of grease pencil masking layers");
786
787 prop = RNA_def_property(srna, "active_mask_index", PROP_INT, PROP_UNSIGNED);
790 "rna_grease_pencil_active_mask_index_get",
791 "rna_grease_pencil_active_mask_index_set",
792 "rna_grease_pencil_active_mask_index_range");
793 RNA_def_property_ui_text(prop, "Active Layer Mask Index", "Active index in layer mask array");
794}
795
797{
798 StructRNA *srna;
799 PropertyRNA *prop;
800
801 static const float scale_defaults[3] = {1.0f, 1.0f, 1.0f};
802
803 static const EnumPropertyItem rna_enum_layer_blend_modes_items[] = {
804 {GP_LAYER_BLEND_NONE, "REGULAR", 0, "Regular", ""},
805 {GP_LAYER_BLEND_HARDLIGHT, "HARDLIGHT", 0, "Hard Light", ""},
806 {GP_LAYER_BLEND_ADD, "ADD", 0, "Add", ""},
807 {GP_LAYER_BLEND_SUBTRACT, "SUBTRACT", 0, "Subtract", ""},
808 {GP_LAYER_BLEND_MULTIPLY, "MULTIPLY", 0, "Multiply", ""},
809 {GP_LAYER_BLEND_DIVIDE, "DIVIDE", 0, "Divide", ""},
810 {0, nullptr, 0, nullptr, nullptr}};
811
812 srna = RNA_def_struct(brna, "GreasePencilLayer", nullptr);
813 RNA_def_struct_sdna(srna, "GreasePencilLayer");
814 RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related drawings");
815 RNA_def_struct_path_func(srna, "rna_GreasePencilLayer_path");
816
817 /* Name */
818 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
819 RNA_def_property_ui_text(prop, "Name", "Layer name");
821 "rna_GreasePencilLayer_name_get",
822 "rna_GreasePencilLayer_name_length",
823 "rna_GreasePencilLayer_name_set");
825 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_RENAME, "rna_grease_pencil_update");
826
827 /* Frames. */
828 prop = RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE);
829 RNA_def_property_struct_type(prop, "GreasePencilFrame");
830 RNA_def_property_ui_text(prop, "Frames", "Grease Pencil frames");
832 "rna_GreasePencilLayer_frames_begin",
833 "rna_iterator_array_next",
834 "rna_iterator_array_end",
835 "rna_GreasePencilLayer_frames_get",
836 "rna_GreasePencilLayer_frames_length",
837 "rna_GreasePencilLayer_frames_lookup_int",
838 nullptr,
839 nullptr);
841
842 /* Mask Layers */
843 prop = RNA_def_property(srna, "mask_layers", PROP_COLLECTION, PROP_NONE);
844 RNA_def_property_collection_sdna(prop, nullptr, "masks", nullptr);
845 RNA_def_property_struct_type(prop, "GreasePencilLayerMask");
846 RNA_def_property_ui_text(prop, "Masks", "List of Masking Layers");
848
849 /* Visibility */
850 prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
852 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_HIDE);
853 RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
854 RNA_def_property_ui_text(prop, "Hide", "Set layer visibility");
855 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
856
857 /* Lock */
858 prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
860 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_LOCKED);
861 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
863 prop, "Locked", "Protect layer from further editing and/or frame changes");
864 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
865
866 /* Select. */
867 prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
869 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_SELECT);
870 RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the Dope Sheet");
871 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
872
873 /* Lock Frame. */
874 prop = RNA_def_property(srna, "lock_frame", PROP_BOOLEAN, PROP_NONE);
876 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_MUTE);
877 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
879 RNA_def_property_ui_text(prop, "Frame Locked", "Lock current frame displayed by layer");
880 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
881
882 /* Opacity */
883 prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_FACTOR);
884 RNA_def_property_float_sdna(prop, "GreasePencilLayer", "opacity");
885 RNA_def_property_ui_text(prop, "Opacity", "Layer Opacity");
886 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
887
888 /* Onion Skinning. */
889 prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
890 RNA_def_property_ui_icon(prop, ICON_ONIONSKIN_OFF, 1);
892 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING);
894 prop, "Onion Skinning", "Display onion skins before and after the current frame");
895 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
896
897 /* Tint Color. */
898 prop = RNA_def_property(srna, "tint_color", PROP_FLOAT, PROP_COLOR);
899 RNA_def_property_array(prop, 3);
901 "rna_GreasePencilLayer_tint_color_get",
902 "rna_GreasePencilLayer_tint_color_set",
903 nullptr);
904 RNA_def_property_range(prop, 0.0f, 1.0f);
905 RNA_def_property_ui_text(prop, "Tint Color", "Color for tinting stroke colors");
906 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
907
908 /* Tint Factor. */
909 prop = RNA_def_property(srna, "tint_factor", PROP_FLOAT, PROP_FACTOR);
911 "rna_GreasePencilLayer_tint_factor_get",
912 "rna_GreasePencilLayer_tint_factor_set",
913 nullptr);
914 RNA_def_property_range(prop, 0.0f, 1.0f);
915 RNA_def_property_ui_text(prop, "Tint Factor", "Factor of tinting color");
916 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
917
918 /* Radius Offset. */
919 prop = RNA_def_property(srna, "radius_offset", PROP_FLOAT, PROP_TRANSLATION);
921 "rna_GreasePencilLayer_radius_offset_get",
922 "rna_GreasePencilLayer_radius_offset_set",
923 nullptr);
925 RNA_def_property_ui_text(prop, "Radius Offset", "Radius change to apply to current strokes");
926 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
927
928 /* Use Masks. */
929 prop = RNA_def_property(srna, "use_masks", PROP_BOOLEAN, PROP_NONE);
930 RNA_def_property_ui_icon(prop, ICON_CLIPUV_HLT, -1);
932 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_HIDE_MASKS);
934 prop,
935 "Use Masks",
936 "The visibility of drawings on this layer is affected by the layers in its masks list");
937 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
938
939 prop = RNA_def_property(srna, "use_lights", PROP_BOOLEAN, PROP_NONE);
941 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_USE_LIGHTS);
943 prop, "Use Lights", "Enable the use of lights on stroke and fill materials");
944 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
945
946 /* pass index for compositing and modifiers */
947 prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_UNSIGNED);
948 RNA_def_property_ui_text(prop, "Pass Index", "Index number for the \"Layer Index\" pass");
950 "rna_GreasePencilLayer_pass_index_get",
951 "rna_GreasePencilLayer_pass_index_set",
952 nullptr);
953 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
954
955 prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE);
956 RNA_def_property_struct_type(prop, "Object");
958 prop, nullptr, "rna_GreasePencilLayer_parent_set", nullptr, nullptr);
961 RNA_def_property_ui_text(prop, "Parent", "Parent object");
962 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_dependency_update");
963
964 prop = RNA_def_property(srna, "parent_bone", PROP_STRING, PROP_NONE);
965 RNA_def_property_string_sdna(prop, nullptr, "parsubstr");
966 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_GreasePencilLayer_bone_set");
968 prop,
969 "Parent Bone",
970 "Name of parent bone. Only used when the parent object is an armature.");
971 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_dependency_update");
972
973 prop = RNA_def_property(srna, "translation", PROP_FLOAT, PROP_TRANSLATION);
974 RNA_def_property_array(prop, 3);
975 RNA_def_property_float_sdna(prop, nullptr, "translation");
977 RNA_def_property_ui_text(prop, "Translation", "Translation of the layer");
978 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
979
980 prop = RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER);
981 RNA_def_property_array(prop, 3);
982 RNA_def_property_float_sdna(prop, nullptr, "rotation");
984 RNA_def_property_ui_text(prop, "Rotation", "Euler rotation of the layer");
985 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
986
987 prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_XYZ);
988 RNA_def_property_array(prop, 3);
989 RNA_def_property_float_sdna(prop, nullptr, "scale");
990 RNA_def_property_float_array_default(prop, scale_defaults);
992 RNA_def_property_ui_text(prop, "Scale", "Scale of the layer");
993 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
994
995 prop = RNA_def_property(srna, "viewlayer_render", PROP_STRING, PROP_NONE);
996 RNA_def_property_string_sdna(prop, nullptr, "viewlayername");
998 prop,
999 "ViewLayer",
1000 "Only include Layer in this View Layer render output (leave blank to include always)");
1001
1002 prop = RNA_def_property(srna, "use_viewlayer_masks", PROP_BOOLEAN, PROP_NONE);
1004 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_DISABLE_MASKS_IN_VIEWLAYER);
1006 prop, "Use Masks in Render", "Include the mask layers when rendering the view-layer");
1007 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1008
1009 prop = RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE);
1010 RNA_def_property_enum_sdna(prop, nullptr, "blend_mode");
1011 RNA_def_property_enum_items(prop, rna_enum_layer_blend_modes_items);
1012 RNA_def_property_ui_text(prop, "Blend Mode", "Blend mode");
1013 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1014
1015 prop = RNA_def_property(srna, "ignore_locked_materials", PROP_BOOLEAN, PROP_NONE);
1017 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_IGNORE_LOCKED_MATERIALS);
1020 prop, "Ignore Material Locking", "Allow editing strokes even if they use locked materials");
1021 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, nullptr);
1022 /* Local transformation matrix. */
1023 prop = RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX);
1026 RNA_def_property_ui_text(prop, "Local Matrix", "Local transformation matrix of the layer");
1027 RNA_def_property_float_funcs(prop, "rna_GreasePencilLayer_matrix_local_get", nullptr, nullptr);
1028 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1029
1030 /* Inverse transform of layer's parent. */
1031 prop = RNA_def_property(srna, "matrix_parent_inverse", PROP_FLOAT, PROP_MATRIX);
1035 prop, "Inverse Parent Matrix", "Inverse of layer's parent transformation matrix");
1037 prop, "rna_GreasePencilLayer_matrix_parent_inverse_get", nullptr, nullptr);
1038
1039 /* Parent layer group. */
1040 prop = RNA_def_property(srna, "parent_group", PROP_POINTER, PROP_NONE);
1041 RNA_def_property_struct_type(prop, "GreasePencilLayerGroup");
1043 prop, "rna_GreasePencilLayer_parent_layer_group_get", nullptr, nullptr, nullptr);
1045 prop, "Parent Layer Group", "The parent layer group this layer is part of");
1046
1048}
1049
1051{
1052 StructRNA *srna;
1053 PropertyRNA *prop;
1054
1055 RNA_def_property_srna(cprop, "GreasePencilv3Layers");
1056 srna = RNA_def_struct(brna, "GreasePencilv3Layers", nullptr);
1057 RNA_def_struct_sdna(srna, "GreasePencil");
1058 RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of Grease Pencil layers");
1059
1060 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
1061 RNA_def_property_struct_type(prop, "GreasePencilLayer");
1063 "rna_GreasePencil_active_layer_get",
1064 "rna_GreasePencil_active_layer_set",
1065 nullptr,
1066 nullptr);
1068 RNA_def_property_ui_text(prop, "Active Layer", "Active Grease Pencil layer");
1070
1072}
1073
1075{
1076 StructRNA *srna;
1077 PropertyRNA *prop;
1078
1079 srna = RNA_def_struct(brna, "GreasePencilLayerGroup", nullptr);
1080 RNA_def_struct_sdna(srna, "GreasePencilLayerTreeGroup");
1081 RNA_def_struct_ui_text(srna, "Grease Pencil Layer Group", "Group of Grease Pencil layers");
1082 RNA_def_struct_path_func(srna, "rna_GreasePencilLayerGroup_path");
1083
1084 /* Name */
1085 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1086 RNA_def_property_ui_text(prop, "Name", "Group name");
1088 "rna_GreasePencilLayerGroup_name_get",
1089 "rna_GreasePencilLayerGroup_name_length",
1090 "rna_GreasePencilLayerGroup_name_set");
1091 RNA_def_struct_name_property(srna, prop);
1092 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA | NA_RENAME, "rna_grease_pencil_update");
1093
1094 /* Visibility */
1095 prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
1097 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_HIDE);
1098 RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
1099 RNA_def_property_ui_text(prop, "Hide", "Set layer group visibility");
1100 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1101
1102 /* Lock */
1103 prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE);
1105 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_LOCKED);
1106 RNA_def_property_ui_icon(prop, ICON_UNLOCKED, 1);
1108 prop, "Locked", "Protect group from further editing and/or frame changes");
1109 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1110
1111 /* Use Masks. */
1112 prop = RNA_def_property(srna, "use_masks", PROP_BOOLEAN, PROP_NONE);
1114 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_HIDE_MASKS);
1116 "Use Masks",
1117 "The visibility of drawings in the layers in this group is affected by "
1118 "the layers in the masks lists");
1119 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1120
1121 prop = RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
1122 RNA_def_property_ui_icon(prop, ICON_ONIONSKIN_OFF, 1);
1124 prop, "GreasePencilLayerTreeNode", "flag", GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING);
1126 prop, "Onion Skinning", "Display onion skins before and after the current frame");
1127 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1128
1129 /* Parent group. */
1130 prop = RNA_def_property(srna, "parent_group", PROP_POINTER, PROP_NONE);
1131 RNA_def_property_struct_type(prop, "GreasePencilLayerGroup");
1133 prop, "rna_GreasePencilLayerGroup_parent_group_get", nullptr, nullptr, nullptr);
1134 RNA_def_property_ui_text(prop, "Parent Group", "The parent group this group is part of");
1135}
1136
1138{
1139 StructRNA *srna;
1140 PropertyRNA *prop;
1141
1142 RNA_def_property_srna(cprop, "GreasePencilv3LayerGroup");
1143 srna = RNA_def_struct(brna, "GreasePencilv3LayerGroup", nullptr);
1144 RNA_def_struct_sdna(srna, "GreasePencil");
1145 RNA_def_struct_ui_text(srna, "Grease Pencil Group", "Collection of Grease Pencil layers");
1146
1147 prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
1148 RNA_def_property_struct_type(prop, "GreasePencilLayerGroup");
1150 "rna_GreasePencil_active_group_get",
1151 "rna_GreasePencil_active_group_set",
1152 nullptr,
1153 nullptr);
1155 RNA_def_property_ui_text(prop, "Active Layer Group", "Active Grease Pencil layer group");
1157
1159}
1160
1162{
1163 PropertyRNA *prop;
1164
1165 static EnumPropertyItem prop_enum_onion_modes_items[] = {
1167 "ABSOLUTE",
1168 0,
1169 "Frames",
1170 "Frames in absolute range of the scene frame"},
1172 "RELATIVE",
1173 0,
1174 "Keyframes",
1175 "Frames in relative range of the Grease Pencil keyframes"},
1176 {GP_ONION_SKINNING_MODE_SELECTED, "SELECTED", 0, "Selected", "Only selected keyframes"},
1177 {0, nullptr, 0, nullptr, nullptr},
1178 };
1179
1180 static EnumPropertyItem prop_enum_onion_keyframe_type_items[] = {
1181 {GREASE_PENCIL_ONION_SKINNING_FILTER_ALL, "ALL", 0, "All", "Include all Keyframe types"},
1183 "KEYFRAME",
1184 ICON_KEYTYPE_KEYFRAME_VEC,
1185 "Keyframe",
1186 "Normal keyframe, e.g. for key poses"},
1188 "BREAKDOWN",
1189 ICON_KEYTYPE_BREAKDOWN_VEC,
1190 "Breakdown",
1191 "A breakdown pose, e.g. for transitions between key poses"},
1193 "MOVING_HOLD",
1194 ICON_KEYTYPE_MOVING_HOLD_VEC,
1195 "Moving Hold",
1196 "A keyframe that is part of a moving hold"},
1198 "EXTREME",
1199 ICON_KEYTYPE_EXTREME_VEC,
1200 "Extreme",
1201 "An 'extreme' pose, or some other purpose as needed"},
1203 "JITTER",
1204 ICON_KEYTYPE_JITTER_VEC,
1205 "Jitter",
1206 "A filler or baked keyframe for keying on ones, or some other purpose as needed"},
1208 "GENERATED",
1209 ICON_KEYTYPE_GENERATED_VEC,
1210 "Generated",
1211 "A key generated automatically by a tool, not manually created"},
1212 {0, nullptr, 0, nullptr, nullptr},
1213 };
1214
1215 prop = RNA_def_property(srna, "ghost_before_range", PROP_INT, PROP_NONE);
1216 RNA_def_property_int_sdna(prop, nullptr, "onion_skinning_settings.num_frames_before");
1217 RNA_def_property_range(prop, 0, 120);
1220 "Frames Before",
1221 "Maximum number of frames to show before current frame "
1222 "(0 = don't show any frames before current)");
1223 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1224
1225 prop = RNA_def_property(srna, "ghost_after_range", PROP_INT, PROP_NONE);
1226 RNA_def_property_int_sdna(prop, nullptr, "onion_skinning_settings.num_frames_after");
1227 RNA_def_property_range(prop, 0, 120);
1230 "Frames After",
1231 "Maximum number of frames to show after current frame "
1232 "(0 = don't show any frames after current)");
1233 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1234
1235 prop = RNA_def_property(srna, "use_ghost_custom_colors", PROP_BOOLEAN, PROP_NONE);
1237 prop, nullptr, "onion_skinning_settings.flag", GP_ONION_SKINNING_USE_CUSTOM_COLORS);
1239 RNA_def_property_ui_text(prop, "Use Custom Ghost Colors", "Use custom colors for ghost frames");
1240 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1241
1242 prop = RNA_def_property(srna, "before_color", PROP_FLOAT, PROP_COLOR);
1243 RNA_def_property_float_sdna(prop, nullptr, "onion_skinning_settings.color_before");
1244 RNA_def_property_array(prop, 3);
1245 RNA_def_property_range(prop, 0.0f, 1.0f);
1247 RNA_def_property_ui_text(prop, "Before Color", "Base color for ghosts before the active frame");
1250 "rna_grease_pencil_update");
1251
1252 prop = RNA_def_property(srna, "after_color", PROP_FLOAT, PROP_COLOR);
1253 RNA_def_property_float_sdna(prop, nullptr, "onion_skinning_settings.color_after");
1254 RNA_def_property_array(prop, 3);
1255 RNA_def_property_range(prop, 0.0f, 1.0f);
1257 RNA_def_property_ui_text(prop, "After Color", "Base color for ghosts after the active frame");
1260 "rna_grease_pencil_update");
1261
1262 prop = RNA_def_property(srna, "onion_mode", PROP_ENUM, PROP_NONE);
1263 RNA_def_property_enum_sdna(prop, nullptr, "onion_skinning_settings.mode");
1264 RNA_def_property_enum_items(prop, prop_enum_onion_modes_items);
1266 RNA_def_property_ui_text(prop, "Mode", "Mode to display frames");
1267 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1268
1269 prop = RNA_def_property(srna, "onion_keyframe_type", PROP_ENUM, PROP_NONE);
1270 RNA_def_property_enum_sdna(prop, nullptr, "onion_skinning_settings.filter");
1272 RNA_def_property_enum_items(prop, prop_enum_onion_keyframe_type_items);
1273 RNA_def_property_ui_text(prop, "Filter by Type", "Type of keyframe (for filtering)");
1274 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1275
1276 prop = RNA_def_property(srna, "use_onion_fade", PROP_BOOLEAN, PROP_NONE);
1278 prop, nullptr, "onion_skinning_settings.flag", GP_ONION_SKINNING_USE_FADE);
1281 prop, "Fade", "Display onion keyframes with a fade in color transparency");
1282 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1283
1284 prop = RNA_def_property(srna, "use_onion_loop", PROP_BOOLEAN, PROP_NONE);
1286 prop, nullptr, "onion_skinning_settings.flag", GP_ONION_SKINNING_SHOW_LOOP);
1289 prop, "Show Start Frame", "Display onion keyframes for looping animations");
1290 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1291
1292 prop = RNA_def_property(srna, "onion_factor", PROP_FLOAT, PROP_NONE);
1293 RNA_def_property_float_sdna(prop, nullptr, "onion_skinning_settings.opacity");
1294 RNA_def_property_range(prop, 0.0, 1.0f);
1296 RNA_def_property_ui_text(prop, "Onion Opacity", "Change fade opacity of displayed onion frames");
1297 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1298}
1299
1301{
1302 StructRNA *srna;
1303 PropertyRNA *prop;
1304
1305 static EnumPropertyItem prop_stroke_depth_order_items[] = {
1306 {0, "2D", 0, "2D Layers", "Display strokes using grease pencil layers to define order"},
1308 "3D",
1309 0,
1310 "3D Location",
1311 "Display strokes using real 3D position in 3D space"},
1312 {0, nullptr, 0, nullptr, nullptr},
1313 };
1314
1315 srna = RNA_def_struct(brna, "GreasePencilv3", "ID");
1316 RNA_def_struct_sdna(srna, "GreasePencil");
1317 RNA_def_struct_ui_text(srna, "Grease Pencil", "Grease Pencil data-block");
1318 RNA_def_struct_ui_icon(srna, ICON_OUTLINER_DATA_GREASEPENCIL);
1319
1320 /* attributes */
1322
1323 /* Animation Data */
1325
1326 /* Materials */
1327 prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
1328 RNA_def_property_collection_sdna(prop, nullptr, "material_array", "material_array_num");
1329 RNA_def_property_struct_type(prop, "Material");
1330 RNA_def_property_ui_text(prop, "Materials", "");
1331 RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.cc */
1333 nullptr,
1334 nullptr,
1335 nullptr,
1336 nullptr,
1337 nullptr,
1338 nullptr,
1339 nullptr,
1340 "rna_IDMaterials_assign_int");
1341
1342 /* Layers */
1343 prop = RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);
1344 RNA_def_property_struct_type(prop, "GreasePencilLayer");
1346 "rna_iterator_grease_pencil_layers_begin",
1347 "rna_iterator_array_next",
1348 "rna_iterator_array_end",
1349 "rna_iterator_array_dereference_get",
1350 "rna_iterator_grease_pencil_layers_length",
1351 nullptr, /* TODO */
1352 nullptr, /* TODO */
1353 nullptr);
1354 RNA_def_property_ui_text(prop, "Layers", "Grease Pencil layers");
1355 rna_def_grease_pencil_layers(brna, prop);
1356
1357 /* Layer Groups */
1358 prop = RNA_def_property(srna, "layer_groups", PROP_COLLECTION, PROP_NONE);
1359 RNA_def_property_struct_type(prop, "GreasePencilLayerGroup");
1361 "rna_iterator_grease_pencil_layer_groups_begin",
1362 "rna_iterator_array_next",
1363 "rna_iterator_array_end",
1364 "rna_iterator_array_dereference_get",
1365 "rna_iterator_grease_pencil_layer_groups_length",
1366 nullptr, /* TODO */
1367 nullptr, /* TODO */
1368 nullptr);
1369 RNA_def_property_ui_text(prop, "Layer Groups", "Grease Pencil layer groups");
1371
1372 prop = RNA_def_property(srna, "use_autolock_layers", PROP_BOOLEAN, PROP_NONE);
1375 prop,
1376 "Auto-Lock Layers",
1377 "Automatically lock all layers except the active one to avoid accidental changes");
1378 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_autolock");
1379
1380 /* Uses a single flag, because the depth order can only be 2D or 3D. */
1381 prop = RNA_def_property(srna, "stroke_depth_order", PROP_ENUM, PROP_NONE);
1382 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
1383 RNA_def_property_enum_items(prop, prop_stroke_depth_order_items);
1385 prop,
1386 "Stroke Depth Order",
1387 "Defines how the strokes are ordered in 3D space (for objects not displayed 'In Front')");
1388 RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_grease_pencil_update");
1389
1390 /* Onion skinning. */
1392}
1393
1403
1404#endif
Generic geometry attributes built on CustomData.
Low-level operations for curves.
#define G_MAIN
Low-level operations for grease pencil.
#define BLI_assert(a)
Definition BLI_assert.h:50
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
MINLINE void copy_v3_v3(float r[3], const float a[3])
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1041
@ BEZT_KEYTYPE_EXTREME
@ BEZT_KEYTYPE_JITTER
@ BEZT_KEYTYPE_BREAKDOWN
@ BEZT_KEYTYPE_MOVEHOLD
@ BEZT_KEYTYPE_GENERATED
@ BEZT_KEYTYPE_KEYFRAME
@ GP_LAYER_BLEND_HARDLIGHT
@ GP_LAYER_BLEND_NONE
@ GP_LAYER_BLEND_MULTIPLY
@ GP_LAYER_BLEND_DIVIDE
@ GP_LAYER_BLEND_SUBTRACT
@ GP_ONION_SKINNING_MODE_ABSOLUTE
@ GP_ONION_SKINNING_MODE_SELECTED
@ GP_ONION_SKINNING_MODE_RELATIVE
@ GP_LAYER_MASK_INVERT
@ GP_LAYER_TREE_NODE_IGNORE_LOCKED_MATERIALS
@ GP_LAYER_TREE_NODE_LOCKED
@ GP_LAYER_TREE_NODE_MUTE
@ GP_LAYER_TREE_NODE_HIDE
@ GP_LAYER_TREE_NODE_SELECT
@ GP_LAYER_TREE_NODE_HIDE_ONION_SKINNING
@ GP_LAYER_TREE_NODE_USE_LIGHTS
@ GP_LAYER_TREE_NODE_HIDE_MASKS
@ GP_LAYER_TREE_NODE_DISABLE_MASKS_IN_VIEWLAYER
@ GP_DRAWING_REFERENCE
@ GREASE_PENCIL_AUTOLOCK_LAYERS
@ GREASE_PENCIL_STROKE_ORDER_3D
@ GP_ONION_SKINNING_USE_FADE
@ GP_ONION_SKINNING_SHOW_LOOP
@ GP_ONION_SKINNING_USE_CUSTOM_COLORS
@ GP_ONION_SKINNING_FILTER_KEYTYPE_MOVEHOLD
@ GP_ONION_SKINNING_FILTER_KEYTYPE_JITTER
@ GP_ONION_SKINNING_FILTER_KEYTYPE_KEYFRAME
@ GP_ONION_SKINNING_FILTER_KEYTYPE_BREAKDOWN
@ GP_ONION_SKINNING_FILTER_KEYTYPE_EXTREME
#define GREASE_PENCIL_ONION_SKINNING_FILTER_ALL
#define MINAFRAME
#define MAXFRAME
ParameterFlag
Definition RNA_types.hh:396
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_POINTER
Definition RNA_types.hh:70
@ PROP_COLLECTION
Definition RNA_types.hh:71
#define RNA_TRANSLATION_PREC_DEFAULT
Definition RNA_types.hh:127
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:355
@ PROPOVERRIDE_IGNORE
Definition RNA_types.hh:375
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_ID_SELF_CHECK
Definition RNA_types.hh:259
@ PROP_MATRIX
Definition RNA_types.hh:168
@ PROP_XYZ
Definition RNA_types.hh:172
@ PROP_COLOR
Definition RNA_types.hh:163
@ PROP_EULER
Definition RNA_types.hh:169
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_FACTOR
Definition RNA_types.hh:154
@ PROP_TRANSLATION
Definition RNA_types.hh:164
@ PROP_UNSIGNED
Definition RNA_types.hh:152
constexpr PointerRNA PointerRNA_NULL
Definition RNA_types.hh:45
#define ND_DATA
Definition WM_types.hh:475
#define NC_SCREEN
Definition WM_types.hh:344
#define NC_SCENE
Definition WM_types.hh:345
#define ND_TOOLSETTINGS
Definition WM_types.hh:416
#define NA_EDITED
Definition WM_types.hh:550
#define NC_GPENCIL
Definition WM_types.hh:366
#define NA_RENAME
Definition WM_types.hh:554
#define NA_SELECTED
Definition WM_types.hh:555
constexpr const T * data() const
Definition BLI_span.hh:216
constexpr int64_t size() const
Definition BLI_span.hh:253
const LayerGroup * parent_group() const
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
float wrap(float value, float max, float min)
Definition node_math.h:71
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
void * rna_iterator_array_get(CollectionPropertyIterator *iter)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
void rna_def_animdata_common(StructRNA *srna)
void rna_def_attributes_common(StructRNA *srna, const AttributeOwnerType type)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int length[])
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
const int rna_matrix_dimsize_4x4[]
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
static void rna_def_grease_pencil_frame(BlenderRNA *brna)
static void rna_def_grease_pencil_data(BlenderRNA *brna)
static void rna_def_grease_pencil_drawing(BlenderRNA *brna)
static void rna_def_grease_pencil_layer_group(BlenderRNA *brna)
static void rna_def_grease_pencil_layer_masks(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_grease_pencil_layer_mask(BlenderRNA *brna)
void RNA_def_grease_pencil(BlenderRNA *brna)
static void rna_def_grease_pencil_onion_skinning(StructRNA *srna)
static void rna_def_grease_pencil_layer_groups(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_grease_pencil_frames(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_grease_pencil_layer(BlenderRNA *brna)
static void rna_def_grease_pencil_layers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_api_grease_pencil_drawing(StructRNA *srna)
void RNA_api_grease_pencil_frames(StructRNA *srna)
void RNA_api_grease_pencil_layer(StructRNA *srna)
void RNA_api_grease_pencil_layers(StructRNA *srna)
void RNA_api_grease_pencil_layer_groups(StructRNA *srna)
#define min(a, b)
Definition sort.c:32
#define FLT_MAX
Definition stdcycles.h:14
ID * owner_id
Definition RNA_types.hh:40
StructRNA * type
Definition RNA_types.hh:41
void * data
Definition RNA_types.hh:42
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126