Blender V5.3
rna_linestyle.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdlib>
10
12
13#include "BLT_translation.hh"
14
15#include "RNA_define.hh"
16#include "RNA_enum_types.hh"
17
18#include "rna_internal.hh"
19
20#include "DNA_linestyle_types.h"
21#include "DNA_material_types.h"
22#include "DNA_texture_types.h"
23
24#include "WM_api.hh"
25#include "WM_types.hh"
26
27namespace blender {
28
30 {LS_MODIFIER_ALONG_STROKE, "ALONG_STROKE", ICON_MODIFIER, "Along Stroke", ""},
31 {LS_MODIFIER_CREASE_ANGLE, "CREASE_ANGLE", ICON_MODIFIER, "Crease Angle", ""},
32 {LS_MODIFIER_CURVATURE_3D, "CURVATURE_3D", ICON_MODIFIER, "Curvature 3D", ""},
34 "DISTANCE_FROM_CAMERA",
35 ICON_MODIFIER,
36 "Distance from Camera",
37 ""},
39 "DISTANCE_FROM_OBJECT",
40 ICON_MODIFIER,
41 "Distance from Object",
42 ""},
43 {LS_MODIFIER_MATERIAL, "MATERIAL", ICON_MODIFIER, "Material", ""},
44 {LS_MODIFIER_NOISE, "NOISE", ICON_MODIFIER, "Noise", ""},
45 {LS_MODIFIER_TANGENT, "TANGENT", ICON_MODIFIER, "Tangent", ""},
46 {0, nullptr, 0, nullptr, nullptr},
47};
48
50 {LS_MODIFIER_ALONG_STROKE, "ALONG_STROKE", ICON_MODIFIER, "Along Stroke", ""},
51 {LS_MODIFIER_CREASE_ANGLE, "CREASE_ANGLE", ICON_MODIFIER, "Crease Angle", ""},
52 {LS_MODIFIER_CURVATURE_3D, "CURVATURE_3D", ICON_MODIFIER, "Curvature 3D", ""},
54 "DISTANCE_FROM_CAMERA",
55 ICON_MODIFIER,
56 "Distance from Camera",
57 ""},
59 "DISTANCE_FROM_OBJECT",
60 ICON_MODIFIER,
61 "Distance from Object",
62 ""},
63 {LS_MODIFIER_MATERIAL, "MATERIAL", ICON_MODIFIER, "Material", ""},
64 {LS_MODIFIER_NOISE, "NOISE", ICON_MODIFIER, "Noise", ""},
65 {LS_MODIFIER_TANGENT, "TANGENT", ICON_MODIFIER, "Tangent", ""},
66 {0, nullptr, 0, nullptr, nullptr},
67};
68
70 {LS_MODIFIER_ALONG_STROKE, "ALONG_STROKE", ICON_MODIFIER, "Along Stroke", ""},
71 {LS_MODIFIER_CALLIGRAPHY, "CALLIGRAPHY", ICON_MODIFIER, "Calligraphy", ""},
72 {LS_MODIFIER_CREASE_ANGLE, "CREASE_ANGLE", ICON_MODIFIER, "Crease Angle", ""},
73 {LS_MODIFIER_CURVATURE_3D, "CURVATURE_3D", ICON_MODIFIER, "Curvature 3D", ""},
75 "DISTANCE_FROM_CAMERA",
76 ICON_MODIFIER,
77 "Distance from Camera",
78 ""},
80 "DISTANCE_FROM_OBJECT",
81 ICON_MODIFIER,
82 "Distance from Object",
83 ""},
84 {LS_MODIFIER_MATERIAL, "MATERIAL", ICON_MODIFIER, "Material", ""},
85 {LS_MODIFIER_NOISE, "NOISE", ICON_MODIFIER, "Noise", ""},
86 {LS_MODIFIER_TANGENT, "TANGENT", ICON_MODIFIER, "Tangent", ""},
87 {0, nullptr, 0, nullptr, nullptr},
88};
89
91 {LS_MODIFIER_2D_OFFSET, "2D_OFFSET", ICON_MODIFIER, "2D Offset", ""},
92 {LS_MODIFIER_2D_TRANSFORM, "2D_TRANSFORM", ICON_MODIFIER, "2D Transform", ""},
94 "BACKBONE_STRETCHER",
95 ICON_MODIFIER,
96 "Backbone Stretcher",
97 ""},
98 {LS_MODIFIER_BEZIER_CURVE, "BEZIER_CURVE", ICON_MODIFIER, "Bézier Curve", ""},
99 {LS_MODIFIER_BLUEPRINT, "BLUEPRINT", ICON_MODIFIER, "Blueprint", ""},
100 {LS_MODIFIER_GUIDING_LINES, "GUIDING_LINES", ICON_MODIFIER, "Guiding Lines", ""},
101 {LS_MODIFIER_PERLIN_NOISE_1D, "PERLIN_NOISE_1D", ICON_MODIFIER, "Perlin Noise 1D", ""},
102 {LS_MODIFIER_PERLIN_NOISE_2D, "PERLIN_NOISE_2D", ICON_MODIFIER, "Perlin Noise 2D", ""},
103 {LS_MODIFIER_POLYGONIZATION, "POLYGONIZATION", ICON_MODIFIER, "Polygonization", ""},
104 {LS_MODIFIER_SAMPLING, "SAMPLING", ICON_MODIFIER, "Sampling", ""},
105 {LS_MODIFIER_SIMPLIFICATION, "SIMPLIFICATION", ICON_MODIFIER, "Simplification", ""},
107 "SINUS_DISPLACEMENT",
108 ICON_MODIFIER,
109 "Sinus Displacement",
110 ""},
111 {LS_MODIFIER_SPATIAL_NOISE, "SPATIAL_NOISE", ICON_MODIFIER, "Spatial Noise", ""},
112 {LS_MODIFIER_TIP_REMOVER, "TIP_REMOVER", ICON_MODIFIER, "Tip Remover", ""},
113 {0, nullptr, 0, nullptr, nullptr},
114};
115
116} // namespace blender
117
118#ifdef RNA_RUNTIME
119
120# include <fmt/format.h>
121
122# include "BLI_string.hh"
123# include "BLI_string_utf8.hh"
124# include "BLI_string_utils.hh"
125
126# include "BKE_context.hh"
127# include "BKE_linestyle.h"
128# include "BKE_texture.h"
129
130# include "DEG_depsgraph.hh"
131
132# include "ED_node.hh"
133
134# include "RNA_access.hh"
135
136namespace blender {
137
138static StructRNA *rna_LineStyle_color_modifier_refine(PointerRNA *ptr)
139{
140 LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
141
142 switch (m->type) {
144 return RNA_LineStyleColorModifier_AlongStroke;
146 return RNA_LineStyleColorModifier_DistanceFromCamera;
148 return RNA_LineStyleColorModifier_DistanceFromObject;
150 return RNA_LineStyleColorModifier_Material;
152 return RNA_LineStyleColorModifier_Tangent;
154 return RNA_LineStyleColorModifier_Noise;
156 return RNA_LineStyleColorModifier_CreaseAngle;
158 return RNA_LineStyleColorModifier_Curvature_3D;
159 default:
160 return RNA_LineStyleColorModifier;
161 }
162}
163
164static StructRNA *rna_LineStyle_alpha_modifier_refine(PointerRNA *ptr)
165{
166 LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
167
168 switch (m->type) {
170 return RNA_LineStyleAlphaModifier_AlongStroke;
172 return RNA_LineStyleAlphaModifier_DistanceFromCamera;
174 return RNA_LineStyleAlphaModifier_DistanceFromObject;
176 return RNA_LineStyleAlphaModifier_Material;
178 return RNA_LineStyleAlphaModifier_Tangent;
180 return RNA_LineStyleAlphaModifier_Noise;
182 return RNA_LineStyleAlphaModifier_CreaseAngle;
184 return RNA_LineStyleAlphaModifier_Curvature_3D;
185 default:
186 return RNA_LineStyleAlphaModifier;
187 }
188}
189
190static StructRNA *rna_LineStyle_thickness_modifier_refine(PointerRNA *ptr)
191{
192 LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
193
194 switch (m->type) {
196 return RNA_LineStyleThicknessModifier_AlongStroke;
198 return RNA_LineStyleThicknessModifier_DistanceFromCamera;
200 return RNA_LineStyleThicknessModifier_DistanceFromObject;
202 return RNA_LineStyleThicknessModifier_Material;
204 return RNA_LineStyleThicknessModifier_Calligraphy;
206 return RNA_LineStyleThicknessModifier_Tangent;
208 return RNA_LineStyleThicknessModifier_Noise;
210 return RNA_LineStyleThicknessModifier_CreaseAngle;
212 return RNA_LineStyleThicknessModifier_Curvature_3D;
213 default:
214 return RNA_LineStyleThicknessModifier;
215 }
216}
217
218static StructRNA *rna_LineStyle_geometry_modifier_refine(PointerRNA *ptr)
219{
220 LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
221
222 switch (m->type) {
224 return RNA_LineStyleGeometryModifier_Sampling;
226 return RNA_LineStyleGeometryModifier_BezierCurve;
228 return RNA_LineStyleGeometryModifier_SinusDisplacement;
230 return RNA_LineStyleGeometryModifier_SpatialNoise;
232 return RNA_LineStyleGeometryModifier_PerlinNoise1D;
234 return RNA_LineStyleGeometryModifier_PerlinNoise2D;
236 return RNA_LineStyleGeometryModifier_BackboneStretcher;
238 return RNA_LineStyleGeometryModifier_TipRemover;
240 return RNA_LineStyleGeometryModifier_Polygonalization;
242 return RNA_LineStyleGeometryModifier_GuidingLines;
244 return RNA_LineStyleGeometryModifier_Blueprint;
246 return RNA_LineStyleGeometryModifier_2DOffset;
248 return RNA_LineStyleGeometryModifier_2DTransform;
250 return RNA_LineStyleGeometryModifier_Simplification;
251 default:
252 return RNA_LineStyleGeometryModifier;
253 }
254}
255
256static std::optional<std::string> rna_LineStyle_color_modifier_path(const PointerRNA *ptr)
257{
258 const LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
259 char name_esc[sizeof(m->name) * 2];
260 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
261 return fmt::format("color_modifiers[\"{}\"]", name_esc);
262}
263
264static std::optional<std::string> rna_LineStyle_alpha_modifier_path(const PointerRNA *ptr)
265{
266 const LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
267 char name_esc[sizeof(m->name) * 2];
268 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
269 return fmt::format("alpha_modifiers[\"{}\"]", name_esc);
270}
271
272static std::optional<std::string> rna_LineStyle_thickness_modifier_path(const PointerRNA *ptr)
273{
274 const LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
275 char name_esc[sizeof(m->name) * 2];
276 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
277 return fmt::format("thickness_modifiers[\"{}\"]", name_esc);
278}
279
280static std::optional<std::string> rna_LineStyle_geometry_modifier_path(const PointerRNA *ptr)
281{
282 const LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
283 char name_esc[sizeof(m->name) * 2];
284 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
285 return fmt::format("geometry_modifiers[\"{}\"]", name_esc);
286}
287
288static void rna_LineStyleColorModifier_name_set(PointerRNA *ptr, const char *value)
289{
290 FreestyleLineStyle *linestyle = id_cast<FreestyleLineStyle *>(ptr->owner_id);
291 LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
292
293 STRNCPY_UTF8(m->name, value);
294 BLI_uniquename(&linestyle->color_modifiers,
295 m,
296 "ColorModifier",
297 '.',
299 sizeof(m->name));
300}
301
302static void rna_LineStyleAlphaModifier_name_set(PointerRNA *ptr, const char *value)
303{
304 FreestyleLineStyle *linestyle = id_cast<FreestyleLineStyle *>(ptr->owner_id);
305 LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
306
307 STRNCPY_UTF8(m->name, value);
308 BLI_uniquename(&linestyle->alpha_modifiers,
309 m,
310 "AlphaModifier",
311 '.',
313 sizeof(m->name));
314}
315
316static void rna_LineStyleThicknessModifier_name_set(PointerRNA *ptr, const char *value)
317{
318 FreestyleLineStyle *linestyle = id_cast<FreestyleLineStyle *>(ptr->owner_id);
319 LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
320
321 STRNCPY_UTF8(m->name, value);
322 BLI_uniquename(&linestyle->thickness_modifiers,
323 m,
324 "ThicknessModifier",
325 '.',
327 sizeof(m->name));
328}
329
330static void rna_LineStyleGeometryModifier_name_set(PointerRNA *ptr, const char *value)
331{
332 FreestyleLineStyle *linestyle = id_cast<FreestyleLineStyle *>(ptr->owner_id);
333 LineStyleModifier *m = static_cast<LineStyleModifier *>(ptr->data);
334
335 STRNCPY_UTF8(m->name, value);
336 BLI_uniquename(&linestyle->geometry_modifiers,
337 m,
338 "GeometryModifier",
339 '.',
341 sizeof(m->name));
342}
343
344static void rna_LineStyle_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
345{
346 FreestyleLineStyle *linestyle = id_cast<FreestyleLineStyle *>(ptr->owner_id);
348 iter, ptr, static_cast<void *>(linestyle->mtex), sizeof(MTex *), MAX_MTEX, 0, nullptr);
349}
350
351static PointerRNA rna_LineStyle_active_texture_get(PointerRNA *ptr)
352{
353 FreestyleLineStyle *linestyle = id_cast<FreestyleLineStyle *>(ptr->owner_id);
354 Tex *tex;
355
356 tex = give_current_linestyle_texture(linestyle);
357 return RNA_id_pointer_create(reinterpret_cast<ID *>(tex));
358}
359
360static void rna_LineStyle_active_texture_set(PointerRNA *ptr,
361 PointerRNA value,
362 ReportList * /*reports*/)
363{
364 FreestyleLineStyle *linestyle = id_cast<FreestyleLineStyle *>(ptr->owner_id);
365
366 set_current_linestyle_texture(linestyle, static_cast<Tex *>(value.data));
367}
368
369static void rna_LineStyle_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
370{
371 FreestyleLineStyle *linestyle = id_cast<FreestyleLineStyle *>(ptr->owner_id);
372
373 DEG_id_tag_update(&linestyle->id, 0);
375}
376
377static void rna_LineStyle_use_nodes_update(bContext *C, PointerRNA *ptr)
378{
379 FreestyleLineStyle *linestyle = static_cast<FreestyleLineStyle *>(ptr->data);
380
381 if (linestyle->use_nodes && linestyle->nodetree == nullptr) {
383 }
384
385 rna_LineStyle_update(CTX_data_main(C), CTX_data_scene(C), ptr);
386}
387
388static LineStyleModifier *rna_LineStyle_color_modifier_add(FreestyleLineStyle *linestyle,
389 ReportList *reports,
390 const char *name,
391 int type)
392{
394 linestyle, name, eLineStyleModifier_Type(type));
395
396 if (!modifier) {
397 BKE_report(reports, RPT_ERROR, "Failed to add the color modifier");
398 return nullptr;
399 }
400
401 DEG_id_tag_update(&linestyle->id, 0);
403
404 return modifier;
405}
406
407static void rna_LineStyle_color_modifier_remove(FreestyleLineStyle *linestyle,
408 ReportList *reports,
409 PointerRNA *modifier_ptr)
410{
411 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
412
413 if (BKE_linestyle_color_modifier_remove(linestyle, modifier) == -1) {
414 BKE_reportf(reports, RPT_ERROR, "Color modifier '%s' could not be removed", modifier->name);
415 return;
416 }
417
418 modifier_ptr->invalidate();
419
420 DEG_id_tag_update(&linestyle->id, 0);
422}
423
424static LineStyleModifier *rna_LineStyle_alpha_modifier_add(FreestyleLineStyle *linestyle,
425 ReportList *reports,
426 const char *name,
427 int type)
428{
430 linestyle, name, eLineStyleModifier_Type(type));
431
432 if (!modifier) {
433 BKE_report(reports, RPT_ERROR, "Failed to add the alpha modifier");
434 return nullptr;
435 }
436
437 DEG_id_tag_update(&linestyle->id, 0);
439
440 return modifier;
441}
442
443static void rna_LineStyle_alpha_modifier_remove(FreestyleLineStyle *linestyle,
444 ReportList *reports,
445 PointerRNA *modifier_ptr)
446{
447 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
448
449 if (BKE_linestyle_alpha_modifier_remove(linestyle, modifier) == -1) {
450 BKE_reportf(reports, RPT_ERROR, "Alpha modifier '%s' could not be removed", modifier->name);
451 return;
452 }
453
454 modifier_ptr->invalidate();
455
456 DEG_id_tag_update(&linestyle->id, 0);
458}
459
460static LineStyleModifier *rna_LineStyle_thickness_modifier_add(FreestyleLineStyle *linestyle,
461 ReportList *reports,
462 const char *name,
463 int type)
464{
466 linestyle, name, eLineStyleModifier_Type(type));
467
468 if (!modifier) {
469 BKE_report(reports, RPT_ERROR, "Failed to add the thickness modifier");
470 return nullptr;
471 }
472
473 DEG_id_tag_update(&linestyle->id, 0);
475
476 return modifier;
477}
478
479static void rna_LineStyle_thickness_modifier_remove(FreestyleLineStyle *linestyle,
480 ReportList *reports,
481 PointerRNA *modifier_ptr)
482{
483 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
484
487 reports, RPT_ERROR, "Thickness modifier '%s' could not be removed", modifier->name);
488 return;
489 }
490
491 modifier_ptr->invalidate();
492
493 DEG_id_tag_update(&linestyle->id, 0);
495}
496
497static LineStyleModifier *rna_LineStyle_geometry_modifier_add(FreestyleLineStyle *linestyle,
498 ReportList *reports,
499 const char *name,
500 int type)
501{
503 linestyle, name, eLineStyleModifier_Type(type));
504
505 if (!modifier) {
506 BKE_report(reports, RPT_ERROR, "Failed to add the geometry modifier");
507 return nullptr;
508 }
509
510 DEG_id_tag_update(&linestyle->id, 0);
512
513 return modifier;
514}
515
516static void rna_LineStyle_geometry_modifier_remove(FreestyleLineStyle *linestyle,
517 ReportList *reports,
518 PointerRNA *modifier_ptr)
519{
520 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
521
522 if (BKE_linestyle_geometry_modifier_remove(linestyle, modifier) == -1) {
523 BKE_reportf(reports, RPT_ERROR, "Geometry modifier '%s' could not be removed", modifier->name);
524 return;
525 }
526
527 modifier_ptr->invalidate();
528
529 DEG_id_tag_update(&linestyle->id, 0);
531}
532
533} // namespace blender
534
535#else
536
537namespace blender {
538
540{
541 StructRNA *srna;
542 PropertyRNA *prop;
543
544 static const EnumPropertyItem texco_items[] = {
545 {TEXCO_WINDOW, "WINDOW", 0, "Window", "Use screen coordinates as texture coordinates"},
546 {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"},
548 "ALONG_STROKE",
549 0,
550 "Along stroke",
551 "Use stroke length for texture coordinates"},
552 {TEXCO_ORCO,
553 "ORCO",
554 0,
555 "Generated",
556 "Use the original undeformed coordinates of the object"},
557 {0, nullptr, 0, nullptr, nullptr},
558 };
559
560 static const EnumPropertyItem prop_mapping_items[] = {
561 {MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"},
562 {MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"},
563 {MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"},
564 {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"},
565 {0, nullptr, 0, nullptr, nullptr},
566 };
567
568 static const EnumPropertyItem prop_x_mapping_items[] = {
569 {0, "NONE", 0, "None", ""},
570 {1, "X", 0, "X", ""},
571 {2, "Y", 0, "Y", ""},
572 {3, "Z", 0, "Z", ""},
573 {0, nullptr, 0, nullptr, nullptr},
574 };
575
576 static const EnumPropertyItem prop_y_mapping_items[] = {
577 {0, "NONE", 0, "None", ""},
578 {1, "X", 0, "X", ""},
579 {2, "Y", 0, "Y", ""},
580 {3, "Z", 0, "Z", ""},
581 {0, nullptr, 0, nullptr, nullptr},
582 };
583
584 static const EnumPropertyItem prop_z_mapping_items[] = {
585 {0, "NONE", 0, "None", ""},
586 {1, "X", 0, "X", ""},
587 {2, "Y", 0, "Y", ""},
588 {3, "Z", 0, "Z", ""},
589 {0, nullptr, 0, nullptr, nullptr},
590 };
591
592 srna = RNA_def_struct(brna, "LineStyleTextureSlot", "TextureSlot");
593 RNA_def_struct_sdna(srna, "MTex");
595 srna, "LineStyle Texture Slot", "Texture slot for textures in a LineStyle data-block");
596
597 prop = RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
598 RNA_def_property_enum_sdna(prop, nullptr, "projx");
599 RNA_def_property_enum_items(prop, prop_x_mapping_items);
600 RNA_def_property_ui_text(prop, "X Mapping", "");
601 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
602
603 prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
604 RNA_def_property_enum_sdna(prop, nullptr, "projy");
605 RNA_def_property_enum_items(prop, prop_y_mapping_items);
606 RNA_def_property_ui_text(prop, "Y Mapping", "");
607 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
608
609 prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
610 RNA_def_property_enum_sdna(prop, nullptr, "projz");
611 RNA_def_property_enum_items(prop, prop_z_mapping_items);
612 RNA_def_property_ui_text(prop, "Z Mapping", "");
613 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
614
615 prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
616 RNA_def_property_enum_items(prop, prop_mapping_items);
617 RNA_def_property_ui_text(prop, "Mapping", "");
619 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
620
621 /* map to */
622 prop = RNA_def_property(srna, "use_map_color_diffuse", PROP_BOOLEAN, PROP_NONE);
623 RNA_def_property_boolean_sdna(prop, nullptr, "mapto", MAP_COL);
624 RNA_def_property_ui_text(prop, "Diffuse Color", "The texture affects basic color of the stroke");
625 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
626
627 prop = RNA_def_property(srna, "use_map_alpha", PROP_BOOLEAN, PROP_NONE);
628 RNA_def_property_boolean_sdna(prop, nullptr, "mapto", MAP_ALPHA);
629 RNA_def_property_ui_text(prop, "Alpha", "The texture affects the alpha value");
630 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
631
632 prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
633 RNA_def_property_enum_sdna(prop, nullptr, "texco");
634 RNA_def_property_enum_items(prop, texco_items);
637 "Texture Coordinates",
638 "Texture coordinates used to map the texture onto the background");
639 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
640
641 prop = RNA_def_property(srna, "alpha_factor", PROP_FLOAT, PROP_NONE);
642 RNA_def_property_float_sdna(prop, nullptr, "alphafac");
643 RNA_def_property_ui_range(prop, -1, 1, 10, 3);
644 RNA_def_property_ui_text(prop, "Alpha Factor", "Amount texture affects alpha");
645 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
646
647 prop = RNA_def_property(srna, "diffuse_color_factor", PROP_FLOAT, PROP_NONE);
648 RNA_def_property_float_sdna(prop, nullptr, "colfac");
649 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
650 RNA_def_property_ui_text(prop, "Diffuse Color Factor", "Amount texture affects diffuse color");
651 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
652}
653
655 const EnumPropertyItem *modifier_type_items,
656 const bool blend,
657 const bool color)
658{
659 PropertyRNA *prop;
660
661 /* TODO: Check this is not already defined somewhere else, e.g. in nodes... */
662 static const EnumPropertyItem value_blend_items[] = {
663 {LS_VALUE_BLEND, "MIX", 0, "Mix", ""},
664 {LS_VALUE_ADD, "ADD", 0, "Add", ""},
665 {LS_VALUE_SUB, "SUBTRACT", 0, "Subtract", ""},
666 {LS_VALUE_MULT, "MULTIPLY", 0, "Multiply", ""},
667 {LS_VALUE_DIV, "DIVIDE", 0, "Divide", ""},
668 {LS_VALUE_DIFF, "DIFFERENCE", 0, "Difference", ""},
669 {LS_VALUE_MIN, "MINIMUM", 0, "Minimum", ""},
670 {LS_VALUE_MAX, "MAXIMUM", 0, "Maximum", ""},
671 {0, nullptr, 0, nullptr, nullptr},
672 };
673
674 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
675 RNA_def_property_enum_sdna(prop, nullptr, "modifier.type");
676 RNA_def_property_enum_items(prop, modifier_type_items);
678 RNA_def_property_ui_text(prop, "Modifier Type", "Type of the modifier");
679
680 if (blend) {
681 prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
682 RNA_def_property_enum_sdna(prop, nullptr, "modifier.blend");
683 RNA_def_property_enum_items(prop, (color) ? rna_enum_ramp_blend_items : value_blend_items);
685 prop, "Blend", "Specify how the modifier value is blended into the base value");
686 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
687
688 prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
689 RNA_def_property_float_sdna(prop, nullptr, "modifier.influence");
690 RNA_def_property_range(prop, 0.0f, 1.0f);
692 prop, "Influence", "Influence factor by which the modifier changes the property");
693 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
694 }
695
696 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
697 RNA_def_property_boolean_sdna(prop, nullptr, "modifier.flags", LS_MODIFIER_ENABLED);
698 RNA_def_property_ui_text(prop, "Use", "Enable or disable this modifier during stroke rendering");
699 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
700
701 prop = RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
702 RNA_def_property_boolean_sdna(prop, nullptr, "modifier.flags", LS_MODIFIER_EXPANDED);
703 RNA_def_property_ui_text(prop, "Expanded", "True if the modifier tab is expanded");
704}
705
710
715
721
727
729{
730 PropertyRNA *prop;
731
732 prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NONE);
733 RNA_def_property_pointer_sdna(prop, nullptr, "color_ramp");
734 RNA_def_property_struct_type(prop, "ColorRamp");
735 RNA_def_property_ui_text(prop, "Color Ramp", "Color ramp used to change line color");
736 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
737
738 if (range) {
739 prop = RNA_def_property(srna, "range_min", PROP_FLOAT, PROP_DISTANCE);
740 RNA_def_property_float_sdna(prop, nullptr, "range_min");
742 prop, "Range Min", "Lower bound of the input range the mapping is applied");
743 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
744
745 prop = RNA_def_property(srna, "range_max", PROP_FLOAT, PROP_DISTANCE);
746 RNA_def_property_float_sdna(prop, nullptr, "range_max");
748 prop, "Range Max", "Upper bound of the input range the mapping is applied");
749 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
750 }
751}
752
753static void rna_def_modifier_curve_common(StructRNA *srna, bool range, bool value)
754{
755 PropertyRNA *prop;
756
757 static const EnumPropertyItem mapping_items[] = {
758 {0, "LINEAR", 0, "Linear", "Use linear mapping"},
759 {LS_MODIFIER_USE_CURVE, "CURVE", 0, "Curve", "Use curve mapping"},
760 {0, nullptr, 0, nullptr, nullptr},
761 };
762
763 prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
764 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
765 RNA_def_property_enum_items(prop, mapping_items);
766 RNA_def_property_ui_text(prop, "Mapping", "Select the mapping type");
767 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
768
769 prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
770 RNA_def_property_boolean_sdna(prop, nullptr, "flags", LS_MODIFIER_INVERT);
771 RNA_def_property_ui_text(prop, "Invert", "Invert the fade-out direction of the linear mapping");
772 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
773
774 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
775 RNA_def_property_pointer_sdna(prop, nullptr, "curve");
776 RNA_def_property_struct_type(prop, "CurveMapping");
777 RNA_def_property_ui_text(prop, "Curve", "Curve used for the curve mapping");
778 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
779
780 if (range) {
781 prop = RNA_def_property(srna, "range_min", PROP_FLOAT, PROP_DISTANCE);
782 RNA_def_property_float_sdna(prop, nullptr, "range_min");
784 prop, "Range Min", "Lower bound of the input range the mapping is applied");
785 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
786
787 prop = RNA_def_property(srna, "range_max", PROP_FLOAT, PROP_DISTANCE);
788 RNA_def_property_float_sdna(prop, nullptr, "range_max");
790 prop, "Range Max", "Upper bound of the input range the mapping is applied");
791 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
792 }
793
794 if (value) {
795 prop = RNA_def_property(srna, "value_min", PROP_FLOAT, PROP_NONE);
796 RNA_def_property_float_sdna(prop, nullptr, "value_min");
797 RNA_def_property_ui_text(prop, "Value Min", "Minimum output value of the mapping");
798 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
799
800 prop = RNA_def_property(srna, "value_max", PROP_FLOAT, PROP_NONE);
801 RNA_def_property_float_sdna(prop, nullptr, "value_max");
802 RNA_def_property_ui_text(prop, "Value Max", "Maximum output value of the mapping");
803 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
804 }
805}
806
808{
809 PropertyRNA *prop;
810
811 static const EnumPropertyItem mat_attr_items[] = {
812 {LS_MODIFIER_MATERIAL_LINE, "LINE", 0, "Line Color", ""},
813 {LS_MODIFIER_MATERIAL_LINE_R, "LINE_R", 0, "Line Color Red", ""},
814 {LS_MODIFIER_MATERIAL_LINE_G, "LINE_G", 0, "Line Color Green", ""},
815 {LS_MODIFIER_MATERIAL_LINE_B, "LINE_B", 0, "Line Color Blue", ""},
816 {LS_MODIFIER_MATERIAL_LINE_A, "LINE_A", 0, "Line Color Alpha", ""},
817 {LS_MODIFIER_MATERIAL_DIFF, "DIFF", 0, "Diffuse Color", ""},
818 {LS_MODIFIER_MATERIAL_DIFF_R, "DIFF_R", 0, "Diffuse Color Red", ""},
819 {LS_MODIFIER_MATERIAL_DIFF_G, "DIFF_G", 0, "Diffuse Color Green", ""},
820 {LS_MODIFIER_MATERIAL_DIFF_B, "DIFF_B", 0, "Diffuse Color Blue", ""},
821 {LS_MODIFIER_MATERIAL_SPEC, "SPEC", 0, "Specular Color", ""},
822 {LS_MODIFIER_MATERIAL_SPEC_R, "SPEC_R", 0, "Specular Color Red", ""},
823 {LS_MODIFIER_MATERIAL_SPEC_G, "SPEC_G", 0, "Specular Color Green", ""},
824 {LS_MODIFIER_MATERIAL_SPEC_B, "SPEC_B", 0, "Specular Color Blue", ""},
825 {LS_MODIFIER_MATERIAL_SPEC_HARD, "SPEC_HARD", 0, "Specular Hardness", ""},
826 {LS_MODIFIER_MATERIAL_ALPHA, "ALPHA", 0, "Alpha Transparency", ""},
827 {0, nullptr, 0, nullptr, nullptr},
828 };
829
830 prop = RNA_def_property(srna, "material_attribute", PROP_ENUM, PROP_NONE);
831 RNA_def_property_enum_sdna(prop, nullptr, "mat_attr");
832 RNA_def_property_enum_items(prop, mat_attr_items);
833 RNA_def_property_ui_text(prop, "Material Attribute", "Specify which material attribute is used");
834 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
835}
836
838{
839 StructRNA *srna;
840 PropertyRNA *prop;
841
842 static const EnumPropertyItem blueprint_shape_items[] = {
844 "CIRCLES",
845 0,
846 "Circles",
847 "Draw a blueprint using circular contour strokes"},
849 "ELLIPSES",
850 0,
851 "Ellipses",
852 "Draw a blueprint using elliptic contour strokes"},
854 "SQUARES",
855 0,
856 "Squares",
857 "Draw a blueprint using square contour strokes"},
858 {0, nullptr, 0, nullptr, nullptr},
859 };
860
861 static const EnumPropertyItem transform_pivot_items[] = {
862 {LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER, "CENTER", 0, "Stroke Center", ""},
863 {LS_MODIFIER_2D_TRANSFORM_PIVOT_START, "START", 0, "Stroke Start", ""},
864 {LS_MODIFIER_2D_TRANSFORM_PIVOT_END, "END", 0, "Stroke End", ""},
865 {LS_MODIFIER_2D_TRANSFORM_PIVOT_PARAM, "PARAM", 0, "Stroke Point Parameter", ""},
866 {LS_MODIFIER_2D_TRANSFORM_PIVOT_ABSOLUTE, "ABSOLUTE", 0, "Absolute 2D Point", ""},
867 {0, nullptr, 0, nullptr, nullptr},
868 };
869
870 srna = RNA_def_struct(brna, "LineStyleModifier", nullptr);
871 RNA_def_struct_ui_text(srna, "Line Style Modifier", "Base type to define modifiers");
872
873 /* line color modifiers */
874
875 srna = RNA_def_struct(brna, "LineStyleColorModifier", "LineStyleModifier");
876 RNA_def_struct_sdna(srna, "LineStyleModifier");
877 RNA_def_struct_refine_func(srna, "rna_LineStyle_color_modifier_refine");
878 RNA_def_struct_path_func(srna, "rna_LineStyle_color_modifier_path");
880 srna, "Line Style Color Modifier", "Base type to define line color modifiers");
881
882 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
883 RNA_def_property_string_sdna(prop, nullptr, "name");
884 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleColorModifier_name_set");
885 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
888
889 srna = RNA_def_struct(brna, "LineStyleColorModifier_AlongStroke", "LineStyleColorModifier");
890 RNA_def_struct_ui_text(srna, "Along Stroke", "Change line color along stroke");
893
894 srna = RNA_def_struct(
895 brna, "LineStyleColorModifier_DistanceFromCamera", "LineStyleColorModifier");
897 srna, "Distance from Camera", "Change line color based on the distance from the camera");
900
901 srna = RNA_def_struct(
902 brna, "LineStyleColorModifier_DistanceFromObject", "LineStyleColorModifier");
904 srna, "Distance from Object", "Change line color based on the distance from an object");
907
908 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
909 RNA_def_property_pointer_sdna(prop, nullptr, "target");
910 RNA_def_property_struct_type(prop, "Object");
912 RNA_def_property_ui_text(prop, "Target", "Target object from which the distance is measured");
913 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
914
915 srna = RNA_def_struct(brna, "LineStyleColorModifier_Material", "LineStyleColorModifier");
916 RNA_def_struct_ui_text(srna, "Material", "Change line color based on a material attribute");
920
921 prop = RNA_def_property(srna, "use_ramp", PROP_BOOLEAN, PROP_NONE);
923 RNA_def_property_ui_text(prop, "Ramp", "Use color ramp to map the BW average into an RGB color");
924 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
925
926 srna = RNA_def_struct(brna, "LineStyleColorModifier_Tangent", "LineStyleColorModifier");
927 RNA_def_struct_ui_text(srna, "Tangent", "Change line color based on the direction of a stroke");
930
931 srna = RNA_def_struct(brna, "LineStyleColorModifier_Noise", "LineStyleColorModifier");
932 RNA_def_struct_ui_text(srna, "Noise", "Change line color based on random noise");
935
936 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
937 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
938 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the noise");
939 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
940
941 prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE);
942 RNA_def_property_float_sdna(prop, nullptr, "period");
943 RNA_def_property_ui_text(prop, "Period", "Period of the noise");
944 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
945
946 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
947 RNA_def_property_int_sdna(prop, nullptr, "seed");
949 RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
950 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
951
952 srna = RNA_def_struct(brna, "LineStyleColorModifier_CreaseAngle", "LineStyleColorModifier");
954 srna, "Crease Angle", "Change line color based on the underlying crease angle");
957
958 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
959 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
960 RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle to modify thickness");
961 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
962
963 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
964 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
965 RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle to modify thickness");
966 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
967
968 srna = RNA_def_struct(brna, "LineStyleColorModifier_Curvature_3D", "LineStyleColorModifier");
970 srna, "Curvature 3D", "Change line color based on the radial curvature of 3D mesh surfaces");
973
974 prop = RNA_def_property(srna, "curvature_min", PROP_FLOAT, PROP_NONE);
975 RNA_def_property_float_sdna(prop, nullptr, "min_curvature");
976 RNA_def_property_ui_text(prop, "Min Curvature", "Minimum Curvature");
977 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
978
979 prop = RNA_def_property(srna, "curvature_max", PROP_FLOAT, PROP_NONE);
980 RNA_def_property_float_sdna(prop, nullptr, "max_curvature");
981 RNA_def_property_ui_text(prop, "Max Curvature", "Maximum Curvature");
982 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
983
984 /* alpha transparency modifiers */
985
986 srna = RNA_def_struct(brna, "LineStyleAlphaModifier", "LineStyleModifier");
987 RNA_def_struct_sdna(srna, "LineStyleModifier");
988 RNA_def_struct_refine_func(srna, "rna_LineStyle_alpha_modifier_refine");
989 RNA_def_struct_path_func(srna, "rna_LineStyle_alpha_modifier_path");
991 srna, "Line Style Alpha Modifier", "Base type to define alpha transparency modifiers");
992
993 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
994 RNA_def_property_string_sdna(prop, nullptr, "name");
995 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleAlphaModifier_name_set");
996 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
999
1000 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_AlongStroke", "LineStyleAlphaModifier");
1001 RNA_def_struct_ui_text(srna, "Along Stroke", "Change alpha transparency along stroke");
1003 rna_def_modifier_curve_common(srna, false, false);
1004
1005 srna = RNA_def_struct(
1006 brna, "LineStyleAlphaModifier_DistanceFromCamera", "LineStyleAlphaModifier");
1008 "Distance from Camera",
1009 "Change alpha transparency based on the distance from the camera");
1011 rna_def_modifier_curve_common(srna, true, false);
1012
1013 srna = RNA_def_struct(
1014 brna, "LineStyleAlphaModifier_DistanceFromObject", "LineStyleAlphaModifier");
1016 "Distance from Object",
1017 "Change alpha transparency based on the distance from an object");
1019 rna_def_modifier_curve_common(srna, true, false);
1020
1021 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1022 RNA_def_property_pointer_sdna(prop, nullptr, "target");
1023 RNA_def_property_struct_type(prop, "Object");
1025 RNA_def_property_ui_text(prop, "Target", "Target object from which the distance is measured");
1026 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1027
1028 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Material", "LineStyleAlphaModifier");
1030 srna, "Material", "Change alpha transparency based on a material attribute");
1033 rna_def_modifier_curve_common(srna, false, false);
1034
1035 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Tangent", "LineStyleAlphaModifier");
1037 srna, "Tangent", "Alpha transparency based on the direction of the stroke");
1039 rna_def_modifier_curve_common(srna, false, false);
1040
1041 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Noise", "LineStyleAlphaModifier");
1042 RNA_def_struct_ui_text(srna, "Noise", "Alpha transparency based on random noise");
1044 rna_def_modifier_curve_common(srna, false, false);
1045
1046 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1047 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1048 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the noise");
1049 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1050
1051 prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE);
1052 RNA_def_property_float_sdna(prop, nullptr, "period");
1053 RNA_def_property_ui_text(prop, "Period", "Period of the noise");
1054 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1055
1056 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
1057 RNA_def_property_int_sdna(prop, nullptr, "seed");
1059 RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
1060 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1061
1062 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_CreaseAngle", "LineStyleAlphaModifier");
1064 srna, "Crease Angle", "Alpha transparency based on the angle between two adjacent faces");
1066 rna_def_modifier_curve_common(srna, false, false);
1067
1068 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
1069 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
1070 RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle to modify thickness");
1071 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1072
1073 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
1074 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
1075 RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle to modify thickness");
1076 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1077
1078 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Curvature_3D", "LineStyleAlphaModifier");
1080 "Curvature 3D",
1081 "Alpha transparency based on the radial curvature of 3D mesh surfaces");
1083 rna_def_modifier_curve_common(srna, false, false);
1084
1085 prop = RNA_def_property(srna, "curvature_min", PROP_FLOAT, PROP_NONE);
1086 RNA_def_property_float_sdna(prop, nullptr, "min_curvature");
1087 RNA_def_property_range(prop, 0.0f, 10000.0f);
1088 RNA_def_property_ui_text(prop, "Min Curvature", "Minimum Curvature");
1089 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1090
1091 prop = RNA_def_property(srna, "curvature_max", PROP_FLOAT, PROP_NONE);
1092 RNA_def_property_float_sdna(prop, nullptr, "max_curvature");
1093 RNA_def_property_range(prop, 0.0f, 10000.0f);
1094 RNA_def_property_ui_text(prop, "Max Curvature", "Maximum Curvature");
1095 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1096
1097 /* line thickness modifiers */
1098 srna = RNA_def_struct(brna, "LineStyleThicknessModifier", "LineStyleModifier");
1099 RNA_def_struct_sdna(srna, "LineStyleModifier");
1100 RNA_def_struct_refine_func(srna, "rna_LineStyle_thickness_modifier_refine");
1101 RNA_def_struct_path_func(srna, "rna_LineStyle_thickness_modifier_path");
1103 srna, "Line Style Thickness Modifier", "Base type to define line thickness modifiers");
1104
1105 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1106 RNA_def_property_string_sdna(prop, nullptr, "name");
1107 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleThicknessModifier_name_set");
1108 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
1109 RNA_def_property_update(prop, NC_LINESTYLE, nullptr);
1110 RNA_def_struct_name_property(srna, prop);
1111
1112 srna = RNA_def_struct(brna, "LineStyleThicknessModifier_Tangent", "LineStyleThicknessModifier");
1113 RNA_def_struct_ui_text(srna, "Tangent", "Thickness based on the direction of the stroke");
1115 rna_def_modifier_curve_common(srna, false, false);
1116
1117 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1118 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1119 RNA_def_property_range(prop, 0.0f, 10000.0f);
1120 RNA_def_property_ui_text(prop, "Min Thickness", "Minimum thickness");
1121 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1122
1123 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1124 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1125 RNA_def_property_range(prop, 0.0f, 10000.0f);
1126 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness");
1127 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1128
1129 srna = RNA_def_struct(
1130 brna, "LineStyleThicknessModifier_AlongStroke", "LineStyleThicknessModifier");
1131 RNA_def_struct_ui_text(srna, "Along Stroke", "Change line thickness along stroke");
1133 rna_def_modifier_curve_common(srna, false, true);
1134
1135 srna = RNA_def_struct(
1136 brna, "LineStyleThicknessModifier_DistanceFromCamera", "LineStyleThicknessModifier");
1138 srna, "Distance from Camera", "Change line thickness based on the distance from the camera");
1140 rna_def_modifier_curve_common(srna, true, true);
1141
1142 srna = RNA_def_struct(
1143 brna, "LineStyleThicknessModifier_DistanceFromObject", "LineStyleThicknessModifier");
1145 srna, "Distance from Object", "Change line thickness based on the distance from an object");
1147 rna_def_modifier_curve_common(srna, true, true);
1148
1149 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1150 RNA_def_property_pointer_sdna(prop, nullptr, "target");
1151 RNA_def_property_struct_type(prop, "Object");
1153 RNA_def_property_ui_text(prop, "Target", "Target object from which the distance is measured");
1154 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1155
1156 srna = RNA_def_struct(brna, "LineStyleThicknessModifier_Material", "LineStyleThicknessModifier");
1157 RNA_def_struct_ui_text(srna, "Material", "Change line thickness based on a material attribute");
1160 rna_def_modifier_curve_common(srna, false, true);
1161
1162 srna = RNA_def_struct(
1163 brna, "LineStyleThicknessModifier_Calligraphy", "LineStyleThicknessModifier");
1165 srna,
1166 "Calligraphy",
1167 "Change line thickness so that stroke looks like made with a calligraphic pen");
1169
1170 prop = RNA_def_property(srna, "orientation", PROP_FLOAT, PROP_ANGLE);
1171 RNA_def_property_float_sdna(prop, nullptr, "orientation");
1172 RNA_def_property_ui_text(prop, "Orientation", "Angle of the main direction");
1173 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1174
1175 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1176 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1177 RNA_def_property_range(prop, 0.0f, 10000.0f);
1179 prop,
1180 "Min Thickness",
1181 "Minimum thickness in the direction perpendicular to the main direction");
1182 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1183
1184 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1185 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1186 RNA_def_property_range(prop, 0.0f, 10000.0f);
1187 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness in the main direction");
1188 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1189
1190 srna = RNA_def_struct(brna, "LineStyleThicknessModifier_Noise", "LineStyleThicknessModifier");
1191 RNA_def_struct_ui_text(srna, "Noise", "Line thickness based on random noise");
1193
1194 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1195 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1196 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the noise");
1197 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1198
1199 prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE);
1200 RNA_def_property_float_sdna(prop, nullptr, "period");
1201 RNA_def_property_ui_text(prop, "Period", "Period of the noise");
1202 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1203
1204 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
1205 RNA_def_property_int_sdna(prop, nullptr, "seed");
1207 RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
1208 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1209
1210 prop = RNA_def_property(srna, "use_asymmetric", PROP_BOOLEAN, PROP_NONE);
1212 RNA_def_property_ui_text(prop, "Asymmetric", "Allow thickness to be assigned asymmetrically");
1213 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1214
1215 srna = RNA_def_struct(
1216 brna, "LineStyleThicknessModifier_Curvature_3D", "LineStyleThicknessModifier");
1218 srna, "Curvature 3D", "Line thickness based on the radial curvature of 3D mesh surfaces");
1220 rna_def_modifier_curve_common(srna, false, false);
1221
1222 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1223 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1224 RNA_def_property_range(prop, 0.0f, 10000.0f);
1225 RNA_def_property_ui_text(prop, "Min Thickness", "Minimum thickness");
1226 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1227
1228 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1229 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1230 RNA_def_property_range(prop, 0.0f, 10000.0f);
1231 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness");
1232 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1233
1234 prop = RNA_def_property(srna, "curvature_min", PROP_FLOAT, PROP_NONE);
1235 RNA_def_property_float_sdna(prop, nullptr, "min_curvature");
1236 RNA_def_property_range(prop, 0.0f, 10000.0f);
1237 RNA_def_property_ui_text(prop, "Min Curvature", "Minimum Curvature");
1238 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1239
1240 prop = RNA_def_property(srna, "curvature_max", PROP_FLOAT, PROP_NONE);
1241 RNA_def_property_float_sdna(prop, nullptr, "max_curvature");
1242 RNA_def_property_range(prop, 0.0f, 10000.0f);
1243 RNA_def_property_ui_text(prop, "Max Curvature", "Maximum Curvature");
1244 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1245
1246 srna = RNA_def_struct(
1247 brna, "LineStyleThicknessModifier_CreaseAngle", "LineStyleThicknessModifier");
1249 srna, "Crease Angle", "Line thickness based on the angle between two adjacent faces");
1251 rna_def_modifier_curve_common(srna, false, false);
1252
1253 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
1254 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
1255 RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle to modify thickness");
1256 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1257
1258 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
1259 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
1260 RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle to modify thickness");
1261 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1262
1263 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1264 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1265 RNA_def_property_range(prop, 0.0f, 10000.0f);
1266 RNA_def_property_ui_text(prop, "Min Thickness", "Minimum thickness");
1267 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1268
1269 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1270 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1271 RNA_def_property_range(prop, 0.0f, 10000.0f);
1272 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness");
1273 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1274
1275 /* geometry modifiers */
1276
1277 srna = RNA_def_struct(brna, "LineStyleGeometryModifier", "LineStyleModifier");
1278 RNA_def_struct_sdna(srna, "LineStyleModifier");
1279 RNA_def_struct_refine_func(srna, "rna_LineStyle_geometry_modifier_refine");
1280 RNA_def_struct_path_func(srna, "rna_LineStyle_geometry_modifier_path");
1282 srna, "Line Style Geometry Modifier", "Base type to define stroke geometry modifiers");
1283
1284 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1285 RNA_def_property_string_sdna(prop, nullptr, "name");
1286 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleGeometryModifier_name_set");
1287 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
1288 RNA_def_property_update(prop, NC_LINESTYLE, nullptr);
1289 RNA_def_struct_name_property(srna, prop);
1290
1291 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_Sampling", "LineStyleGeometryModifier");
1293 srna,
1294 "Sampling",
1295 "Specify a new sampling value that determines the resolution of stroke polylines");
1297
1298 prop = RNA_def_property(srna, "sampling", PROP_FLOAT, PROP_NONE);
1299 RNA_def_property_float_sdna(prop, nullptr, "sampling");
1300 RNA_def_property_range(prop, 0.0f, 10000.0f);
1302 prop, "Sampling", "New sampling value to be used for subsequent modifiers");
1303 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1304
1305 srna = RNA_def_struct(
1306 brna, "LineStyleGeometryModifier_BezierCurve", "LineStyleGeometryModifier");
1308 "Bézier Curve",
1309 "Replace stroke backbone geometry by a Bézier curve approximation of the "
1310 "original backbone geometry");
1312
1313 prop = RNA_def_property(srna, "error", PROP_FLOAT, PROP_NONE);
1314 RNA_def_property_float_sdna(prop, nullptr, "error");
1316 "Error",
1317 "Maximum distance allowed between the new Bézier curve and the "
1318 "original backbone geometry");
1320 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1321
1322 srna = RNA_def_struct(
1323 brna, "LineStyleGeometryModifier_SinusDisplacement", "LineStyleGeometryModifier");
1325 srna, "Sinus Displacement", "Add sinus displacement to stroke backbone geometry");
1327
1328 prop = RNA_def_property(srna, "wavelength", PROP_FLOAT, PROP_UNSIGNED);
1329 RNA_def_property_float_sdna(prop, nullptr, "wavelength");
1330 RNA_def_property_range(prop, 0.0001f, FLT_MAX);
1331 RNA_def_property_ui_text(prop, "Wavelength", "Wavelength of the sinus displacement");
1332 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1333
1334 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1335 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1336 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the sinus displacement");
1337 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1338
1339 prop = RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE);
1340 RNA_def_property_float_sdna(prop, nullptr, "phase");
1341 RNA_def_property_ui_text(prop, "Phase", "Phase of the sinus displacement");
1342 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1343
1344 srna = RNA_def_struct(
1345 brna, "LineStyleGeometryModifier_SpatialNoise", "LineStyleGeometryModifier");
1346 RNA_def_struct_ui_text(srna, "Spatial Noise", "Add spatial noise to stroke backbone geometry");
1348
1349 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1350 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1351 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the spatial noise");
1352 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1353
1354 prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
1355 RNA_def_property_float_sdna(prop, nullptr, "scale");
1356 RNA_def_property_ui_text(prop, "Scale", "Scale of the spatial noise");
1357 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1358
1359 prop = RNA_def_property(srna, "octaves", PROP_INT, PROP_UNSIGNED);
1360 RNA_def_property_int_sdna(prop, nullptr, "octaves");
1362 prop, "Octaves", "Number of octaves (i.e., the amount of detail of the spatial noise)");
1363 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1364
1365 prop = RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE);
1367 RNA_def_property_ui_text(prop, "Smooth", "If true, the spatial noise is smooth");
1369 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1370
1371 prop = RNA_def_property(srna, "use_pure_random", PROP_BOOLEAN, PROP_NONE);
1374 prop, "Pure Random", "If true, the spatial noise does not show any coherence");
1375 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1376
1377 srna = RNA_def_struct(
1378 brna, "LineStyleGeometryModifier_PerlinNoise1D", "LineStyleGeometryModifier");
1380 srna, "Perlin Noise 1D", "Add one-dimensional Perlin noise to stroke backbone geometry");
1382
1383 prop = RNA_def_property(srna, "frequency", PROP_FLOAT, PROP_NONE);
1384 RNA_def_property_float_sdna(prop, nullptr, "frequency");
1385 RNA_def_property_ui_text(prop, "Frequency", "Frequency of the Perlin noise");
1386 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1387
1388 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1389 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1390 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the Perlin noise");
1391 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1392
1393 prop = RNA_def_property(srna, "octaves", PROP_INT, PROP_UNSIGNED);
1394 RNA_def_property_int_sdna(prop, nullptr, "octaves");
1396 prop, "Octaves", "Number of octaves (i.e., the amount of detail of the Perlin noise)");
1397 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1398
1399 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1400 RNA_def_property_float_sdna(prop, nullptr, "angle");
1401 RNA_def_property_ui_text(prop, "Angle", "Displacement direction");
1402 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1403
1404 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
1405 RNA_def_property_int_sdna(prop, nullptr, "seed");
1407 prop,
1408 "Seed",
1409 "Seed for random number generation (if negative, time is used as a seed instead)");
1410 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1411
1412 srna = RNA_def_struct(
1413 brna, "LineStyleGeometryModifier_PerlinNoise2D", "LineStyleGeometryModifier");
1415 srna, "Perlin Noise 2D", "Add two-dimensional Perlin noise to stroke backbone geometry");
1417
1418 prop = RNA_def_property(srna, "frequency", PROP_FLOAT, PROP_NONE);
1419 RNA_def_property_float_sdna(prop, nullptr, "frequency");
1420 RNA_def_property_ui_text(prop, "Frequency", "Frequency of the Perlin noise");
1421 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1422
1423 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1424 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1425 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the Perlin noise");
1426 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1427
1428 prop = RNA_def_property(srna, "octaves", PROP_INT, PROP_UNSIGNED);
1429 RNA_def_property_int_sdna(prop, nullptr, "octaves");
1431 prop, "Octaves", "Number of octaves (i.e., the amount of detail of the Perlin noise)");
1432 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1433
1434 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1435 RNA_def_property_float_sdna(prop, nullptr, "angle");
1436 RNA_def_property_ui_text(prop, "Angle", "Displacement direction");
1437 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1438
1439 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
1440 RNA_def_property_int_sdna(prop, nullptr, "seed");
1442 prop,
1443 "Seed",
1444 "Seed for random number generation (if negative, time is used as a seed instead)");
1445 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1446
1447 srna = RNA_def_struct(
1448 brna, "LineStyleGeometryModifier_BackboneStretcher", "LineStyleGeometryModifier");
1450 srna, "Backbone Stretcher", "Stretch the beginning and the end of stroke backbone");
1452
1453 prop = RNA_def_property(srna, "backbone_length", PROP_FLOAT, PROP_NONE);
1454 RNA_def_property_float_sdna(prop, nullptr, "backbone_length");
1455 RNA_def_property_ui_text(prop, "Backbone Length", "Amount of backbone stretching");
1456 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1457
1458 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_TipRemover", "LineStyleGeometryModifier");
1460 srna,
1461 "Tip Remover",
1462 "Remove a piece of stroke at the beginning and the end of stroke backbone");
1464
1465 prop = RNA_def_property(srna, "tip_length", PROP_FLOAT, PROP_NONE);
1466 RNA_def_property_float_sdna(prop, nullptr, "tip_length");
1467 RNA_def_property_ui_text(prop, "Tip Length", "Length of tips to be removed");
1468 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1469
1470 srna = RNA_def_struct(
1471 brna, "LineStyleGeometryModifier_Polygonalization", "LineStyleGeometryModifier");
1473 srna, "Polygonalization", "Modify the stroke geometry so that it looks more 'polygonal'");
1475
1476 prop = RNA_def_property(srna, "error", PROP_FLOAT, PROP_NONE);
1477 RNA_def_property_float_sdna(prop, nullptr, "error");
1479 prop,
1480 "Error",
1481 "Maximum distance between the original stroke and its polygonal approximation");
1483 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1484
1485 srna = RNA_def_struct(
1486 brna, "LineStyleGeometryModifier_GuidingLines", "LineStyleGeometryModifier");
1488 srna,
1489 "Guiding Lines",
1490 "Modify the stroke geometry so that it corresponds to its main direction line");
1492
1493 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
1494 RNA_def_property_float_sdna(prop, nullptr, "offset");
1496 prop, "Offset", "Displacement that is applied to the main direction line along its normal");
1497 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1498
1499 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_Blueprint", "LineStyleGeometryModifier");
1501 srna,
1502 "Blueprint",
1503 "Produce a blueprint using circular, elliptic, and square contour strokes");
1505
1506 prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
1507 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
1508 RNA_def_property_enum_items(prop, blueprint_shape_items);
1509 RNA_def_property_ui_text(prop, "Shape", "Select the shape of blueprint contour strokes");
1510 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1511
1512 prop = RNA_def_property(srna, "rounds", PROP_INT, PROP_UNSIGNED);
1513 RNA_def_property_int_sdna(prop, nullptr, "rounds");
1514 RNA_def_property_range(prop, 1, 1000);
1515 RNA_def_property_ui_text(prop, "Rounds", "Number of rounds in contour strokes");
1516 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1517
1518 prop = RNA_def_property(srna, "backbone_length", PROP_FLOAT, PROP_NONE);
1519 RNA_def_property_float_sdna(prop, nullptr, "backbone_length");
1520 RNA_def_property_ui_text(prop, "Backbone Length", "Amount of backbone stretching");
1521 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1522
1523 prop = RNA_def_property(srna, "random_radius", PROP_INT, PROP_UNSIGNED);
1524 RNA_def_property_int_sdna(prop, nullptr, "random_radius");
1525 RNA_def_property_ui_text(prop, "Random Radius", "Randomness of the radius");
1526 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1527
1528 prop = RNA_def_property(srna, "random_center", PROP_INT, PROP_UNSIGNED);
1529 RNA_def_property_int_sdna(prop, nullptr, "random_center");
1530 RNA_def_property_ui_text(prop, "Random Center", "Randomness of the center");
1531 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1532
1533 prop = RNA_def_property(srna, "random_backbone", PROP_INT, PROP_UNSIGNED);
1534 RNA_def_property_int_sdna(prop, nullptr, "random_backbone");
1535 RNA_def_property_ui_text(prop, "Random Backbone", "Randomness of the backbone stretching");
1536 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1537
1538 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_2DOffset", "LineStyleGeometryModifier");
1540 srna, "2D Offset", "Add two-dimensional offsets to stroke backbone geometry");
1542
1543 prop = RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE);
1544 RNA_def_property_float_sdna(prop, nullptr, "start");
1546 prop, "Start", "Displacement that is applied from the beginning of the stroke");
1547 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1548
1549 prop = RNA_def_property(srna, "end", PROP_FLOAT, PROP_NONE);
1550 RNA_def_property_float_sdna(prop, nullptr, "end");
1551 RNA_def_property_ui_text(prop, "End", "Displacement that is applied from the end of the stroke");
1552 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1553
1554 prop = RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE);
1555 RNA_def_property_float_sdna(prop, nullptr, "x");
1557 prop, "X", "Displacement that is applied to the X coordinates of stroke vertices");
1558 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1559
1560 prop = RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE);
1561 RNA_def_property_float_sdna(prop, nullptr, "y");
1563 prop, "Y", "Displacement that is applied to the Y coordinates of stroke vertices");
1564 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1565
1566 srna = RNA_def_struct(
1567 brna, "LineStyleGeometryModifier_2DTransform", "LineStyleGeometryModifier");
1569 "2D Transform",
1570 "Apply two-dimensional scaling and rotation to stroke backbone geometry");
1572
1573 prop = RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE);
1574 RNA_def_property_enum_sdna(prop, nullptr, "pivot");
1575 RNA_def_property_enum_items(prop, transform_pivot_items);
1576 RNA_def_property_ui_text(prop, "Pivot", "Pivot of scaling and rotation operations");
1577 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1578
1579 prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE);
1580 RNA_def_property_float_sdna(prop, nullptr, "scale_x");
1582 RNA_def_property_ui_text(prop, "Scale X", "Scaling factor that is applied along the X axis");
1583 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1584
1585 prop = RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_NONE);
1586 RNA_def_property_float_sdna(prop, nullptr, "scale_y");
1588 RNA_def_property_ui_text(prop, "Scale Y", "Scaling factor that is applied along the Y axis");
1589 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1590
1591 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1592 RNA_def_property_float_sdna(prop, nullptr, "angle");
1593 RNA_def_property_ui_text(prop, "Rotation Angle", "Rotation angle");
1594 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1595
1596 prop = RNA_def_property(srna, "pivot_u", PROP_FLOAT, PROP_FACTOR);
1597 RNA_def_property_float_sdna(prop, nullptr, "pivot_u");
1598 RNA_def_property_range(prop, 0.0f, 1.0f);
1600 "Stroke Point Parameter",
1601 "Pivot in terms of the stroke point parameter u (0 <= u <= 1)");
1602 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1603
1604 prop = RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_NONE);
1605 RNA_def_property_float_sdna(prop, nullptr, "pivot_x");
1606 RNA_def_property_ui_text(prop, "Pivot X", "2D X coordinate of the absolute pivot");
1607 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1608
1609 prop = RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_NONE);
1610 RNA_def_property_float_sdna(prop, nullptr, "pivot_y");
1611 RNA_def_property_ui_text(prop, "Pivot Y", "2D Y coordinate of the absolute pivot");
1612 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1613
1614 srna = RNA_def_struct(
1615 brna, "LineStyleGeometryModifier_Simplification", "LineStyleGeometryModifier");
1616 RNA_def_struct_ui_text(srna, "Simplification", "Simplify the stroke set");
1618
1619 prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE);
1620 RNA_def_property_float_sdna(prop, nullptr, "tolerance");
1621 RNA_def_property_ui_text(prop, "Tolerance", "Distance below which segments will be merged");
1622 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1623}
1624
1626{
1627 StructRNA *srna;
1628 FunctionRNA *func;
1629 PropertyRNA *parm;
1630
1631 RNA_def_property_srna(cprop, "LineStyleColorModifiers");
1632 srna = RNA_def_struct(brna, "LineStyleColorModifiers", nullptr);
1633 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1634 RNA_def_struct_ui_text(srna, "Color Modifiers", "Color modifiers for changing line colors");
1635
1636 func = RNA_def_function(srna, "new", "rna_LineStyle_color_modifier_add");
1637 RNA_def_function_ui_description(func, "Add a color modifier to line style");
1639 parm = RNA_def_string(
1640 func, "name", "ColorModifier", 0, "", "New name for the color modifier (not unique)");
1642 parm = RNA_def_enum(func,
1643 "type",
1645 0,
1646 "",
1647 "Color modifier type to add");
1649 parm = RNA_def_pointer(
1650 func, "modifier", "LineStyleColorModifier", "", "Newly added color modifier");
1652 RNA_def_function_return(func, parm);
1653
1654 func = RNA_def_function(srna, "remove", "rna_LineStyle_color_modifier_remove");
1655 RNA_def_function_ui_description(func, "Remove a color modifier from line style");
1657 parm = RNA_def_pointer(
1658 func, "modifier", "LineStyleColorModifier", "", "Color modifier to remove");
1661}
1662
1664{
1665 StructRNA *srna;
1666 FunctionRNA *func;
1667 PropertyRNA *parm;
1668
1669 RNA_def_property_srna(cprop, "LineStyleAlphaModifiers");
1670 srna = RNA_def_struct(brna, "LineStyleAlphaModifiers", nullptr);
1671 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1672 RNA_def_struct_ui_text(srna, "Alpha Modifiers", "Alpha modifiers for changing line alphas");
1673
1674 func = RNA_def_function(srna, "new", "rna_LineStyle_alpha_modifier_add");
1675 RNA_def_function_ui_description(func, "Add a alpha modifier to line style");
1677 parm = RNA_def_string(
1678 func, "name", "AlphaModifier", 0, "", "New name for the alpha modifier (not unique)");
1680 parm = RNA_def_enum(func,
1681 "type",
1683 0,
1684 "",
1685 "Alpha modifier type to add");
1687 parm = RNA_def_pointer(
1688 func, "modifier", "LineStyleAlphaModifier", "", "Newly added alpha modifier");
1690 RNA_def_function_return(func, parm);
1691
1692 func = RNA_def_function(srna, "remove", "rna_LineStyle_alpha_modifier_remove");
1693 RNA_def_function_ui_description(func, "Remove a alpha modifier from line style");
1695 parm = RNA_def_pointer(
1696 func, "modifier", "LineStyleAlphaModifier", "", "Alpha modifier to remove");
1699}
1700
1702{
1703 StructRNA *srna;
1704 FunctionRNA *func;
1705 PropertyRNA *parm;
1706
1707 RNA_def_property_srna(cprop, "LineStyleThicknessModifiers");
1708 srna = RNA_def_struct(brna, "LineStyleThicknessModifiers", nullptr);
1709 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1711 srna, "Thickness Modifiers", "Thickness modifiers for changing line thickness");
1712
1713 func = RNA_def_function(srna, "new", "rna_LineStyle_thickness_modifier_add");
1714 RNA_def_function_ui_description(func, "Add a thickness modifier to line style");
1716 parm = RNA_def_string(func,
1717 "name",
1718 "ThicknessModifier",
1719 0,
1720 "",
1721 "New name for the thickness modifier (not unique)");
1723 parm = RNA_def_enum(func,
1724 "type",
1726 0,
1727 "",
1728 "Thickness modifier type to add");
1730 parm = RNA_def_pointer(
1731 func, "modifier", "LineStyleThicknessModifier", "", "Newly added thickness modifier");
1733 RNA_def_function_return(func, parm);
1734
1735 func = RNA_def_function(srna, "remove", "rna_LineStyle_thickness_modifier_remove");
1736 RNA_def_function_ui_description(func, "Remove a thickness modifier from line style");
1738 parm = RNA_def_pointer(
1739 func, "modifier", "LineStyleThicknessModifier", "", "Thickness modifier to remove");
1742}
1743
1745{
1746 StructRNA *srna;
1747 FunctionRNA *func;
1748 PropertyRNA *parm;
1749
1750 RNA_def_property_srna(cprop, "LineStyleGeometryModifiers");
1751 srna = RNA_def_struct(brna, "LineStyleGeometryModifiers", nullptr);
1752 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1754 srna, "Geometry Modifiers", "Geometry modifiers for changing line geometries");
1755
1756 func = RNA_def_function(srna, "new", "rna_LineStyle_geometry_modifier_add");
1757 RNA_def_function_ui_description(func, "Add a geometry modifier to line style");
1759 parm = RNA_def_string(
1760 func, "name", "GeometryModifier", 0, "", "New name for the geometry modifier (not unique)");
1762 parm = RNA_def_enum(func,
1763 "type",
1765 0,
1766 "",
1767 "Geometry modifier type to add");
1769 parm = RNA_def_pointer(
1770 func, "modifier", "LineStyleGeometryModifier", "", "Newly added geometry modifier");
1772 RNA_def_function_return(func, parm);
1773
1774 func = RNA_def_function(srna, "remove", "rna_LineStyle_geometry_modifier_remove");
1775 RNA_def_function_ui_description(func, "Remove a geometry modifier from line style");
1777 parm = RNA_def_pointer(
1778 func, "modifier", "LineStyleGeometryModifier", "", "Geometry modifier to remove");
1781}
1782
1784{
1785 StructRNA *srna;
1786 PropertyRNA *prop;
1787
1788 static const EnumPropertyItem panel_items[] = {
1789 {LS_PANEL_STROKES, "STROKES", 0, "Strokes", "Show the panel for stroke construction"},
1790 {LS_PANEL_COLOR, "COLOR", 0, "Color", "Show the panel for line color options"},
1791 {LS_PANEL_ALPHA, "ALPHA", 0, "Alpha", "Show the panel for alpha transparency options"},
1793 "THICKNESS",
1794 0,
1795 "Thickness",
1796 "Show the panel for line thickness options"},
1797 {LS_PANEL_GEOMETRY, "GEOMETRY", 0, "Geometry", "Show the panel for stroke geometry options"},
1798 {LS_PANEL_TEXTURE, "TEXTURE", 0, "Texture", "Show the panel for stroke texture options"},
1799# if 0 /* hidden for now */
1800 {LS_PANEL_MISC, "MISC", 0, "Misc", "Show the panel for miscellaneous options"},
1801# endif
1802 {0, nullptr, 0, nullptr, nullptr},
1803 };
1804 static const EnumPropertyItem chaining_items[] = {
1805 {LS_CHAINING_PLAIN, "PLAIN", 0, "Plain", "Plain chaining"},
1806 {LS_CHAINING_SKETCHY, "SKETCHY", 0, "Sketchy", "Sketchy chaining with a multiple touch"},
1807 {0, nullptr, 0, nullptr, nullptr},
1808 };
1809 static const EnumPropertyItem cap_items[] = {
1810 {LS_CAPS_BUTT, "BUTT", 0, "Butt", "Butt cap (flat)"},
1811 {LS_CAPS_ROUND, "ROUND", 0, "Round", "Round cap (half-circle)"},
1812 {LS_CAPS_SQUARE, "SQUARE", 0, "Square", "Square cap (flat and extended)"},
1813 {0, nullptr, 0, nullptr, nullptr},
1814 };
1815 static const EnumPropertyItem thickness_position_items[] = {
1817 "CENTER",
1818 0,
1819 "Center",
1820 "Silhouettes and border edges are centered along stroke geometry"},
1822 "INSIDE",
1823 0,
1824 "Inside",
1825 "Silhouettes and border edges are drawn inside of stroke geometry"},
1827 "OUTSIDE",
1828 0,
1829 "Outside",
1830 "Silhouettes and border edges are drawn outside of stroke geometry"},
1832 "RELATIVE",
1833 0,
1834 "Relative",
1835 "Silhouettes and border edges are shifted by a user-defined ratio"},
1836 {0, nullptr, 0, nullptr, nullptr},
1837 };
1838 static const EnumPropertyItem sort_key_items[] = {
1840 "DISTANCE_FROM_CAMERA",
1841 0,
1842 "Distance from Camera",
1843 "Sort by distance from camera (closer lines lie on top of further lines)"},
1845 "2D_LENGTH",
1846 0,
1847 "2D Length",
1848 "Sort by curvilinear 2D length (longer lines lie on top of shorter lines)"},
1850 "PROJECTED_X",
1851 0,
1852 "Projected X",
1853 "Sort by the projected X value in the image coordinate system"},
1855 "PROJECTED_Y",
1856 0,
1857 "Projected Y",
1858 "Sort by the projected Y value in the image coordinate system"},
1859 {0, nullptr, 0, nullptr, nullptr},
1860 };
1861 static const EnumPropertyItem sort_order_items[] = {
1862 {0, "DEFAULT", 0, "Default", "Default order of the sort key"},
1863 {LS_REVERSE_ORDER, "REVERSE", 0, "Reverse", "Reverse order"},
1864 {0, nullptr, 0, nullptr, nullptr},
1865 };
1866 static const EnumPropertyItem integration_type_items[] = {
1868 "MEAN",
1869 0,
1870 "Mean",
1871 "The value computed for the chain is the mean of the values obtained for chain vertices"},
1873 "MIN",
1874 0,
1875 "Min",
1876 "The value computed for the chain is the minimum of the values obtained for chain "
1877 "vertices"},
1879 "MAX",
1880 0,
1881 "Max",
1882 "The value computed for the chain is the maximum of the values obtained for chain "
1883 "vertices"},
1885 "FIRST",
1886 0,
1887 "First",
1888 "The value computed for the chain is the value obtained for the first chain vertex"},
1890 "LAST",
1891 0,
1892 "Last",
1893 "The value computed for the chain is the value obtained for the last chain vertex"},
1894 {0, nullptr, 0, nullptr, nullptr},
1895 };
1896
1897 srna = RNA_def_struct(brna, "FreestyleLineStyle", "ID");
1899 srna, "Freestyle Line Style", "Freestyle line style, reusable by multiple line sets");
1900 RNA_def_struct_ui_icon(srna, ICON_LINE_DATA);
1901
1903 srna,
1904 "rna_LineStyle_mtex_begin",
1905 "rna_LineStyle_active_texture_get",
1906 "rna_LineStyle_active_texture_set",
1907 nullptr,
1908 "LineStyleTextureSlot",
1909 "LineStyleTextureSlots",
1910 "rna_LineStyle_update",
1911 "rna_LineStyle_update");
1912
1913 prop = RNA_def_property(srna, "panel", PROP_ENUM, PROP_NONE);
1914 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "panel");
1915 RNA_def_property_enum_items(prop, panel_items);
1917 RNA_def_property_ui_text(prop, "Panel", "Select the property panel to be shown");
1918
1919 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
1920 RNA_def_property_float_sdna(prop, nullptr, "r");
1921 RNA_def_property_array(prop, 3);
1923 prop, "Color", "Base line color, possibly modified by line color modifiers");
1924 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1925
1926 prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR);
1927 RNA_def_property_float_sdna(prop, nullptr, "alpha");
1928 RNA_def_property_range(prop, 0.0f, 1.0f);
1930 prop,
1931 "Alpha Transparency",
1932 "Base alpha transparency, possibly modified by alpha transparency modifiers");
1933 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1934
1935 prop = RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_NONE);
1936 RNA_def_property_float_sdna(prop, nullptr, "thickness");
1937 RNA_def_property_range(prop, 0.0f, 10000.0f);
1939 prop, "Thickness", "Base line thickness, possibly modified by line thickness modifiers");
1940 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1941
1942 prop = RNA_def_property(srna, "thickness_position", PROP_ENUM, PROP_NONE);
1943 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "thickness_position");
1944 RNA_def_property_enum_items(prop, thickness_position_items);
1946 "Thickness Position",
1947 "Thickness position of silhouettes and border edges (applicable when "
1948 "plain chaining is used with the Same Object option)");
1949 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1950
1951 prop = RNA_def_property(srna, "thickness_ratio", PROP_FLOAT, PROP_FACTOR);
1952 RNA_def_property_float_sdna(prop, nullptr, "thickness_ratio");
1953 RNA_def_property_range(prop, 0.0f, 1.0f);
1955 prop,
1956 "Thickness Ratio",
1957 "A number between 0 (inside) and 1 (outside) specifying the relative position of "
1958 "stroke thickness");
1959 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1960
1961 prop = RNA_def_property(srna, "color_modifiers", PROP_COLLECTION, PROP_NONE);
1962 RNA_def_property_collection_sdna(prop, nullptr, "color_modifiers", nullptr);
1963 RNA_def_property_struct_type(prop, "LineStyleColorModifier");
1964 RNA_def_property_ui_text(prop, "Color Modifiers", "List of line color modifiers");
1966
1967 prop = RNA_def_property(srna, "alpha_modifiers", PROP_COLLECTION, PROP_NONE);
1968 RNA_def_property_collection_sdna(prop, nullptr, "alpha_modifiers", nullptr);
1969 RNA_def_property_struct_type(prop, "LineStyleAlphaModifier");
1970 RNA_def_property_ui_text(prop, "Alpha Modifiers", "List of alpha transparency modifiers");
1972
1973 prop = RNA_def_property(srna, "thickness_modifiers", PROP_COLLECTION, PROP_NONE);
1974 RNA_def_property_collection_sdna(prop, nullptr, "thickness_modifiers", nullptr);
1975 RNA_def_property_struct_type(prop, "LineStyleThicknessModifier");
1976 RNA_def_property_ui_text(prop, "Thickness Modifiers", "List of line thickness modifiers");
1978
1979 prop = RNA_def_property(srna, "geometry_modifiers", PROP_COLLECTION, PROP_NONE);
1980 RNA_def_property_collection_sdna(prop, nullptr, "geometry_modifiers", nullptr);
1981 RNA_def_property_struct_type(prop, "LineStyleGeometryModifier");
1982 RNA_def_property_ui_text(prop, "Geometry Modifiers", "List of stroke geometry modifiers");
1984
1985 prop = RNA_def_property(srna, "use_chaining", PROP_BOOLEAN, PROP_NONE);
1987 RNA_def_property_ui_text(prop, "Chaining", "Enable chaining of feature edges");
1988 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1989
1990 prop = RNA_def_property(srna, "chaining", PROP_ENUM, PROP_NONE);
1991 RNA_def_property_enum_sdna(prop, nullptr, "chaining");
1992 RNA_def_property_enum_items(prop, chaining_items);
1994 prop, "Chaining Method", "Select the way how feature edges are jointed to form chains");
1995 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1996
1997 prop = RNA_def_property(srna, "rounds", PROP_INT, PROP_UNSIGNED);
1998 RNA_def_property_int_sdna(prop, nullptr, "rounds");
1999 RNA_def_property_range(prop, 1, 1000);
2000 RNA_def_property_ui_text(prop, "Rounds", "Number of rounds in a sketchy multiple touch");
2001 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2002
2003 prop = RNA_def_property(srna, "use_same_object", PROP_BOOLEAN, PROP_NONE);
2004 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_SAME_OBJECT);
2006 prop, "Same Object", "If true, only feature edges of the same object are joined");
2007 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2008
2009 prop = RNA_def_property(srna, "use_split_length", PROP_BOOLEAN, PROP_NONE);
2010 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_SPLIT_LENGTH);
2012 prop, "Use Split Length", "Enable chain splitting by curvilinear 2D length");
2013 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2014
2015 prop = RNA_def_property(srna, "split_length", PROP_FLOAT, PROP_NONE);
2016 RNA_def_property_float_sdna(prop, nullptr, "split_length");
2017 RNA_def_property_range(prop, 0.0f, 10000.0f);
2018 RNA_def_property_ui_text(prop, "Split Length", "Curvilinear 2D length for chain splitting");
2019 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2020
2021 prop = RNA_def_property(srna, "use_angle_min", PROP_BOOLEAN, PROP_NONE);
2022 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MIN_2D_ANGLE);
2024 "Use Min 2D Angle",
2025 "Split chains at points with angles smaller than the minimum 2D angle");
2026 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2027
2028 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
2029 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
2030 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
2031 RNA_def_property_ui_text(prop, "Min 2D Angle", "Minimum 2D angle for splitting chains");
2032 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2033
2034 prop = RNA_def_property(srna, "use_angle_max", PROP_BOOLEAN, PROP_NONE);
2035 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MAX_2D_ANGLE);
2037 "Use Max 2D Angle",
2038 "Split chains at points with angles larger than the maximum 2D angle");
2039 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2040
2041 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
2042 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
2043 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
2044 RNA_def_property_ui_text(prop, "Max 2D Angle", "Maximum 2D angle for splitting chains");
2045 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2046
2047 prop = RNA_def_property(srna, "use_length_min", PROP_BOOLEAN, PROP_NONE);
2048 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MIN_2D_LENGTH);
2050 prop, "Use Min 2D Length", "Enable the selection of chains by a minimum 2D length");
2051 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2052
2053 prop = RNA_def_property(srna, "length_min", PROP_FLOAT, PROP_NONE);
2054 RNA_def_property_float_sdna(prop, nullptr, "min_length");
2055 RNA_def_property_range(prop, 0.0f, 10000.0f);
2057 prop, "Min 2D Length", "Minimum curvilinear 2D length for the selection of chains");
2058 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2059
2060 prop = RNA_def_property(srna, "use_length_max", PROP_BOOLEAN, PROP_NONE);
2061 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MAX_2D_LENGTH);
2063 prop, "Use Max 2D Length", "Enable the selection of chains by a maximum 2D length");
2064 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2065
2066 prop = RNA_def_property(srna, "length_max", PROP_FLOAT, PROP_NONE);
2067 RNA_def_property_float_sdna(prop, nullptr, "max_length");
2068 RNA_def_property_range(prop, 0.0f, 10000.0f);
2070 prop, "Max 2D Length", "Maximum curvilinear 2D length for the selection of chains");
2071 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2072
2073 prop = RNA_def_property(srna, "use_chain_count", PROP_BOOLEAN, PROP_NONE);
2074 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_CHAIN_COUNT);
2075 RNA_def_property_ui_text(prop, "Use Chain Count", "Enable the selection of first N chains");
2076 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2077
2078 prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_UNSIGNED);
2079 RNA_def_property_int_sdna(prop, nullptr, "chain_count");
2080 RNA_def_property_ui_text(prop, "Chain Count", "Chain count for the selection of first N chains");
2081 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2082
2083 prop = RNA_def_property(srna, "use_split_pattern", PROP_BOOLEAN, PROP_NONE);
2084 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_SPLIT_PATTERN);
2086 prop, "Use Split Pattern", "Enable chain splitting by dashed line patterns");
2087 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2088
2089 prop = RNA_def_property(srna, "split_dash1", PROP_INT, PROP_UNSIGNED);
2090 RNA_def_property_int_sdna(prop, nullptr, "split_dash1");
2092 RNA_def_property_ui_text(prop, "Split Dash 1", "Length of the 1st dash for splitting");
2093 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2094
2095 prop = RNA_def_property(srna, "split_gap1", PROP_INT, PROP_UNSIGNED);
2096 RNA_def_property_int_sdna(prop, nullptr, "split_gap1");
2098 RNA_def_property_ui_text(prop, "Split Gap 1", "Length of the 1st gap for splitting");
2099 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2100
2101 prop = RNA_def_property(srna, "split_dash2", PROP_INT, PROP_UNSIGNED);
2102 RNA_def_property_int_sdna(prop, nullptr, "split_dash2");
2104 RNA_def_property_ui_text(prop, "Split Dash 2", "Length of the 2nd dash for splitting");
2105 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2106
2107 prop = RNA_def_property(srna, "split_gap2", PROP_INT, PROP_UNSIGNED);
2108 RNA_def_property_int_sdna(prop, nullptr, "split_gap2");
2110 RNA_def_property_ui_text(prop, "Split Gap 2", "Length of the 2nd gap for splitting");
2111 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2112
2113 prop = RNA_def_property(srna, "split_dash3", PROP_INT, PROP_UNSIGNED);
2114 RNA_def_property_int_sdna(prop, nullptr, "split_dash3");
2116 RNA_def_property_ui_text(prop, "Split Dash 3", "Length of the 3rd dash for splitting");
2117 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2118
2119 prop = RNA_def_property(srna, "split_gap3", PROP_INT, PROP_UNSIGNED);
2120 RNA_def_property_int_sdna(prop, nullptr, "split_gap3");
2122 RNA_def_property_ui_text(prop, "Split Gap 3", "Length of the 3rd gap for splitting");
2123 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2124
2125 prop = RNA_def_property(srna, "material_boundary", PROP_BOOLEAN, PROP_NONE);
2128 "Material Boundary",
2129 "If true, chains of feature edges are split at material boundaries");
2130 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2131
2132 prop = RNA_def_property(srna, "use_sorting", PROP_BOOLEAN, PROP_NONE);
2134 RNA_def_property_ui_text(prop, "Sorting", "Arrange the stacking order of strokes");
2135 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2136
2137 prop = RNA_def_property(srna, "sort_key", PROP_ENUM, PROP_NONE);
2138 RNA_def_property_enum_sdna(prop, nullptr, "sort_key");
2139 RNA_def_property_enum_items(prop, sort_key_items);
2141 prop, "Sort Key", "Select the sort key to determine the stacking order of chains");
2142 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2143
2144 prop = RNA_def_property(srna, "sort_order", PROP_ENUM, PROP_NONE);
2145 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2146 RNA_def_property_enum_items(prop, sort_order_items);
2147 RNA_def_property_ui_text(prop, "Sort Order", "Select the sort order");
2148 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2149
2150 prop = RNA_def_property(srna, "integration_type", PROP_ENUM, PROP_NONE);
2151 RNA_def_property_enum_sdna(prop, nullptr, "integration_type");
2152 RNA_def_property_enum_items(prop, integration_type_items);
2154 prop, "Integration Type", "Select the way how the sort key is computed for each chain");
2155 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2156
2157 prop = RNA_def_property(srna, "use_dashed_line", PROP_BOOLEAN, PROP_NONE);
2158 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_DASHED_LINE);
2159 RNA_def_property_ui_text(prop, "Dashed Line", "Enable or disable dashed line");
2160 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2161
2162 prop = RNA_def_property(srna, "caps", PROP_ENUM, PROP_NONE);
2163 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "caps");
2164 RNA_def_property_enum_items(prop, cap_items);
2165 RNA_def_property_ui_text(prop, "Caps", "Select the shape of both ends of strokes");
2166 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2167
2168 prop = RNA_def_property(srna, "dash1", PROP_INT, PROP_UNSIGNED);
2169 RNA_def_property_int_sdna(prop, nullptr, "dash1");
2171 RNA_def_property_ui_text(prop, "Dash 1", "Length of the 1st dash for dashed lines");
2172 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2173
2174 prop = RNA_def_property(srna, "gap1", PROP_INT, PROP_UNSIGNED);
2175 RNA_def_property_int_sdna(prop, nullptr, "gap1");
2177 RNA_def_property_ui_text(prop, "Gap 1", "Length of the 1st gap for dashed lines");
2178 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2179
2180 prop = RNA_def_property(srna, "dash2", PROP_INT, PROP_UNSIGNED);
2181 RNA_def_property_int_sdna(prop, nullptr, "dash2");
2183 RNA_def_property_ui_text(prop, "Dash 2", "Length of the 2nd dash for dashed lines");
2184 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2185
2186 prop = RNA_def_property(srna, "gap2", PROP_INT, PROP_UNSIGNED);
2187 RNA_def_property_int_sdna(prop, nullptr, "gap2");
2189 RNA_def_property_ui_text(prop, "Gap 2", "Length of the 2nd gap for dashed lines");
2190 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2191
2192 prop = RNA_def_property(srna, "dash3", PROP_INT, PROP_UNSIGNED);
2193 RNA_def_property_int_sdna(prop, nullptr, "dash3");
2195 RNA_def_property_ui_text(prop, "Dash 3", "Length of the 3rd dash for dashed lines");
2196 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2197
2198 prop = RNA_def_property(srna, "gap3", PROP_INT, PROP_UNSIGNED);
2199 RNA_def_property_int_sdna(prop, nullptr, "gap3");
2201 RNA_def_property_ui_text(prop, "Gap 3", "Length of the 3rd gap for dashed lines");
2202 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2203
2204 prop = RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE);
2205 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_TEXTURE);
2206 RNA_def_property_ui_text(prop, "Use Textures", "Enable or disable textured strokes");
2207 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2208
2209 prop = RNA_def_property(srna, "texture_spacing", PROP_FLOAT, PROP_FACTOR);
2210 RNA_def_property_float_sdna(prop, nullptr, "texstep");
2211 RNA_def_property_range(prop, 0.01f, 100.0f);
2212 RNA_def_property_ui_text(prop, "Texture Spacing", "Spacing for textures along stroke length");
2213 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2214
2215 /* anim */
2217
2218 /* nodes */
2219 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
2220 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
2223 RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based shaders");
2224
2225 prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
2226 RNA_def_property_boolean_sdna(prop, nullptr, "use_nodes", 1);
2229 RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes for the line style");
2230 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_use_nodes_update");
2231}
2232
2239
2240} // namespace blender
2241
2242#endif
Blender kernel freestyle line style functionality.
#define DEG2RADF(_deg)
#define STRNCPY_UTF8(dst, src)
#define BLT_I18NCONTEXT_ID_FREESTYLELINESTYLE
#define BLT_I18NCONTEXT_AMOUNT
#define BLT_I18NCONTEXT_ID_IMAGE
#define BLT_I18NCONTEXT_ID_TEXTURE
#define TEXCO_STROKE
#define C
Definition RandGen.cpp:29
#define MAX_MTEX
Definition Stroke.h:31
#define NC_LINESTYLE
Definition WM_types.hh:413
#define offsetof(t, d)
#define SHRT_MAX
#define USHRT_MAX
#define FLT_MAX
BMesh Iterators.
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
LineStyleModifier * BKE_linestyle_geometry_modifier_add(FreestyleLineStyle *linestyle, const char *name, eLineStyleModifier_Type type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_linestyle(BlenderRNA *brna)
static void rna_def_alpha_modifier(StructRNA *srna)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
@ LS_SORT_KEY_DISTANCE_FROM_CAMERA
@ LS_MODIFIER_2D_TRANSFORM_PIVOT_PARAM
@ LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER
@ LS_MODIFIER_2D_TRANSFORM_PIVOT_ABSOLUTE
@ LS_MODIFIER_2D_TRANSFORM_PIVOT_START
@ LS_MODIFIER_2D_TRANSFORM_PIVOT_END
static void rna_def_thickness_modifier(StructRNA *srna)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_geometry_modifier(StructRNA *srna)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
PointerRNA RNA_id_pointer_create(ID *id)
static void rna_def_freestyle_alpha_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
const EnumPropertyItem rna_enum_ramp_blend_items[]
int BKE_linestyle_thickness_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
@ FUNC_USE_REPORTS
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
@ LS_MODIFIER_BLUEPRINT_SQUARES
@ LS_MODIFIER_BLUEPRINT_CIRCLES
@ LS_MODIFIER_BLUEPRINT_ELLIPSES
const EnumPropertyItem rna_enum_linestyle_thickness_modifier_type_items[]
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
const EnumPropertyItem rna_enum_linestyle_geometry_modifier_type_items[]
void rna_def_mtex_common(BlenderRNA *brna, StructRNA *srna, const char *begin, const char *activeget, const char *activeset, const char *activeeditable, const char *name, const char *name_slots, const char *update, const char *update_index)
int BKE_linestyle_alpha_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier)
@ LS_MODIFIER_MATERIAL_SPEC_HARD
void RNA_def_property_enum_bitflag_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_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_modifier_type_common(StructRNA *srna, const EnumPropertyItem *modifier_type_items, const bool blend, const bool color)
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:588
void rna_def_animdata_common(StructRNA *srna)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void BLI_uniquename(const ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
@ LS_MODIFIER_SPATIAL_NOISE_SMOOTH
@ LS_MODIFIER_SPATIAL_NOISE_PURERANDOM
@ PROP_BOOLEAN
Definition RNA_types.hh:210
@ PROP_POINTER
Definition RNA_types.hh:215
@ PROP_STRING
Definition RNA_types.hh:213
@ PROP_COLLECTION
Definition RNA_types.hh:216
static void rna_def_color_modifier(StructRNA *srna)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
const EnumPropertyItem rna_enum_linestyle_alpha_modifier_type_items[]
void DEG_id_tag_update(ID *id, unsigned int flags)
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:162
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
struct Tex * give_current_linestyle_texture(struct FreestyleLineStyle *linestyle)
Definition texture.cc:443
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
char char size_t BLI_str_escape(char *__restrict dst, StringRef src, size_t dst_maxncpy) ATTR_NONNULL(1)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void set_current_linestyle_texture(struct FreestyleLineStyle *linestyle, struct Tex *tex)
Definition texture.cc:458
@ LS_MODIFIER_PERLIN_NOISE_2D
@ LS_MODIFIER_BACKBONE_STRETCHER
@ LS_MODIFIER_PERLIN_NOISE_1D
@ LS_MODIFIER_DISTANCE_FROM_CAMERA
@ LS_MODIFIER_DISTANCE_FROM_OBJECT
@ LS_MODIFIER_SINUS_DISPLACEMENT
static void rna_def_freestyle_geometry_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
LineStyleModifier * BKE_linestyle_alpha_modifier_add(FreestyleLineStyle *linestyle, const char *name, eLineStyleModifier_Type type)
static void rna_def_modifier_material_common(StructRNA *srna)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
static void rna_def_linestyle(BlenderRNA *brna)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
static void rna_def_freestyle_thickness_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
Main * CTX_data_main(const bContext *C)
static void rna_def_modifier_curve_common(StructRNA *srna, bool range, bool value)
static void rna_def_linestyle_mtex(BlenderRNA *brna)
LineStyleModifier * BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *linestyle, const char *name, eLineStyleModifier_Type type)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:477
@ PROP_EDITABLE
Definition RNA_types.hh:376
@ PROP_PROPORTIONAL
Definition RNA_types.hh:419
@ PROP_THICK_WRAP
Definition RNA_types.hh:493
@ PROP_PTR_NO_OWNERSHIP
Definition RNA_types.hh:465
@ PROP_NEVER_NULL
Definition RNA_types.hh:447
@ PROP_ANIMATABLE
Definition RNA_types.hh:389
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
const EnumPropertyItem rna_enum_linestyle_color_modifier_type_items[]
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
static void rna_def_modifier_color_ramp_common(StructRNA *srna, int range)
Scene * CTX_data_scene(const bContext *C)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
LineStyleModifier * BKE_linestyle_color_modifier_add(FreestyleLineStyle *linestyle, const char *name, eLineStyleModifier_Type type)
Definition linestyle.cc:836
@ PROP_FACTOR
Definition RNA_types.hh:308
@ PROP_DISTANCE
Definition RNA_types.hh:313
@ PROP_UNSIGNED
Definition RNA_types.hh:306
@ PARM_REQUIRED
Definition RNA_types.hh:631
@ PARM_RNAPTR
Definition RNA_types.hh:633
int BKE_linestyle_color_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
void BKE_linestyle_default_shader(const struct bContext *C, FreestyleLineStyle *linestyle)
void RNA_def_property_array(PropertyRNA *prop, int length)
static void rna_def_freestyle_color_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_linestyle_modifiers(BlenderRNA *brna)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
int BKE_linestyle_geometry_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier)