Blender V4.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
9#include <cstdio>
10#include <cstdlib>
11
12#include "BLI_math_rotation.h"
13#include "BLI_utildefines.h"
14
15#include "BLT_translation.hh"
16
17#include "RNA_define.hh"
18#include "RNA_enum_types.hh"
19
20#include "rna_internal.hh"
21
22#include "DNA_linestyle_types.h"
23#include "DNA_material_types.h"
24#include "DNA_texture_types.h"
25
26#include "WM_api.hh"
27#include "WM_types.hh"
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#ifdef RNA_RUNTIME
117
118# include <fmt/format.h>
119
120# include "BLI_string_utils.hh"
121
122# include "BKE_linestyle.h"
123# include "BKE_texture.h"
124
125# include "DEG_depsgraph.hh"
126
127# include "ED_node.hh"
128
129# include "RNA_access.hh"
130
131static StructRNA *rna_LineStyle_color_modifier_refine(PointerRNA *ptr)
132{
134
135 switch (m->type) {
137 return &RNA_LineStyleColorModifier_AlongStroke;
139 return &RNA_LineStyleColorModifier_DistanceFromCamera;
141 return &RNA_LineStyleColorModifier_DistanceFromObject;
143 return &RNA_LineStyleColorModifier_Material;
145 return &RNA_LineStyleColorModifier_Tangent;
147 return &RNA_LineStyleColorModifier_Noise;
149 return &RNA_LineStyleColorModifier_CreaseAngle;
151 return &RNA_LineStyleColorModifier_Curvature_3D;
152 default:
153 return &RNA_LineStyleColorModifier;
154 }
155}
156
157static StructRNA *rna_LineStyle_alpha_modifier_refine(PointerRNA *ptr)
158{
160
161 switch (m->type) {
163 return &RNA_LineStyleAlphaModifier_AlongStroke;
165 return &RNA_LineStyleAlphaModifier_DistanceFromCamera;
167 return &RNA_LineStyleAlphaModifier_DistanceFromObject;
169 return &RNA_LineStyleAlphaModifier_Material;
171 return &RNA_LineStyleAlphaModifier_Tangent;
173 return &RNA_LineStyleAlphaModifier_Noise;
175 return &RNA_LineStyleAlphaModifier_CreaseAngle;
177 return &RNA_LineStyleAlphaModifier_Curvature_3D;
178 default:
179 return &RNA_LineStyleAlphaModifier;
180 }
181}
182
183static StructRNA *rna_LineStyle_thickness_modifier_refine(PointerRNA *ptr)
184{
186
187 switch (m->type) {
189 return &RNA_LineStyleThicknessModifier_AlongStroke;
191 return &RNA_LineStyleThicknessModifier_DistanceFromCamera;
193 return &RNA_LineStyleThicknessModifier_DistanceFromObject;
195 return &RNA_LineStyleThicknessModifier_Material;
197 return &RNA_LineStyleThicknessModifier_Calligraphy;
199 return &RNA_LineStyleThicknessModifier_Tangent;
201 return &RNA_LineStyleThicknessModifier_Noise;
203 return &RNA_LineStyleThicknessModifier_CreaseAngle;
205 return &RNA_LineStyleThicknessModifier_Curvature_3D;
206 default:
207 return &RNA_LineStyleThicknessModifier;
208 }
209}
210
211static StructRNA *rna_LineStyle_geometry_modifier_refine(PointerRNA *ptr)
212{
214
215 switch (m->type) {
217 return &RNA_LineStyleGeometryModifier_Sampling;
219 return &RNA_LineStyleGeometryModifier_BezierCurve;
221 return &RNA_LineStyleGeometryModifier_SinusDisplacement;
223 return &RNA_LineStyleGeometryModifier_SpatialNoise;
225 return &RNA_LineStyleGeometryModifier_PerlinNoise1D;
227 return &RNA_LineStyleGeometryModifier_PerlinNoise2D;
229 return &RNA_LineStyleGeometryModifier_BackboneStretcher;
231 return &RNA_LineStyleGeometryModifier_TipRemover;
233 return &RNA_LineStyleGeometryModifier_Polygonalization;
235 return &RNA_LineStyleGeometryModifier_GuidingLines;
237 return &RNA_LineStyleGeometryModifier_Blueprint;
239 return &RNA_LineStyleGeometryModifier_2DOffset;
241 return &RNA_LineStyleGeometryModifier_2DTransform;
243 return &RNA_LineStyleGeometryModifier_Simplification;
244 default:
245 return &RNA_LineStyleGeometryModifier;
246 }
247}
248
249static std::optional<std::string> rna_LineStyle_color_modifier_path(const PointerRNA *ptr)
250{
252 char name_esc[sizeof(m->name) * 2];
253 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
254 return fmt::format("color_modifiers[\"{}\"]", name_esc);
255}
256
257static std::optional<std::string> rna_LineStyle_alpha_modifier_path(const PointerRNA *ptr)
258{
260 char name_esc[sizeof(m->name) * 2];
261 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
262 return fmt::format("alpha_modifiers[\"{}\"]", name_esc);
263}
264
265static std::optional<std::string> rna_LineStyle_thickness_modifier_path(const PointerRNA *ptr)
266{
268 char name_esc[sizeof(m->name) * 2];
269 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
270 return fmt::format("thickness_modifiers[\"{}\"]", name_esc);
271}
272
273static std::optional<std::string> rna_LineStyle_geometry_modifier_path(const PointerRNA *ptr)
274{
276 char name_esc[sizeof(m->name) * 2];
277 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
278 return fmt::format("geometry_modifiers[\"{}\"]", name_esc);
279}
280
281static void rna_LineStyleColorModifier_name_set(PointerRNA *ptr, const char *value)
282{
285
286 STRNCPY_UTF8(m->name, value);
288 m,
289 "ColorModifier",
290 '.',
292 sizeof(m->name));
293}
294
295static void rna_LineStyleAlphaModifier_name_set(PointerRNA *ptr, const char *value)
296{
299
300 STRNCPY_UTF8(m->name, value);
302 m,
303 "AlphaModifier",
304 '.',
306 sizeof(m->name));
307}
308
309static void rna_LineStyleThicknessModifier_name_set(PointerRNA *ptr, const char *value)
310{
313
314 STRNCPY_UTF8(m->name, value);
316 m,
317 "ThicknessModifier",
318 '.',
320 sizeof(m->name));
321}
322
323static void rna_LineStyleGeometryModifier_name_set(PointerRNA *ptr, const char *value)
324{
327
328 STRNCPY_UTF8(m->name, value);
330 m,
331 "GeometryModifier",
332 '.',
334 sizeof(m->name));
335}
336
337static void rna_LineStyle_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
338{
340 rna_iterator_array_begin(iter, (void *)linestyle->mtex, sizeof(MTex *), MAX_MTEX, 0, nullptr);
341}
342
343static PointerRNA rna_LineStyle_active_texture_get(PointerRNA *ptr)
344{
346 Tex *tex;
347
349 return rna_pointer_inherit_refine(ptr, &RNA_Texture, tex);
350}
351
352static void rna_LineStyle_active_texture_set(PointerRNA *ptr,
353 PointerRNA value,
354 ReportList * /*reports*/)
355{
357
358 set_current_linestyle_texture(linestyle, static_cast<Tex *>(value.data));
359}
360
361static void rna_LineStyle_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
362{
364
367}
368
369static void rna_LineStyle_use_nodes_update(bContext *C, PointerRNA *ptr)
370{
372
373 if (linestyle->use_nodes && linestyle->nodetree == nullptr) {
375 }
376
377 rna_LineStyle_update(CTX_data_main(C), CTX_data_scene(C), ptr);
378}
379
380static LineStyleModifier *rna_LineStyle_color_modifier_add(FreestyleLineStyle *linestyle,
381 ReportList *reports,
382 const char *name,
383 int type)
384{
386
387 if (!modifier) {
388 BKE_report(reports, RPT_ERROR, "Failed to add the color modifier");
389 return nullptr;
390 }
391
394
395 return modifier;
396}
397
398static void rna_LineStyle_color_modifier_remove(FreestyleLineStyle *linestyle,
399 ReportList *reports,
400 PointerRNA *modifier_ptr)
401{
402 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
403
404 if (BKE_linestyle_color_modifier_remove(linestyle, modifier) == -1) {
405 BKE_reportf(reports, RPT_ERROR, "Color modifier '%s' could not be removed", modifier->name);
406 return;
407 }
408
409 RNA_POINTER_INVALIDATE(modifier_ptr);
410
413}
414
415static LineStyleModifier *rna_LineStyle_alpha_modifier_add(FreestyleLineStyle *linestyle,
416 ReportList *reports,
417 const char *name,
418 int type)
419{
421
422 if (!modifier) {
423 BKE_report(reports, RPT_ERROR, "Failed to add the alpha modifier");
424 return nullptr;
425 }
426
429
430 return modifier;
431}
432
433static void rna_LineStyle_alpha_modifier_remove(FreestyleLineStyle *linestyle,
434 ReportList *reports,
435 PointerRNA *modifier_ptr)
436{
437 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
438
439 if (BKE_linestyle_alpha_modifier_remove(linestyle, modifier) == -1) {
440 BKE_reportf(reports, RPT_ERROR, "Alpha modifier '%s' could not be removed", modifier->name);
441 return;
442 }
443
444 RNA_POINTER_INVALIDATE(modifier_ptr);
445
448}
449
450static LineStyleModifier *rna_LineStyle_thickness_modifier_add(FreestyleLineStyle *linestyle,
451 ReportList *reports,
452 const char *name,
453 int type)
454{
456
457 if (!modifier) {
458 BKE_report(reports, RPT_ERROR, "Failed to add the thickness modifier");
459 return nullptr;
460 }
461
464
465 return modifier;
466}
467
468static void rna_LineStyle_thickness_modifier_remove(FreestyleLineStyle *linestyle,
469 ReportList *reports,
470 PointerRNA *modifier_ptr)
471{
472 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
473
476 reports, RPT_ERROR, "Thickness modifier '%s' could not be removed", modifier->name);
477 return;
478 }
479
480 RNA_POINTER_INVALIDATE(modifier_ptr);
481
484}
485
486static LineStyleModifier *rna_LineStyle_geometry_modifier_add(FreestyleLineStyle *linestyle,
487 ReportList *reports,
488 const char *name,
489 int type)
490{
492
493 if (!modifier) {
494 BKE_report(reports, RPT_ERROR, "Failed to add the geometry modifier");
495 return nullptr;
496 }
497
500
501 return modifier;
502}
503
504static void rna_LineStyle_geometry_modifier_remove(FreestyleLineStyle *linestyle,
505 ReportList *reports,
506 PointerRNA *modifier_ptr)
507{
508 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
509
511 BKE_reportf(reports, RPT_ERROR, "Geometry modifier '%s' could not be removed", modifier->name);
512 return;
513 }
514
515 RNA_POINTER_INVALIDATE(modifier_ptr);
516
519}
520
521#else
522
524{
525 StructRNA *srna;
526 PropertyRNA *prop;
527
528 static const EnumPropertyItem texco_items[] = {
529 {TEXCO_WINDOW, "WINDOW", 0, "Window", "Use screen coordinates as texture coordinates"},
530 {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"},
532 "ALONG_STROKE",
533 0,
534 "Along stroke",
535 "Use stroke length for texture coordinates"},
536 {TEXCO_ORCO,
537 "ORCO",
538 0,
539 "Generated",
540 "Use the original undeformed coordinates of the object"},
541 {0, nullptr, 0, nullptr, nullptr},
542 };
543
544 static const EnumPropertyItem prop_mapping_items[] = {
545 {MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"},
546 {MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"},
547 {MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"},
548 {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"},
549 {0, nullptr, 0, nullptr, nullptr},
550 };
551
552 static const EnumPropertyItem prop_x_mapping_items[] = {
553 {0, "NONE", 0, "None", ""},
554 {1, "X", 0, "X", ""},
555 {2, "Y", 0, "Y", ""},
556 {3, "Z", 0, "Z", ""},
557 {0, nullptr, 0, nullptr, nullptr},
558 };
559
560 static const EnumPropertyItem prop_y_mapping_items[] = {
561 {0, "NONE", 0, "None", ""},
562 {1, "X", 0, "X", ""},
563 {2, "Y", 0, "Y", ""},
564 {3, "Z", 0, "Z", ""},
565 {0, nullptr, 0, nullptr, nullptr},
566 };
567
568 static const EnumPropertyItem prop_z_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 srna = RNA_def_struct(brna, "LineStyleTextureSlot", "TextureSlot");
577 RNA_def_struct_sdna(srna, "MTex");
579 srna, "LineStyle Texture Slot", "Texture slot for textures in a LineStyle data-block");
580
581 prop = RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
582 RNA_def_property_enum_sdna(prop, nullptr, "projx");
583 RNA_def_property_enum_items(prop, prop_x_mapping_items);
584 RNA_def_property_ui_text(prop, "X Mapping", "");
585 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
586
587 prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
588 RNA_def_property_enum_sdna(prop, nullptr, "projy");
589 RNA_def_property_enum_items(prop, prop_y_mapping_items);
590 RNA_def_property_ui_text(prop, "Y Mapping", "");
591 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
592
593 prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
594 RNA_def_property_enum_sdna(prop, nullptr, "projz");
595 RNA_def_property_enum_items(prop, prop_z_mapping_items);
596 RNA_def_property_ui_text(prop, "Z Mapping", "");
597 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
598
599 prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
600 RNA_def_property_enum_items(prop, prop_mapping_items);
601 RNA_def_property_ui_text(prop, "Mapping", "");
603 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
604
605 /* map to */
606 prop = RNA_def_property(srna, "use_map_color_diffuse", PROP_BOOLEAN, PROP_NONE);
607 RNA_def_property_boolean_sdna(prop, nullptr, "mapto", MAP_COL);
608 RNA_def_property_ui_text(prop, "Diffuse Color", "The texture affects basic color of the stroke");
609 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
610
611 prop = RNA_def_property(srna, "use_map_alpha", PROP_BOOLEAN, PROP_NONE);
612 RNA_def_property_boolean_sdna(prop, nullptr, "mapto", MAP_ALPHA);
613 RNA_def_property_ui_text(prop, "Alpha", "The texture affects the alpha value");
614 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
615
616 prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
617 RNA_def_property_enum_sdna(prop, nullptr, "texco");
618 RNA_def_property_enum_items(prop, texco_items);
621 "Texture Coordinates",
622 "Texture coordinates used to map the texture onto the background");
623 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
624
625 prop = RNA_def_property(srna, "alpha_factor", PROP_FLOAT, PROP_NONE);
626 RNA_def_property_float_sdna(prop, nullptr, "alphafac");
627 RNA_def_property_ui_range(prop, -1, 1, 10, 3);
628 RNA_def_property_ui_text(prop, "Alpha Factor", "Amount texture affects alpha");
629 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
630
631 prop = RNA_def_property(srna, "diffuse_color_factor", PROP_FLOAT, PROP_NONE);
632 RNA_def_property_float_sdna(prop, nullptr, "colfac");
633 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
634 RNA_def_property_ui_text(prop, "Diffuse Color Factor", "Amount texture affects diffuse color");
635 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
636}
637
639 const EnumPropertyItem *modifier_type_items,
640 const bool blend,
641 const bool color)
642{
643 PropertyRNA *prop;
644
645 /* TODO: Check this is not already defined somewhere else, e.g. in nodes... */
646 static const EnumPropertyItem value_blend_items[] = {
647 {LS_VALUE_BLEND, "MIX", 0, "Mix", ""},
648 {LS_VALUE_ADD, "ADD", 0, "Add", ""},
649 {LS_VALUE_SUB, "SUBTRACT", 0, "Subtract", ""},
650 {LS_VALUE_MULT, "MULTIPLY", 0, "Multiply", ""},
651 {LS_VALUE_DIV, "DIVIDE", 0, "Divide", ""},
652 {LS_VALUE_DIFF, "DIFFERENCE", 0, "Difference", ""},
653 {LS_VALUE_MIN, "MINIMUM", 0, "Minimum", ""},
654 {LS_VALUE_MAX, "MAXIMUM", 0, "Maximum", ""},
655 {0, nullptr, 0, nullptr, nullptr},
656 };
657
658 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
659 RNA_def_property_enum_sdna(prop, nullptr, "modifier.type");
660 RNA_def_property_enum_items(prop, modifier_type_items);
662 RNA_def_property_ui_text(prop, "Modifier Type", "Type of the modifier");
663
664 if (blend) {
665 prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
666 RNA_def_property_enum_sdna(prop, nullptr, "modifier.blend");
667 RNA_def_property_enum_items(prop, (color) ? rna_enum_ramp_blend_items : value_blend_items);
669 prop, "Blend", "Specify how the modifier value is blended into the base value");
670 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
671
672 prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
673 RNA_def_property_float_sdna(prop, nullptr, "modifier.influence");
674 RNA_def_property_range(prop, 0.0f, 1.0f);
676 prop, "Influence", "Influence factor by which the modifier changes the property");
677 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
678 }
679
680 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
681 RNA_def_property_boolean_sdna(prop, nullptr, "modifier.flags", LS_MODIFIER_ENABLED);
682 RNA_def_property_ui_text(prop, "Use", "Enable or disable this modifier during stroke rendering");
683 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
684
685 prop = RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
686 RNA_def_property_boolean_sdna(prop, nullptr, "modifier.flags", LS_MODIFIER_EXPANDED);
687 RNA_def_property_ui_text(prop, "Expanded", "True if the modifier tab is expanded");
688}
689
694
699
705
711
713{
714 PropertyRNA *prop;
715
716 prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NONE);
717 RNA_def_property_pointer_sdna(prop, nullptr, "color_ramp");
718 RNA_def_property_struct_type(prop, "ColorRamp");
719 RNA_def_property_ui_text(prop, "Color Ramp", "Color ramp used to change line color");
720 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
721
722 if (range) {
723 prop = RNA_def_property(srna, "range_min", PROP_FLOAT, PROP_DISTANCE);
724 RNA_def_property_float_sdna(prop, nullptr, "range_min");
726 prop, "Range Min", "Lower bound of the input range the mapping is applied");
727 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
728
729 prop = RNA_def_property(srna, "range_max", PROP_FLOAT, PROP_DISTANCE);
730 RNA_def_property_float_sdna(prop, nullptr, "range_max");
732 prop, "Range Max", "Upper bound of the input range the mapping is applied");
733 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
734 }
735}
736
737static void rna_def_modifier_curve_common(StructRNA *srna, bool range, bool value)
738{
739 PropertyRNA *prop;
740
741 static const EnumPropertyItem mapping_items[] = {
742 {0, "LINEAR", 0, "Linear", "Use linear mapping"},
743 {LS_MODIFIER_USE_CURVE, "CURVE", 0, "Curve", "Use curve mapping"},
744 {0, nullptr, 0, nullptr, nullptr},
745 };
746
747 prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
748 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
749 RNA_def_property_enum_items(prop, mapping_items);
750 RNA_def_property_ui_text(prop, "Mapping", "Select the mapping type");
751 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
752
753 prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
754 RNA_def_property_boolean_sdna(prop, nullptr, "flags", LS_MODIFIER_INVERT);
755 RNA_def_property_ui_text(prop, "Invert", "Invert the fade-out direction of the linear mapping");
756 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
757
758 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
759 RNA_def_property_pointer_sdna(prop, nullptr, "curve");
760 RNA_def_property_struct_type(prop, "CurveMapping");
761 RNA_def_property_ui_text(prop, "Curve", "Curve used for the curve mapping");
762 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
763
764 if (range) {
765 prop = RNA_def_property(srna, "range_min", PROP_FLOAT, PROP_DISTANCE);
766 RNA_def_property_float_sdna(prop, nullptr, "range_min");
768 prop, "Range Min", "Lower bound of the input range the mapping is applied");
769 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
770
771 prop = RNA_def_property(srna, "range_max", PROP_FLOAT, PROP_DISTANCE);
772 RNA_def_property_float_sdna(prop, nullptr, "range_max");
774 prop, "Range Max", "Upper bound of the input range the mapping is applied");
775 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
776 }
777
778 if (value) {
779 prop = RNA_def_property(srna, "value_min", PROP_FLOAT, PROP_NONE);
780 RNA_def_property_float_sdna(prop, nullptr, "value_min");
781 RNA_def_property_ui_text(prop, "Value Min", "Minimum output value of the mapping");
782 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
783
784 prop = RNA_def_property(srna, "value_max", PROP_FLOAT, PROP_NONE);
785 RNA_def_property_float_sdna(prop, nullptr, "value_max");
786 RNA_def_property_ui_text(prop, "Value Max", "Maximum output value of the mapping");
787 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
788 }
789}
790
792{
793 PropertyRNA *prop;
794
795 static const EnumPropertyItem mat_attr_items[] = {
796 {LS_MODIFIER_MATERIAL_LINE, "LINE", 0, "Line Color", ""},
797 {LS_MODIFIER_MATERIAL_LINE_R, "LINE_R", 0, "Line Color Red", ""},
798 {LS_MODIFIER_MATERIAL_LINE_G, "LINE_G", 0, "Line Color Green", ""},
799 {LS_MODIFIER_MATERIAL_LINE_B, "LINE_B", 0, "Line Color Blue", ""},
800 {LS_MODIFIER_MATERIAL_LINE_A, "LINE_A", 0, "Line Color Alpha", ""},
801 {LS_MODIFIER_MATERIAL_DIFF, "DIFF", 0, "Diffuse Color", ""},
802 {LS_MODIFIER_MATERIAL_DIFF_R, "DIFF_R", 0, "Diffuse Color Red", ""},
803 {LS_MODIFIER_MATERIAL_DIFF_G, "DIFF_G", 0, "Diffuse Color Green", ""},
804 {LS_MODIFIER_MATERIAL_DIFF_B, "DIFF_B", 0, "Diffuse Color Blue", ""},
805 {LS_MODIFIER_MATERIAL_SPEC, "SPEC", 0, "Specular Color", ""},
806 {LS_MODIFIER_MATERIAL_SPEC_R, "SPEC_R", 0, "Specular Color Red", ""},
807 {LS_MODIFIER_MATERIAL_SPEC_G, "SPEC_G", 0, "Specular Color Green", ""},
808 {LS_MODIFIER_MATERIAL_SPEC_B, "SPEC_B", 0, "Specular Color Blue", ""},
809 {LS_MODIFIER_MATERIAL_SPEC_HARD, "SPEC_HARD", 0, "Specular Hardness", ""},
810 {LS_MODIFIER_MATERIAL_ALPHA, "ALPHA", 0, "Alpha Transparency", ""},
811 {0, nullptr, 0, nullptr, nullptr},
812 };
813
814 prop = RNA_def_property(srna, "material_attribute", PROP_ENUM, PROP_NONE);
815 RNA_def_property_enum_sdna(prop, nullptr, "mat_attr");
816 RNA_def_property_enum_items(prop, mat_attr_items);
817 RNA_def_property_ui_text(prop, "Material Attribute", "Specify which material attribute is used");
818 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
819}
820
822{
823 StructRNA *srna;
824 PropertyRNA *prop;
825
826 static const EnumPropertyItem blueprint_shape_items[] = {
828 "CIRCLES",
829 0,
830 "Circles",
831 "Draw a blueprint using circular contour strokes"},
833 "ELLIPSES",
834 0,
835 "Ellipses",
836 "Draw a blueprint using elliptic contour strokes"},
838 "SQUARES",
839 0,
840 "Squares",
841 "Draw a blueprint using square contour strokes"},
842 {0, nullptr, 0, nullptr, nullptr},
843 };
844
845 static const EnumPropertyItem transform_pivot_items[] = {
846 {LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER, "CENTER", 0, "Stroke Center", ""},
847 {LS_MODIFIER_2D_TRANSFORM_PIVOT_START, "START", 0, "Stroke Start", ""},
848 {LS_MODIFIER_2D_TRANSFORM_PIVOT_END, "END", 0, "Stroke End", ""},
849 {LS_MODIFIER_2D_TRANSFORM_PIVOT_PARAM, "PARAM", 0, "Stroke Point Parameter", ""},
850 {LS_MODIFIER_2D_TRANSFORM_PIVOT_ABSOLUTE, "ABSOLUTE", 0, "Absolute 2D Point", ""},
851 {0, nullptr, 0, nullptr, nullptr},
852 };
853
854 srna = RNA_def_struct(brna, "LineStyleModifier", nullptr);
855 RNA_def_struct_ui_text(srna, "Line Style Modifier", "Base type to define modifiers");
856
857 /* line color modifiers */
858
859 srna = RNA_def_struct(brna, "LineStyleColorModifier", "LineStyleModifier");
860 RNA_def_struct_sdna(srna, "LineStyleModifier");
861 RNA_def_struct_refine_func(srna, "rna_LineStyle_color_modifier_refine");
862 RNA_def_struct_path_func(srna, "rna_LineStyle_color_modifier_path");
864 srna, "Line Style Color Modifier", "Base type to define line color modifiers");
865
866 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
867 RNA_def_property_string_sdna(prop, nullptr, "name");
868 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleColorModifier_name_set");
869 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
872
873 srna = RNA_def_struct(brna, "LineStyleColorModifier_AlongStroke", "LineStyleColorModifier");
874 RNA_def_struct_ui_text(srna, "Along Stroke", "Change line color along stroke");
877
878 srna = RNA_def_struct(
879 brna, "LineStyleColorModifier_DistanceFromCamera", "LineStyleColorModifier");
881 srna, "Distance from Camera", "Change line color based on the distance from the camera");
884
885 srna = RNA_def_struct(
886 brna, "LineStyleColorModifier_DistanceFromObject", "LineStyleColorModifier");
888 srna, "Distance from Object", "Change line color based on the distance from an object");
891
892 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
893 RNA_def_property_pointer_sdna(prop, nullptr, "target");
894 RNA_def_property_struct_type(prop, "Object");
896 RNA_def_property_ui_text(prop, "Target", "Target object from which the distance is measured");
897 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
898
899 srna = RNA_def_struct(brna, "LineStyleColorModifier_Material", "LineStyleColorModifier");
900 RNA_def_struct_ui_text(srna, "Material", "Change line color based on a material attribute");
904
905 prop = RNA_def_property(srna, "use_ramp", PROP_BOOLEAN, PROP_NONE);
907 RNA_def_property_ui_text(prop, "Ramp", "Use color ramp to map the BW average into an RGB color");
908 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
909
910 srna = RNA_def_struct(brna, "LineStyleColorModifier_Tangent", "LineStyleColorModifier");
911 RNA_def_struct_ui_text(srna, "Tangent", "Change line color based on the direction of a stroke");
914
915 srna = RNA_def_struct(brna, "LineStyleColorModifier_Noise", "LineStyleColorModifier");
916 RNA_def_struct_ui_text(srna, "Noise", "Change line color based on random noise");
919
920 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
921 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
922 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the noise");
923 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
924
925 prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE);
926 RNA_def_property_float_sdna(prop, nullptr, "period");
927 RNA_def_property_ui_text(prop, "Period", "Period of the noise");
928 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
929
930 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
931 RNA_def_property_int_sdna(prop, nullptr, "seed");
932 RNA_def_property_range(prop, 1, SHRT_MAX);
933 RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
934 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
935
936 srna = RNA_def_struct(brna, "LineStyleColorModifier_CreaseAngle", "LineStyleColorModifier");
938 srna, "Crease Angle", "Change line color based on the underlying crease angle");
941
942 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
943 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
944 RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle to modify thickness");
945 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
946
947 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
948 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
949 RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle to modify thickness");
950 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
951
952 srna = RNA_def_struct(brna, "LineStyleColorModifier_Curvature_3D", "LineStyleColorModifier");
954 srna, "Curvature 3D", "Change line color based on the radial curvature of 3D mesh surfaces");
957
958 prop = RNA_def_property(srna, "curvature_min", PROP_FLOAT, PROP_NONE);
959 RNA_def_property_float_sdna(prop, nullptr, "min_curvature");
960 RNA_def_property_ui_text(prop, "Min Curvature", "Minimum Curvature");
961 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
962
963 prop = RNA_def_property(srna, "curvature_max", PROP_FLOAT, PROP_NONE);
964 RNA_def_property_float_sdna(prop, nullptr, "max_curvature");
965 RNA_def_property_ui_text(prop, "Max Curvature", "Maximum Curvature");
966 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
967
968 /* alpha transparency modifiers */
969
970 srna = RNA_def_struct(brna, "LineStyleAlphaModifier", "LineStyleModifier");
971 RNA_def_struct_sdna(srna, "LineStyleModifier");
972 RNA_def_struct_refine_func(srna, "rna_LineStyle_alpha_modifier_refine");
973 RNA_def_struct_path_func(srna, "rna_LineStyle_alpha_modifier_path");
975 srna, "Line Style Alpha Modifier", "Base type to define alpha transparency modifiers");
976
977 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
978 RNA_def_property_string_sdna(prop, nullptr, "name");
979 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleAlphaModifier_name_set");
980 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
983
984 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_AlongStroke", "LineStyleAlphaModifier");
985 RNA_def_struct_ui_text(srna, "Along Stroke", "Change alpha transparency along stroke");
987 rna_def_modifier_curve_common(srna, false, false);
988
989 srna = RNA_def_struct(
990 brna, "LineStyleAlphaModifier_DistanceFromCamera", "LineStyleAlphaModifier");
992 "Distance from Camera",
993 "Change alpha transparency based on the distance from the camera");
995 rna_def_modifier_curve_common(srna, true, false);
996
997 srna = RNA_def_struct(
998 brna, "LineStyleAlphaModifier_DistanceFromObject", "LineStyleAlphaModifier");
1000 "Distance from Object",
1001 "Change alpha transparency based on the distance from an object");
1003 rna_def_modifier_curve_common(srna, true, false);
1004
1005 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1006 RNA_def_property_pointer_sdna(prop, nullptr, "target");
1007 RNA_def_property_struct_type(prop, "Object");
1009 RNA_def_property_ui_text(prop, "Target", "Target object from which the distance is measured");
1010 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1011
1012 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Material", "LineStyleAlphaModifier");
1014 srna, "Material", "Change alpha transparency based on a material attribute");
1017 rna_def_modifier_curve_common(srna, false, false);
1018
1019 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Tangent", "LineStyleAlphaModifier");
1021 srna, "Tangent", "Alpha transparency based on the direction of the stroke");
1023 rna_def_modifier_curve_common(srna, false, false);
1024
1025 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Noise", "LineStyleAlphaModifier");
1026 RNA_def_struct_ui_text(srna, "Noise", "Alpha transparency based on random noise");
1028 rna_def_modifier_curve_common(srna, false, false);
1029
1030 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1031 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1032 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the noise");
1033 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1034
1035 prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE);
1036 RNA_def_property_float_sdna(prop, nullptr, "period");
1037 RNA_def_property_ui_text(prop, "Period", "Period of the noise");
1038 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1039
1040 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
1041 RNA_def_property_int_sdna(prop, nullptr, "seed");
1042 RNA_def_property_range(prop, 1, SHRT_MAX);
1043 RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
1044 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1045
1046 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_CreaseAngle", "LineStyleAlphaModifier");
1048 srna, "Crease Angle", "Alpha transparency based on the angle between two adjacent faces");
1050 rna_def_modifier_curve_common(srna, false, false);
1051
1052 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
1053 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
1054 RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle to modify thickness");
1055 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1056
1057 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
1058 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
1059 RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle to modify thickness");
1060 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1061
1062 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Curvature_3D", "LineStyleAlphaModifier");
1064 "Curvature 3D",
1065 "Alpha transparency based on the radial curvature of 3D mesh surfaces");
1067 rna_def_modifier_curve_common(srna, false, false);
1068
1069 prop = RNA_def_property(srna, "curvature_min", PROP_FLOAT, PROP_NONE);
1070 RNA_def_property_float_sdna(prop, nullptr, "min_curvature");
1071 RNA_def_property_range(prop, 0.0f, 10000.0f);
1072 RNA_def_property_ui_text(prop, "Min Curvature", "Minimum Curvature");
1073 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1074
1075 prop = RNA_def_property(srna, "curvature_max", PROP_FLOAT, PROP_NONE);
1076 RNA_def_property_float_sdna(prop, nullptr, "max_curvature");
1077 RNA_def_property_range(prop, 0.0f, 10000.0f);
1078 RNA_def_property_ui_text(prop, "Max Curvature", "Maximum Curvature");
1079 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1080
1081 /* line thickness modifiers */
1082 srna = RNA_def_struct(brna, "LineStyleThicknessModifier", "LineStyleModifier");
1083 RNA_def_struct_sdna(srna, "LineStyleModifier");
1084 RNA_def_struct_refine_func(srna, "rna_LineStyle_thickness_modifier_refine");
1085 RNA_def_struct_path_func(srna, "rna_LineStyle_thickness_modifier_path");
1087 srna, "Line Style Thickness Modifier", "Base type to define line thickness modifiers");
1088
1089 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1090 RNA_def_property_string_sdna(prop, nullptr, "name");
1091 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleThicknessModifier_name_set");
1092 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
1093 RNA_def_property_update(prop, NC_LINESTYLE, nullptr);
1094 RNA_def_struct_name_property(srna, prop);
1095
1096 srna = RNA_def_struct(brna, "LineStyleThicknessModifier_Tangent", "LineStyleThicknessModifier");
1097 RNA_def_struct_ui_text(srna, "Tangent", "Thickness based on the direction of the stroke");
1099 rna_def_modifier_curve_common(srna, false, false);
1100
1101 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1102 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1103 RNA_def_property_range(prop, 0.0f, 10000.0f);
1104 RNA_def_property_ui_text(prop, "Min Thickness", "Minimum thickness");
1105 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1106
1107 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1108 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1109 RNA_def_property_range(prop, 0.0f, 10000.0f);
1110 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness");
1111 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1112
1113 srna = RNA_def_struct(
1114 brna, "LineStyleThicknessModifier_AlongStroke", "LineStyleThicknessModifier");
1115 RNA_def_struct_ui_text(srna, "Along Stroke", "Change line thickness along stroke");
1117 rna_def_modifier_curve_common(srna, false, true);
1118
1119 srna = RNA_def_struct(
1120 brna, "LineStyleThicknessModifier_DistanceFromCamera", "LineStyleThicknessModifier");
1122 srna, "Distance from Camera", "Change line thickness based on the distance from the camera");
1124 rna_def_modifier_curve_common(srna, true, true);
1125
1126 srna = RNA_def_struct(
1127 brna, "LineStyleThicknessModifier_DistanceFromObject", "LineStyleThicknessModifier");
1129 srna, "Distance from Object", "Change line thickness based on the distance from an object");
1131 rna_def_modifier_curve_common(srna, true, true);
1132
1133 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1134 RNA_def_property_pointer_sdna(prop, nullptr, "target");
1135 RNA_def_property_struct_type(prop, "Object");
1137 RNA_def_property_ui_text(prop, "Target", "Target object from which the distance is measured");
1138 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1139
1140 srna = RNA_def_struct(brna, "LineStyleThicknessModifier_Material", "LineStyleThicknessModifier");
1141 RNA_def_struct_ui_text(srna, "Material", "Change line thickness based on a material attribute");
1144 rna_def_modifier_curve_common(srna, false, true);
1145
1146 srna = RNA_def_struct(
1147 brna, "LineStyleThicknessModifier_Calligraphy", "LineStyleThicknessModifier");
1149 srna,
1150 "Calligraphy",
1151 "Change line thickness so that stroke looks like made with a calligraphic pen");
1153
1154 prop = RNA_def_property(srna, "orientation", PROP_FLOAT, PROP_ANGLE);
1155 RNA_def_property_float_sdna(prop, nullptr, "orientation");
1156 RNA_def_property_ui_text(prop, "Orientation", "Angle of the main direction");
1157 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1158
1159 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1160 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1161 RNA_def_property_range(prop, 0.0f, 10000.0f);
1163 prop,
1164 "Min Thickness",
1165 "Minimum thickness in the direction perpendicular to the main direction");
1166 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1167
1168 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1169 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1170 RNA_def_property_range(prop, 0.0f, 10000.0f);
1171 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness in the main direction");
1172 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1173
1174 srna = RNA_def_struct(brna, "LineStyleThicknessModifier_Noise", "LineStyleThicknessModifier");
1175 RNA_def_struct_ui_text(srna, "Noise", "Line thickness based on random noise");
1177
1178 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1179 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1180 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the noise");
1181 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1182
1183 prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE);
1184 RNA_def_property_float_sdna(prop, nullptr, "period");
1185 RNA_def_property_ui_text(prop, "Period", "Period of the noise");
1186 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1187
1188 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
1189 RNA_def_property_int_sdna(prop, nullptr, "seed");
1190 RNA_def_property_range(prop, 1, SHRT_MAX);
1191 RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
1192 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1193
1194 prop = RNA_def_property(srna, "use_asymmetric", PROP_BOOLEAN, PROP_NONE);
1196 RNA_def_property_ui_text(prop, "Asymmetric", "Allow thickness to be assigned asymmetrically");
1197 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1198
1199 srna = RNA_def_struct(
1200 brna, "LineStyleThicknessModifier_Curvature_3D", "LineStyleThicknessModifier");
1202 srna, "Curvature 3D", "Line thickness based on the radial curvature of 3D mesh surfaces");
1204 rna_def_modifier_curve_common(srna, false, false);
1205
1206 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1207 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1208 RNA_def_property_range(prop, 0.0f, 10000.0f);
1209 RNA_def_property_ui_text(prop, "Min Thickness", "Minimum thickness");
1210 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1211
1212 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1213 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1214 RNA_def_property_range(prop, 0.0f, 10000.0f);
1215 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness");
1216 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1217
1218 prop = RNA_def_property(srna, "curvature_min", PROP_FLOAT, PROP_NONE);
1219 RNA_def_property_float_sdna(prop, nullptr, "min_curvature");
1220 RNA_def_property_range(prop, 0.0f, 10000.0f);
1221 RNA_def_property_ui_text(prop, "Min Curvature", "Minimum Curvature");
1222 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1223
1224 prop = RNA_def_property(srna, "curvature_max", PROP_FLOAT, PROP_NONE);
1225 RNA_def_property_float_sdna(prop, nullptr, "max_curvature");
1226 RNA_def_property_range(prop, 0.0f, 10000.0f);
1227 RNA_def_property_ui_text(prop, "Max Curvature", "Maximum Curvature");
1228 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1229
1230 srna = RNA_def_struct(
1231 brna, "LineStyleThicknessModifier_CreaseAngle", "LineStyleThicknessModifier");
1233 srna, "Crease Angle", "Line thickness based on the angle between two adjacent faces");
1235 rna_def_modifier_curve_common(srna, false, false);
1236
1237 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
1238 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
1239 RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle to modify thickness");
1240 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1241
1242 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
1243 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
1244 RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle to modify thickness");
1245 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1246
1247 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1248 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1249 RNA_def_property_range(prop, 0.0f, 10000.0f);
1250 RNA_def_property_ui_text(prop, "Min Thickness", "Minimum thickness");
1251 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1252
1253 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1254 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1255 RNA_def_property_range(prop, 0.0f, 10000.0f);
1256 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness");
1257 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1258
1259 /* geometry modifiers */
1260
1261 srna = RNA_def_struct(brna, "LineStyleGeometryModifier", "LineStyleModifier");
1262 RNA_def_struct_sdna(srna, "LineStyleModifier");
1263 RNA_def_struct_refine_func(srna, "rna_LineStyle_geometry_modifier_refine");
1264 RNA_def_struct_path_func(srna, "rna_LineStyle_geometry_modifier_path");
1266 srna, "Line Style Geometry Modifier", "Base type to define stroke geometry modifiers");
1267
1268 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1269 RNA_def_property_string_sdna(prop, nullptr, "name");
1270 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleGeometryModifier_name_set");
1271 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
1272 RNA_def_property_update(prop, NC_LINESTYLE, nullptr);
1273 RNA_def_struct_name_property(srna, prop);
1274
1275 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_Sampling", "LineStyleGeometryModifier");
1277 srna,
1278 "Sampling",
1279 "Specify a new sampling value that determines the resolution of stroke polylines");
1281
1282 prop = RNA_def_property(srna, "sampling", PROP_FLOAT, PROP_NONE);
1283 RNA_def_property_float_sdna(prop, nullptr, "sampling");
1284 RNA_def_property_range(prop, 0.0f, 10000.0f);
1286 prop, "Sampling", "New sampling value to be used for subsequent modifiers");
1287 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1288
1289 srna = RNA_def_struct(
1290 brna, "LineStyleGeometryModifier_BezierCurve", "LineStyleGeometryModifier");
1292 "Bézier Curve",
1293 "Replace stroke backbone geometry by a Bézier curve approximation of the "
1294 "original backbone geometry");
1296
1297 prop = RNA_def_property(srna, "error", PROP_FLOAT, PROP_NONE);
1298 RNA_def_property_float_sdna(prop, nullptr, "error");
1300 "Error",
1301 "Maximum distance allowed between the new Bézier curve and the "
1302 "original backbone geometry");
1303 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1304
1305 srna = RNA_def_struct(
1306 brna, "LineStyleGeometryModifier_SinusDisplacement", "LineStyleGeometryModifier");
1308 srna, "Sinus Displacement", "Add sinus displacement to stroke backbone geometry");
1310
1311 prop = RNA_def_property(srna, "wavelength", PROP_FLOAT, PROP_UNSIGNED);
1312 RNA_def_property_float_sdna(prop, nullptr, "wavelength");
1313 RNA_def_property_range(prop, 0.0001f, FLT_MAX);
1314 RNA_def_property_ui_text(prop, "Wavelength", "Wavelength of the sinus displacement");
1315 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1316
1317 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1318 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1319 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the sinus displacement");
1320 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1321
1322 prop = RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE);
1323 RNA_def_property_float_sdna(prop, nullptr, "phase");
1324 RNA_def_property_ui_text(prop, "Phase", "Phase of the sinus displacement");
1325 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1326
1327 srna = RNA_def_struct(
1328 brna, "LineStyleGeometryModifier_SpatialNoise", "LineStyleGeometryModifier");
1329 RNA_def_struct_ui_text(srna, "Spatial Noise", "Add spatial noise to stroke backbone geometry");
1331
1332 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1333 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1334 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the spatial noise");
1335 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1336
1337 prop = RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
1338 RNA_def_property_float_sdna(prop, nullptr, "scale");
1339 RNA_def_property_ui_text(prop, "Scale", "Scale of the spatial noise");
1340 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1341
1342 prop = RNA_def_property(srna, "octaves", PROP_INT, PROP_UNSIGNED);
1343 RNA_def_property_int_sdna(prop, nullptr, "octaves");
1345 prop, "Octaves", "Number of octaves (i.e., the amount of detail of the spatial noise)");
1346 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1347
1348 prop = RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE);
1350 RNA_def_property_ui_text(prop, "Smooth", "If true, the spatial noise is smooth");
1352 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1353
1354 prop = RNA_def_property(srna, "use_pure_random", PROP_BOOLEAN, PROP_NONE);
1357 prop, "Pure Random", "If true, the spatial noise does not show any coherence");
1358 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1359
1360 srna = RNA_def_struct(
1361 brna, "LineStyleGeometryModifier_PerlinNoise1D", "LineStyleGeometryModifier");
1363 srna, "Perlin Noise 1D", "Add one-dimensional Perlin noise to stroke backbone geometry");
1365
1366 prop = RNA_def_property(srna, "frequency", PROP_FLOAT, PROP_NONE);
1367 RNA_def_property_float_sdna(prop, nullptr, "frequency");
1368 RNA_def_property_ui_text(prop, "Frequency", "Frequency of the Perlin noise");
1369 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1370
1371 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1372 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1373 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the Perlin noise");
1374 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1375
1376 prop = RNA_def_property(srna, "octaves", PROP_INT, PROP_UNSIGNED);
1377 RNA_def_property_int_sdna(prop, nullptr, "octaves");
1379 prop, "Octaves", "Number of octaves (i.e., the amount of detail of the Perlin noise)");
1380 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1381
1382 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1383 RNA_def_property_float_sdna(prop, nullptr, "angle");
1384 RNA_def_property_ui_text(prop, "Angle", "Displacement direction");
1385 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1386
1387 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
1388 RNA_def_property_int_sdna(prop, nullptr, "seed");
1390 prop,
1391 "Seed",
1392 "Seed for random number generation (if negative, time is used as a seed instead)");
1393 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1394
1395 srna = RNA_def_struct(
1396 brna, "LineStyleGeometryModifier_PerlinNoise2D", "LineStyleGeometryModifier");
1398 srna, "Perlin Noise 2D", "Add two-dimensional Perlin noise to stroke backbone geometry");
1400
1401 prop = RNA_def_property(srna, "frequency", PROP_FLOAT, PROP_NONE);
1402 RNA_def_property_float_sdna(prop, nullptr, "frequency");
1403 RNA_def_property_ui_text(prop, "Frequency", "Frequency of the Perlin noise");
1404 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1405
1406 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1407 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1408 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the Perlin noise");
1409 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1410
1411 prop = RNA_def_property(srna, "octaves", PROP_INT, PROP_UNSIGNED);
1412 RNA_def_property_int_sdna(prop, nullptr, "octaves");
1414 prop, "Octaves", "Number of octaves (i.e., the amount of detail of the Perlin noise)");
1415 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1416
1417 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1418 RNA_def_property_float_sdna(prop, nullptr, "angle");
1419 RNA_def_property_ui_text(prop, "Angle", "Displacement direction");
1420 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1421
1422 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
1423 RNA_def_property_int_sdna(prop, nullptr, "seed");
1425 prop,
1426 "Seed",
1427 "Seed for random number generation (if negative, time is used as a seed instead)");
1428 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1429
1430 srna = RNA_def_struct(
1431 brna, "LineStyleGeometryModifier_BackboneStretcher", "LineStyleGeometryModifier");
1433 srna, "Backbone Stretcher", "Stretch the beginning and the end of stroke backbone");
1435
1436 prop = RNA_def_property(srna, "backbone_length", PROP_FLOAT, PROP_NONE);
1437 RNA_def_property_float_sdna(prop, nullptr, "backbone_length");
1438 RNA_def_property_ui_text(prop, "Backbone Length", "Amount of backbone stretching");
1439 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1440
1441 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_TipRemover", "LineStyleGeometryModifier");
1443 srna,
1444 "Tip Remover",
1445 "Remove a piece of stroke at the beginning and the end of stroke backbone");
1447
1448 prop = RNA_def_property(srna, "tip_length", PROP_FLOAT, PROP_NONE);
1449 RNA_def_property_float_sdna(prop, nullptr, "tip_length");
1450 RNA_def_property_ui_text(prop, "Tip Length", "Length of tips to be removed");
1451 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1452
1453 srna = RNA_def_struct(
1454 brna, "LineStyleGeometryModifier_Polygonalization", "LineStyleGeometryModifier");
1456 srna, "Polygonalization", "Modify the stroke geometry so that it looks more 'polygonal'");
1458
1459 prop = RNA_def_property(srna, "error", PROP_FLOAT, PROP_NONE);
1460 RNA_def_property_float_sdna(prop, nullptr, "error");
1462 prop,
1463 "Error",
1464 "Maximum distance between the original stroke and its polygonal approximation");
1465 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1466
1467 srna = RNA_def_struct(
1468 brna, "LineStyleGeometryModifier_GuidingLines", "LineStyleGeometryModifier");
1470 srna,
1471 "Guiding Lines",
1472 "Modify the stroke geometry so that it corresponds to its main direction line");
1474
1475 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
1476 RNA_def_property_float_sdna(prop, nullptr, "offset");
1478 prop, "Offset", "Displacement that is applied to the main direction line along its normal");
1479 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1480
1481 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_Blueprint", "LineStyleGeometryModifier");
1483 srna,
1484 "Blueprint",
1485 "Produce a blueprint using circular, elliptic, and square contour strokes");
1487
1488 prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
1489 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
1490 RNA_def_property_enum_items(prop, blueprint_shape_items);
1491 RNA_def_property_ui_text(prop, "Shape", "Select the shape of blueprint contour strokes");
1492 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1493
1494 prop = RNA_def_property(srna, "rounds", PROP_INT, PROP_UNSIGNED);
1495 RNA_def_property_int_sdna(prop, nullptr, "rounds");
1496 RNA_def_property_range(prop, 1, 1000);
1497 RNA_def_property_ui_text(prop, "Rounds", "Number of rounds in contour strokes");
1498 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1499
1500 prop = RNA_def_property(srna, "backbone_length", PROP_FLOAT, PROP_NONE);
1501 RNA_def_property_float_sdna(prop, nullptr, "backbone_length");
1502 RNA_def_property_ui_text(prop, "Backbone Length", "Amount of backbone stretching");
1503 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1504
1505 prop = RNA_def_property(srna, "random_radius", PROP_INT, PROP_UNSIGNED);
1506 RNA_def_property_int_sdna(prop, nullptr, "random_radius");
1507 RNA_def_property_ui_text(prop, "Random Radius", "Randomness of the radius");
1508 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1509
1510 prop = RNA_def_property(srna, "random_center", PROP_INT, PROP_UNSIGNED);
1511 RNA_def_property_int_sdna(prop, nullptr, "random_center");
1512 RNA_def_property_ui_text(prop, "Random Center", "Randomness of the center");
1513 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1514
1515 prop = RNA_def_property(srna, "random_backbone", PROP_INT, PROP_UNSIGNED);
1516 RNA_def_property_int_sdna(prop, nullptr, "random_backbone");
1517 RNA_def_property_ui_text(prop, "Random Backbone", "Randomness of the backbone stretching");
1518 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1519
1520 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_2DOffset", "LineStyleGeometryModifier");
1522 srna, "2D Offset", "Add two-dimensional offsets to stroke backbone geometry");
1524
1525 prop = RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE);
1526 RNA_def_property_float_sdna(prop, nullptr, "start");
1528 prop, "Start", "Displacement that is applied from the beginning of the stroke");
1529 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1530
1531 prop = RNA_def_property(srna, "end", PROP_FLOAT, PROP_NONE);
1532 RNA_def_property_float_sdna(prop, nullptr, "end");
1533 RNA_def_property_ui_text(prop, "End", "Displacement that is applied from the end of the stroke");
1534 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1535
1536 prop = RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE);
1537 RNA_def_property_float_sdna(prop, nullptr, "x");
1539 prop, "X", "Displacement that is applied to the X coordinates of stroke vertices");
1540 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1541
1542 prop = RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE);
1543 RNA_def_property_float_sdna(prop, nullptr, "y");
1545 prop, "Y", "Displacement that is applied to the Y coordinates of stroke vertices");
1546 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1547
1548 srna = RNA_def_struct(
1549 brna, "LineStyleGeometryModifier_2DTransform", "LineStyleGeometryModifier");
1551 "2D Transform",
1552 "Apply two-dimensional scaling and rotation to stroke backbone geometry");
1554
1555 prop = RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE);
1556 RNA_def_property_enum_sdna(prop, nullptr, "pivot");
1557 RNA_def_property_enum_items(prop, transform_pivot_items);
1558 RNA_def_property_ui_text(prop, "Pivot", "Pivot of scaling and rotation operations");
1559 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1560
1561 prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE);
1562 RNA_def_property_float_sdna(prop, nullptr, "scale_x");
1564 RNA_def_property_ui_text(prop, "Scale X", "Scaling factor that is applied along the X axis");
1565 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1566
1567 prop = RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_NONE);
1568 RNA_def_property_float_sdna(prop, nullptr, "scale_y");
1570 RNA_def_property_ui_text(prop, "Scale Y", "Scaling factor that is applied along the Y axis");
1571 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1572
1573 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1574 RNA_def_property_float_sdna(prop, nullptr, "angle");
1575 RNA_def_property_ui_text(prop, "Rotation Angle", "Rotation angle");
1576 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1577
1578 prop = RNA_def_property(srna, "pivot_u", PROP_FLOAT, PROP_FACTOR);
1579 RNA_def_property_float_sdna(prop, nullptr, "pivot_u");
1580 RNA_def_property_range(prop, 0.0f, 1.0f);
1582 "Stroke Point Parameter",
1583 "Pivot in terms of the stroke point parameter u (0 <= u <= 1)");
1584 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1585
1586 prop = RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_NONE);
1587 RNA_def_property_float_sdna(prop, nullptr, "pivot_x");
1588 RNA_def_property_ui_text(prop, "Pivot X", "2D X coordinate of the absolute pivot");
1589 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1590
1591 prop = RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_NONE);
1592 RNA_def_property_float_sdna(prop, nullptr, "pivot_y");
1593 RNA_def_property_ui_text(prop, "Pivot Y", "2D Y coordinate of the absolute pivot");
1594 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1595
1596 srna = RNA_def_struct(
1597 brna, "LineStyleGeometryModifier_Simplification", "LineStyleGeometryModifier");
1598 RNA_def_struct_ui_text(srna, "Simplification", "Simplify the stroke set");
1600
1601 prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE);
1602 RNA_def_property_float_sdna(prop, nullptr, "tolerance");
1603 RNA_def_property_ui_text(prop, "Tolerance", "Distance below which segments will be merged");
1604 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1605}
1606
1608{
1609 StructRNA *srna;
1610 FunctionRNA *func;
1611 PropertyRNA *parm;
1612
1613 RNA_def_property_srna(cprop, "LineStyleColorModifiers");
1614 srna = RNA_def_struct(brna, "LineStyleColorModifiers", nullptr);
1615 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1616 RNA_def_struct_ui_text(srna, "Color Modifiers", "Color modifiers for changing line colors");
1617
1618 func = RNA_def_function(srna, "new", "rna_LineStyle_color_modifier_add");
1619 RNA_def_function_ui_description(func, "Add a color modifier to line style");
1621 parm = RNA_def_string(
1622 func, "name", "ColorModifier", 0, "", "New name for the color modifier (not unique)");
1624 parm = RNA_def_enum(func,
1625 "type",
1627 0,
1628 "",
1629 "Color modifier type to add");
1631 parm = RNA_def_pointer(
1632 func, "modifier", "LineStyleColorModifier", "", "Newly added color modifier");
1633 RNA_def_function_return(func, parm);
1634
1635 func = RNA_def_function(srna, "remove", "rna_LineStyle_color_modifier_remove");
1636 RNA_def_function_ui_description(func, "Remove a color modifier from line style");
1638 parm = RNA_def_pointer(
1639 func, "modifier", "LineStyleColorModifier", "", "Color modifier to remove");
1642}
1643
1645{
1646 StructRNA *srna;
1647 FunctionRNA *func;
1648 PropertyRNA *parm;
1649
1650 RNA_def_property_srna(cprop, "LineStyleAlphaModifiers");
1651 srna = RNA_def_struct(brna, "LineStyleAlphaModifiers", nullptr);
1652 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1653 RNA_def_struct_ui_text(srna, "Alpha Modifiers", "Alpha modifiers for changing line alphas");
1654
1655 func = RNA_def_function(srna, "new", "rna_LineStyle_alpha_modifier_add");
1656 RNA_def_function_ui_description(func, "Add a alpha modifier to line style");
1658 parm = RNA_def_string(
1659 func, "name", "AlphaModifier", 0, "", "New name for the alpha modifier (not unique)");
1661 parm = RNA_def_enum(func,
1662 "type",
1664 0,
1665 "",
1666 "Alpha modifier type to add");
1668 parm = RNA_def_pointer(
1669 func, "modifier", "LineStyleAlphaModifier", "", "Newly added alpha modifier");
1670 RNA_def_function_return(func, parm);
1671
1672 func = RNA_def_function(srna, "remove", "rna_LineStyle_alpha_modifier_remove");
1673 RNA_def_function_ui_description(func, "Remove a alpha modifier from line style");
1675 parm = RNA_def_pointer(
1676 func, "modifier", "LineStyleAlphaModifier", "", "Alpha modifier to remove");
1679}
1680
1682{
1683 StructRNA *srna;
1684 FunctionRNA *func;
1685 PropertyRNA *parm;
1686
1687 RNA_def_property_srna(cprop, "LineStyleThicknessModifiers");
1688 srna = RNA_def_struct(brna, "LineStyleThicknessModifiers", nullptr);
1689 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1691 srna, "Thickness Modifiers", "Thickness modifiers for changing line thickness");
1692
1693 func = RNA_def_function(srna, "new", "rna_LineStyle_thickness_modifier_add");
1694 RNA_def_function_ui_description(func, "Add a thickness modifier to line style");
1696 parm = RNA_def_string(func,
1697 "name",
1698 "ThicknessModifier",
1699 0,
1700 "",
1701 "New name for the thickness modifier (not unique)");
1703 parm = RNA_def_enum(func,
1704 "type",
1706 0,
1707 "",
1708 "Thickness modifier type to add");
1710 parm = RNA_def_pointer(
1711 func, "modifier", "LineStyleThicknessModifier", "", "Newly added thickness modifier");
1712 RNA_def_function_return(func, parm);
1713
1714 func = RNA_def_function(srna, "remove", "rna_LineStyle_thickness_modifier_remove");
1715 RNA_def_function_ui_description(func, "Remove a thickness modifier from line style");
1717 parm = RNA_def_pointer(
1718 func, "modifier", "LineStyleThicknessModifier", "", "Thickness modifier to remove");
1721}
1722
1724{
1725 StructRNA *srna;
1726 FunctionRNA *func;
1727 PropertyRNA *parm;
1728
1729 RNA_def_property_srna(cprop, "LineStyleGeometryModifiers");
1730 srna = RNA_def_struct(brna, "LineStyleGeometryModifiers", nullptr);
1731 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1733 srna, "Geometry Modifiers", "Geometry modifiers for changing line geometries");
1734
1735 func = RNA_def_function(srna, "new", "rna_LineStyle_geometry_modifier_add");
1736 RNA_def_function_ui_description(func, "Add a geometry modifier to line style");
1738 parm = RNA_def_string(
1739 func, "name", "GeometryModifier", 0, "", "New name for the geometry modifier (not unique)");
1741 parm = RNA_def_enum(func,
1742 "type",
1744 0,
1745 "",
1746 "Geometry modifier type to add");
1748 parm = RNA_def_pointer(
1749 func, "modifier", "LineStyleGeometryModifier", "", "Newly added geometry modifier");
1750 RNA_def_function_return(func, parm);
1751
1752 func = RNA_def_function(srna, "remove", "rna_LineStyle_geometry_modifier_remove");
1753 RNA_def_function_ui_description(func, "Remove a geometry modifier from line style");
1755 parm = RNA_def_pointer(
1756 func, "modifier", "LineStyleGeometryModifier", "", "Geometry modifier to remove");
1759}
1760
1762{
1763 StructRNA *srna;
1764 PropertyRNA *prop;
1765
1766 static const EnumPropertyItem panel_items[] = {
1767 {LS_PANEL_STROKES, "STROKES", 0, "Strokes", "Show the panel for stroke construction"},
1768 {LS_PANEL_COLOR, "COLOR", 0, "Color", "Show the panel for line color options"},
1769 {LS_PANEL_ALPHA, "ALPHA", 0, "Alpha", "Show the panel for alpha transparency options"},
1770 {LS_PANEL_THICKNESS, "THICKNESS", 0, "Thickness", "Show the panel for line thickness options"},
1771 {LS_PANEL_GEOMETRY, "GEOMETRY", 0, "Geometry", "Show the panel for stroke geometry options"},
1772 {LS_PANEL_TEXTURE, "TEXTURE", 0, "Texture", "Show the panel for stroke texture options"},
1773# if 0 /* hidden for now */
1774 {LS_PANEL_MISC, "MISC", 0, "Misc", "Show the panel for miscellaneous options"},
1775# endif
1776 {0, nullptr, 0, nullptr, nullptr},
1777 };
1778 static const EnumPropertyItem chaining_items[] = {
1779 {LS_CHAINING_PLAIN, "PLAIN", 0, "Plain", "Plain chaining"},
1780 {LS_CHAINING_SKETCHY, "SKETCHY", 0, "Sketchy", "Sketchy chaining with a multiple touch"},
1781 {0, nullptr, 0, nullptr, nullptr},
1782 };
1783 static const EnumPropertyItem cap_items[] = {
1784 {LS_CAPS_BUTT, "BUTT", 0, "Butt", "Butt cap (flat)"},
1785 {LS_CAPS_ROUND, "ROUND", 0, "Round", "Round cap (half-circle)"},
1786 {LS_CAPS_SQUARE, "SQUARE", 0, "Square", "Square cap (flat and extended)"},
1787 {0, nullptr, 0, nullptr, nullptr},
1788 };
1789 static const EnumPropertyItem thickness_position_items[] = {
1791 "CENTER",
1792 0,
1793 "Center",
1794 "Silhouettes and border edges are centered along stroke geometry"},
1796 "INSIDE",
1797 0,
1798 "Inside",
1799 "Silhouettes and border edges are drawn inside of stroke geometry"},
1801 "OUTSIDE",
1802 0,
1803 "Outside",
1804 "Silhouettes and border edges are drawn outside of stroke geometry"},
1806 "RELATIVE",
1807 0,
1808 "Relative",
1809 "Silhouettes and border edges are shifted by a user-defined ratio"},
1810 {0, nullptr, 0, nullptr, nullptr},
1811 };
1812 static const EnumPropertyItem sort_key_items[] = {
1814 "DISTANCE_FROM_CAMERA",
1815 0,
1816 "Distance from Camera",
1817 "Sort by distance from camera (closer lines lie on top of further lines)"},
1819 "2D_LENGTH",
1820 0,
1821 "2D Length",
1822 "Sort by curvilinear 2D length (longer lines lie on top of shorter lines)"},
1824 "PROJECTED_X",
1825 0,
1826 "Projected X",
1827 "Sort by the projected X value in the image coordinate system"},
1829 "PROJECTED_Y",
1830 0,
1831 "Projected Y",
1832 "Sort by the projected Y value in the image coordinate system"},
1833 {0, nullptr, 0, nullptr, nullptr},
1834 };
1835 static const EnumPropertyItem sort_order_items[] = {
1836 {0, "DEFAULT", 0, "Default", "Default order of the sort key"},
1837 {LS_REVERSE_ORDER, "REVERSE", 0, "Reverse", "Reverse order"},
1838 {0, nullptr, 0, nullptr, nullptr},
1839 };
1840 static const EnumPropertyItem integration_type_items[] = {
1842 "MEAN",
1843 0,
1844 "Mean",
1845 "The value computed for the chain is the mean of the values obtained for chain vertices"},
1847 "MIN",
1848 0,
1849 "Min",
1850 "The value computed for the chain is the minimum of the values obtained for chain "
1851 "vertices"},
1853 "MAX",
1854 0,
1855 "Max",
1856 "The value computed for the chain is the maximum of the values obtained for chain "
1857 "vertices"},
1859 "FIRST",
1860 0,
1861 "First",
1862 "The value computed for the chain is the value obtained for the first chain vertex"},
1864 "LAST",
1865 0,
1866 "Last",
1867 "The value computed for the chain is the value obtained for the last chain vertex"},
1868 {0, nullptr, 0, nullptr, nullptr},
1869 };
1870
1871 srna = RNA_def_struct(brna, "FreestyleLineStyle", "ID");
1873 srna, "Freestyle Line Style", "Freestyle line style, reusable by multiple line sets");
1874 RNA_def_struct_ui_icon(srna, ICON_LINE_DATA);
1875
1877 srna,
1878 "rna_LineStyle_mtex_begin",
1879 "rna_LineStyle_active_texture_get",
1880 "rna_LineStyle_active_texture_set",
1881 nullptr,
1882 "LineStyleTextureSlot",
1883 "LineStyleTextureSlots",
1884 "rna_LineStyle_update",
1885 "rna_LineStyle_update");
1886
1887 prop = RNA_def_property(srna, "panel", PROP_ENUM, PROP_NONE);
1888 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "panel");
1889 RNA_def_property_enum_items(prop, panel_items);
1891 RNA_def_property_ui_text(prop, "Panel", "Select the property panel to be shown");
1892
1893 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
1894 RNA_def_property_float_sdna(prop, nullptr, "r");
1895 RNA_def_property_array(prop, 3);
1897 prop, "Color", "Base line color, possibly modified by line color modifiers");
1898 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1899
1900 prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR);
1901 RNA_def_property_float_sdna(prop, nullptr, "alpha");
1902 RNA_def_property_range(prop, 0.0f, 1.0f);
1904 prop,
1905 "Alpha Transparency",
1906 "Base alpha transparency, possibly modified by alpha transparency modifiers");
1907 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1908
1909 prop = RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_NONE);
1910 RNA_def_property_float_sdna(prop, nullptr, "thickness");
1911 RNA_def_property_range(prop, 0.0f, 10000.0f);
1913 prop, "Thickness", "Base line thickness, possibly modified by line thickness modifiers");
1914 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1915
1916 prop = RNA_def_property(srna, "thickness_position", PROP_ENUM, PROP_NONE);
1917 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "thickness_position");
1918 RNA_def_property_enum_items(prop, thickness_position_items);
1920 "Thickness Position",
1921 "Thickness position of silhouettes and border edges (applicable when "
1922 "plain chaining is used with the Same Object option)");
1923 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1924
1925 prop = RNA_def_property(srna, "thickness_ratio", PROP_FLOAT, PROP_FACTOR);
1926 RNA_def_property_float_sdna(prop, nullptr, "thickness_ratio");
1927 RNA_def_property_range(prop, 0.0f, 1.0f);
1929 prop,
1930 "Thickness Ratio",
1931 "A number between 0 (inside) and 1 (outside) specifying the relative position of "
1932 "stroke thickness");
1933 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1934
1935 prop = RNA_def_property(srna, "color_modifiers", PROP_COLLECTION, PROP_NONE);
1936 RNA_def_property_collection_sdna(prop, nullptr, "color_modifiers", nullptr);
1937 RNA_def_property_struct_type(prop, "LineStyleColorModifier");
1938 RNA_def_property_ui_text(prop, "Color Modifiers", "List of line color modifiers");
1940
1941 prop = RNA_def_property(srna, "alpha_modifiers", PROP_COLLECTION, PROP_NONE);
1942 RNA_def_property_collection_sdna(prop, nullptr, "alpha_modifiers", nullptr);
1943 RNA_def_property_struct_type(prop, "LineStyleAlphaModifier");
1944 RNA_def_property_ui_text(prop, "Alpha Modifiers", "List of alpha transparency modifiers");
1946
1947 prop = RNA_def_property(srna, "thickness_modifiers", PROP_COLLECTION, PROP_NONE);
1948 RNA_def_property_collection_sdna(prop, nullptr, "thickness_modifiers", nullptr);
1949 RNA_def_property_struct_type(prop, "LineStyleThicknessModifier");
1950 RNA_def_property_ui_text(prop, "Thickness Modifiers", "List of line thickness modifiers");
1952
1953 prop = RNA_def_property(srna, "geometry_modifiers", PROP_COLLECTION, PROP_NONE);
1954 RNA_def_property_collection_sdna(prop, nullptr, "geometry_modifiers", nullptr);
1955 RNA_def_property_struct_type(prop, "LineStyleGeometryModifier");
1956 RNA_def_property_ui_text(prop, "Geometry Modifiers", "List of stroke geometry modifiers");
1958
1959 prop = RNA_def_property(srna, "use_chaining", PROP_BOOLEAN, PROP_NONE);
1961 RNA_def_property_ui_text(prop, "Chaining", "Enable chaining of feature edges");
1962 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1963
1964 prop = RNA_def_property(srna, "chaining", PROP_ENUM, PROP_NONE);
1965 RNA_def_property_enum_sdna(prop, nullptr, "chaining");
1966 RNA_def_property_enum_items(prop, chaining_items);
1968 prop, "Chaining Method", "Select the way how feature edges are jointed to form chains");
1969 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1970
1971 prop = RNA_def_property(srna, "rounds", PROP_INT, PROP_UNSIGNED);
1972 RNA_def_property_int_sdna(prop, nullptr, "rounds");
1973 RNA_def_property_range(prop, 1, 1000);
1974 RNA_def_property_ui_text(prop, "Rounds", "Number of rounds in a sketchy multiple touch");
1975 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1976
1977 prop = RNA_def_property(srna, "use_same_object", PROP_BOOLEAN, PROP_NONE);
1978 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_SAME_OBJECT);
1980 prop, "Same Object", "If true, only feature edges of the same object are joined");
1981 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1982
1983 prop = RNA_def_property(srna, "use_split_length", PROP_BOOLEAN, PROP_NONE);
1984 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_SPLIT_LENGTH);
1986 prop, "Use Split Length", "Enable chain splitting by curvilinear 2D length");
1987 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1988
1989 prop = RNA_def_property(srna, "split_length", PROP_FLOAT, PROP_NONE);
1990 RNA_def_property_float_sdna(prop, nullptr, "split_length");
1991 RNA_def_property_range(prop, 0.0f, 10000.0f);
1992 RNA_def_property_ui_text(prop, "Split Length", "Curvilinear 2D length for chain splitting");
1993 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1994
1995 prop = RNA_def_property(srna, "use_angle_min", PROP_BOOLEAN, PROP_NONE);
1996 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MIN_2D_ANGLE);
1998 "Use Min 2D Angle",
1999 "Split chains at points with angles smaller than the minimum 2D angle");
2000 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2001
2002 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
2003 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
2004 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
2005 RNA_def_property_ui_text(prop, "Min 2D Angle", "Minimum 2D angle for splitting chains");
2006 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2007
2008 prop = RNA_def_property(srna, "use_angle_max", PROP_BOOLEAN, PROP_NONE);
2009 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MAX_2D_ANGLE);
2011 "Use Max 2D Angle",
2012 "Split chains at points with angles larger than the maximum 2D angle");
2013 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2014
2015 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
2016 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
2017 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
2018 RNA_def_property_ui_text(prop, "Max 2D Angle", "Maximum 2D angle for splitting chains");
2019 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2020
2021 prop = RNA_def_property(srna, "use_length_min", PROP_BOOLEAN, PROP_NONE);
2022 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MIN_2D_LENGTH);
2024 prop, "Use Min 2D Length", "Enable the selection of chains by a minimum 2D length");
2025 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2026
2027 prop = RNA_def_property(srna, "length_min", PROP_FLOAT, PROP_NONE);
2028 RNA_def_property_float_sdna(prop, nullptr, "min_length");
2029 RNA_def_property_range(prop, 0.0f, 10000.0f);
2031 prop, "Min 2D Length", "Minimum curvilinear 2D length for the selection of chains");
2032 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2033
2034 prop = RNA_def_property(srna, "use_length_max", PROP_BOOLEAN, PROP_NONE);
2035 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MAX_2D_LENGTH);
2037 prop, "Use Max 2D Length", "Enable the selection of chains by a maximum 2D length");
2038 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2039
2040 prop = RNA_def_property(srna, "length_max", PROP_FLOAT, PROP_NONE);
2041 RNA_def_property_float_sdna(prop, nullptr, "max_length");
2042 RNA_def_property_range(prop, 0.0f, 10000.0f);
2044 prop, "Max 2D Length", "Maximum curvilinear 2D length for the selection of chains");
2045 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2046
2047 prop = RNA_def_property(srna, "use_chain_count", PROP_BOOLEAN, PROP_NONE);
2048 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_CHAIN_COUNT);
2049 RNA_def_property_ui_text(prop, "Use Chain Count", "Enable the selection of first N chains");
2050 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2051
2052 prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_UNSIGNED);
2053 RNA_def_property_int_sdna(prop, nullptr, "chain_count");
2054 RNA_def_property_ui_text(prop, "Chain Count", "Chain count for the selection of first N chains");
2055 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2056
2057 prop = RNA_def_property(srna, "use_split_pattern", PROP_BOOLEAN, PROP_NONE);
2058 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_SPLIT_PATTERN);
2060 prop, "Use Split Pattern", "Enable chain splitting by dashed line patterns");
2061 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2062
2063 prop = RNA_def_property(srna, "split_dash1", PROP_INT, PROP_UNSIGNED);
2064 RNA_def_property_int_sdna(prop, nullptr, "split_dash1");
2065 RNA_def_property_range(prop, 0, USHRT_MAX);
2066 RNA_def_property_ui_text(prop, "Split Dash 1", "Length of the 1st dash for splitting");
2067 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2068
2069 prop = RNA_def_property(srna, "split_gap1", PROP_INT, PROP_UNSIGNED);
2070 RNA_def_property_int_sdna(prop, nullptr, "split_gap1");
2071 RNA_def_property_range(prop, 0, USHRT_MAX);
2072 RNA_def_property_ui_text(prop, "Split Gap 1", "Length of the 1st gap for splitting");
2073 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2074
2075 prop = RNA_def_property(srna, "split_dash2", PROP_INT, PROP_UNSIGNED);
2076 RNA_def_property_int_sdna(prop, nullptr, "split_dash2");
2077 RNA_def_property_range(prop, 0, USHRT_MAX);
2078 RNA_def_property_ui_text(prop, "Split Dash 2", "Length of the 2nd dash for splitting");
2079 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2080
2081 prop = RNA_def_property(srna, "split_gap2", PROP_INT, PROP_UNSIGNED);
2082 RNA_def_property_int_sdna(prop, nullptr, "split_gap2");
2083 RNA_def_property_range(prop, 0, USHRT_MAX);
2084 RNA_def_property_ui_text(prop, "Split Gap 2", "Length of the 2nd gap for splitting");
2085 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2086
2087 prop = RNA_def_property(srna, "split_dash3", PROP_INT, PROP_UNSIGNED);
2088 RNA_def_property_int_sdna(prop, nullptr, "split_dash3");
2089 RNA_def_property_range(prop, 0, USHRT_MAX);
2090 RNA_def_property_ui_text(prop, "Split Dash 3", "Length of the 3rd dash for splitting");
2091 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2092
2093 prop = RNA_def_property(srna, "split_gap3", PROP_INT, PROP_UNSIGNED);
2094 RNA_def_property_int_sdna(prop, nullptr, "split_gap3");
2095 RNA_def_property_range(prop, 0, USHRT_MAX);
2096 RNA_def_property_ui_text(prop, "Split Gap 3", "Length of the 3rd gap for splitting");
2097 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2098
2099 prop = RNA_def_property(srna, "material_boundary", PROP_BOOLEAN, PROP_NONE);
2102 "Material Boundary",
2103 "If true, chains of feature edges are split at material boundaries");
2104 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2105
2106 prop = RNA_def_property(srna, "use_sorting", PROP_BOOLEAN, PROP_NONE);
2108 RNA_def_property_ui_text(prop, "Sorting", "Arrange the stacking order of strokes");
2109 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2110
2111 prop = RNA_def_property(srna, "sort_key", PROP_ENUM, PROP_NONE);
2112 RNA_def_property_enum_sdna(prop, nullptr, "sort_key");
2113 RNA_def_property_enum_items(prop, sort_key_items);
2115 prop, "Sort Key", "Select the sort key to determine the stacking order of chains");
2116 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2117
2118 prop = RNA_def_property(srna, "sort_order", PROP_ENUM, PROP_NONE);
2119 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2120 RNA_def_property_enum_items(prop, sort_order_items);
2121 RNA_def_property_ui_text(prop, "Sort Order", "Select the sort order");
2122 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2123
2124 prop = RNA_def_property(srna, "integration_type", PROP_ENUM, PROP_NONE);
2125 RNA_def_property_enum_sdna(prop, nullptr, "integration_type");
2126 RNA_def_property_enum_items(prop, integration_type_items);
2128 prop, "Integration Type", "Select the way how the sort key is computed for each chain");
2129 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2130
2131 prop = RNA_def_property(srna, "use_dashed_line", PROP_BOOLEAN, PROP_NONE);
2132 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_DASHED_LINE);
2133 RNA_def_property_ui_text(prop, "Dashed Line", "Enable or disable dashed line");
2134 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2135
2136 prop = RNA_def_property(srna, "caps", PROP_ENUM, PROP_NONE);
2137 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "caps");
2138 RNA_def_property_enum_items(prop, cap_items);
2139 RNA_def_property_ui_text(prop, "Caps", "Select the shape of both ends of strokes");
2140 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2141
2142 prop = RNA_def_property(srna, "dash1", PROP_INT, PROP_UNSIGNED);
2143 RNA_def_property_int_sdna(prop, nullptr, "dash1");
2144 RNA_def_property_range(prop, 0, USHRT_MAX);
2145 RNA_def_property_ui_text(prop, "Dash 1", "Length of the 1st dash for dashed lines");
2146 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2147
2148 prop = RNA_def_property(srna, "gap1", PROP_INT, PROP_UNSIGNED);
2149 RNA_def_property_int_sdna(prop, nullptr, "gap1");
2150 RNA_def_property_range(prop, 0, USHRT_MAX);
2151 RNA_def_property_ui_text(prop, "Gap 1", "Length of the 1st gap for dashed lines");
2152 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2153
2154 prop = RNA_def_property(srna, "dash2", PROP_INT, PROP_UNSIGNED);
2155 RNA_def_property_int_sdna(prop, nullptr, "dash2");
2156 RNA_def_property_range(prop, 0, USHRT_MAX);
2157 RNA_def_property_ui_text(prop, "Dash 2", "Length of the 2nd dash for dashed lines");
2158 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2159
2160 prop = RNA_def_property(srna, "gap2", PROP_INT, PROP_UNSIGNED);
2161 RNA_def_property_int_sdna(prop, nullptr, "gap2");
2162 RNA_def_property_range(prop, 0, USHRT_MAX);
2163 RNA_def_property_ui_text(prop, "Gap 2", "Length of the 2nd gap for dashed lines");
2164 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2165
2166 prop = RNA_def_property(srna, "dash3", PROP_INT, PROP_UNSIGNED);
2167 RNA_def_property_int_sdna(prop, nullptr, "dash3");
2168 RNA_def_property_range(prop, 0, USHRT_MAX);
2169 RNA_def_property_ui_text(prop, "Dash 3", "Length of the 3rd dash for dashed lines");
2170 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2171
2172 prop = RNA_def_property(srna, "gap3", PROP_INT, PROP_UNSIGNED);
2173 RNA_def_property_int_sdna(prop, nullptr, "gap3");
2174 RNA_def_property_range(prop, 0, USHRT_MAX);
2175 RNA_def_property_ui_text(prop, "Gap 3", "Length of the 3rd gap for dashed lines");
2176 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2177
2178 prop = RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE);
2179 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_TEXTURE);
2180 RNA_def_property_ui_text(prop, "Use Textures", "Enable or disable textured strokes");
2181 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2182
2183 prop = RNA_def_property(srna, "texture_spacing", PROP_FLOAT, PROP_FACTOR);
2184 RNA_def_property_float_sdna(prop, nullptr, "texstep");
2185 RNA_def_property_range(prop, 0.01f, 100.0f);
2186 RNA_def_property_ui_text(prop, "Texture Spacing", "Spacing for textures along stroke length");
2187 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2188
2189 /* anim */
2191
2192 /* nodes */
2193 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
2194 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
2197 RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based shaders");
2198
2199 prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
2200 RNA_def_property_boolean_sdna(prop, nullptr, "use_nodes", 1);
2203 RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes for the line style");
2204 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_use_nodes_update");
2205}
2206
2213
2214#endif
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
Blender kernel freestyle line style functionality.
int BKE_linestyle_alpha_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier)
int BKE_linestyle_color_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier)
Definition linestyle.cc:921
LineStyleModifier * BKE_linestyle_geometry_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type)
void BKE_linestyle_default_shader(const struct bContext *C, FreestyleLineStyle *linestyle)
LineStyleModifier * BKE_linestyle_alpha_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type)
Definition linestyle.cc:991
LineStyleModifier * BKE_linestyle_color_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type)
Definition linestyle.cc:771
int BKE_linestyle_thickness_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier)
LineStyleModifier * BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type)
int BKE_linestyle_geometry_modifier_remove(FreestyleLineStyle *linestyle, LineStyleModifier *modifier)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
struct Tex * give_current_linestyle_texture(struct FreestyleLineStyle *linestyle)
Definition texture.cc:456
void set_current_linestyle_texture(struct FreestyleLineStyle *linestyle, struct Tex *tex)
Definition texture.cc:471
#define DEG2RADF(_deg)
size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
#define STRNCPY_UTF8(dst, src)
void BLI_uniquename(const struct ListBase *list, void *vlink, const char *defname, char delim, int name_offset, size_t name_maxncpy) ATTR_NONNULL(1
#define BLT_I18NCONTEXT_ID_FREESTYLELINESTYLE
#define BLT_I18NCONTEXT_ID_IMAGE
#define BLT_I18NCONTEXT_ID_TEXTURE
void DEG_id_tag_update(ID *id, unsigned int flags)
@ LS_MIN_2D_LENGTH
@ LS_SAME_OBJECT
@ LS_DASHED_LINE
@ LS_MIN_2D_ANGLE
@ LS_CHAIN_COUNT
@ LS_NO_SORTING
@ LS_SPLIT_LENGTH
@ LS_SPLIT_PATTERN
@ LS_MAX_2D_ANGLE
@ LS_REVERSE_ORDER
@ LS_MAX_2D_LENGTH
@ LS_NO_CHAINING
@ LS_MATERIAL_BOUNDARY
@ LS_MODIFIER_USE_RAMP
@ LS_SORT_KEY_PROJECTED_X
@ LS_SORT_KEY_2D_LENGTH
@ LS_SORT_KEY_DISTANCE_FROM_CAMERA
@ LS_SORT_KEY_PROJECTED_Y
@ LS_THICKNESS_ASYMMETRIC
#define TEXCO_STROKE
@ LS_CHAINING_SKETCHY
@ LS_CHAINING_PLAIN
@ LS_MODIFIER_MATERIAL_SPEC_B
@ LS_MODIFIER_MATERIAL_SPEC_G
@ LS_MODIFIER_MATERIAL_DIFF_G
@ LS_MODIFIER_MATERIAL_DIFF_B
@ LS_MODIFIER_MATERIAL_SPEC_R
@ LS_MODIFIER_MATERIAL_LINE_G
@ LS_MODIFIER_MATERIAL_LINE_R
@ LS_MODIFIER_MATERIAL_LINE_B
@ LS_MODIFIER_MATERIAL_LINE
@ LS_MODIFIER_MATERIAL_ALPHA
@ LS_MODIFIER_MATERIAL_SPEC
@ LS_MODIFIER_MATERIAL_DIFF_R
@ LS_MODIFIER_MATERIAL_LINE_A
@ LS_MODIFIER_MATERIAL_DIFF
@ LS_MODIFIER_MATERIAL_SPEC_HARD
@ LS_MODIFIER_SAMPLING
@ LS_MODIFIER_BEZIER_CURVE
@ LS_MODIFIER_NOISE
@ LS_MODIFIER_BACKBONE_STRETCHER
@ LS_MODIFIER_SPATIAL_NOISE
@ LS_MODIFIER_PERLIN_NOISE_2D
@ LS_MODIFIER_POLYGONIZATION
@ LS_MODIFIER_GUIDING_LINES
@ LS_MODIFIER_SIMPLIFICATION
@ LS_MODIFIER_TANGENT
@ LS_MODIFIER_CREASE_ANGLE
@ LS_MODIFIER_2D_TRANSFORM
@ LS_MODIFIER_DISTANCE_FROM_OBJECT
@ LS_MODIFIER_BLUEPRINT
@ LS_MODIFIER_CALLIGRAPHY
@ LS_MODIFIER_CURVATURE_3D
@ LS_MODIFIER_SINUS_DISPLACEMENT
@ LS_MODIFIER_ALONG_STROKE
@ LS_MODIFIER_MATERIAL
@ LS_MODIFIER_DISTANCE_FROM_CAMERA
@ LS_MODIFIER_PERLIN_NOISE_1D
@ LS_MODIFIER_2D_OFFSET
@ LS_MODIFIER_TIP_REMOVER
@ LS_MODIFIER_INVERT
@ LS_MODIFIER_USE_CURVE
@ LS_VALUE_MULT
@ LS_VALUE_SUB
@ LS_VALUE_BLEND
@ LS_VALUE_DIFF
@ LS_VALUE_ADD
@ LS_VALUE_MIN
@ LS_VALUE_DIV
@ LS_VALUE_MAX
@ LS_MODIFIER_BLUEPRINT_SQUARES
@ LS_MODIFIER_BLUEPRINT_CIRCLES
@ LS_MODIFIER_BLUEPRINT_ELLIPSES
@ LS_THICKNESS_RELATIVE
@ LS_THICKNESS_CENTER
@ LS_THICKNESS_INSIDE
@ LS_THICKNESS_OUTSIDE
@ LS_MODIFIER_2D_TRANSFORM_PIVOT_PARAM
@ LS_MODIFIER_2D_TRANSFORM_PIVOT_START
@ LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER
@ LS_MODIFIER_2D_TRANSFORM_PIVOT_ABSOLUTE
@ LS_MODIFIER_2D_TRANSFORM_PIVOT_END
@ LS_MODIFIER_SPATIAL_NOISE_PURERANDOM
@ LS_MODIFIER_SPATIAL_NOISE_SMOOTH
@ LS_INTEGRATION_MEAN
@ LS_INTEGRATION_FIRST
@ LS_INTEGRATION_MAX
@ LS_INTEGRATION_LAST
@ LS_INTEGRATION_MIN
@ LS_CAPS_SQUARE
@ LS_CAPS_BUTT
@ LS_CAPS_ROUND
@ LS_PANEL_GEOMETRY
@ LS_PANEL_STROKES
@ LS_PANEL_ALPHA
@ LS_PANEL_TEXTURE
@ LS_PANEL_MISC
@ LS_PANEL_COLOR
@ LS_PANEL_THICKNESS
@ LS_MODIFIER_EXPANDED
@ LS_MODIFIER_ENABLED
@ TEXCO_WINDOW
@ TEXCO_ORCO
@ TEXCO_GLOB
@ MAP_ALPHA
@ MTEX_FLAT
@ MTEX_SPHERE
@ MTEX_CUBE
@ MTEX_TUBE
#define RNA_POINTER_INVALIDATE(ptr)
ParameterFlag
Definition RNA_types.hh:396
@ PARM_RNAPTR
Definition RNA_types.hh:399
@ PARM_REQUIRED
Definition RNA_types.hh:397
@ FUNC_USE_REPORTS
Definition RNA_types.hh:680
@ PROP_FLOAT
Definition RNA_types.hh:67
@ PROP_BOOLEAN
Definition RNA_types.hh:65
@ PROP_ENUM
Definition RNA_types.hh:69
@ PROP_INT
Definition RNA_types.hh:66
@ PROP_STRING
Definition RNA_types.hh:68
@ PROP_POINTER
Definition RNA_types.hh:70
@ PROP_COLLECTION
Definition RNA_types.hh:71
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:355
PropertyFlag
Definition RNA_types.hh:201
@ PROP_THICK_WRAP
Definition RNA_types.hh:312
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:296
@ PROP_ANIMATABLE
Definition RNA_types.hh:220
@ PROP_PROPORTIONAL
Definition RNA_types.hh:250
@ PROP_EDITABLE
Definition RNA_types.hh:207
@ PROP_NEVER_NULL
Definition RNA_types.hh:266
@ PROP_PTR_NO_OWNERSHIP
Definition RNA_types.hh:284
@ PROP_DISTANCE
Definition RNA_types.hh:159
@ PROP_COLOR
Definition RNA_types.hh:163
@ PROP_ANGLE
Definition RNA_types.hh:155
@ PROP_NONE
Definition RNA_types.hh:136
@ PROP_FACTOR
Definition RNA_types.hh:154
@ PROP_UNSIGNED
Definition RNA_types.hh:152
#define MAX_MTEX
Definition Stroke.h:33
#define NC_LINESTYLE
Definition WM_types.hh:367
FreestyleLineStyle linestyle
#define offsetof(t, d)
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA rna_pointer_inherit_refine(const PointerRNA *ptr, StructRNA *type, void *data)
void rna_def_animdata_common(StructRNA *srna)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
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)
static void rna_def_modifier_color_ramp_common(StructRNA *srna, int range)
static void rna_def_linestyle_mtex(BlenderRNA *brna)
static void rna_def_modifier_material_common(StructRNA *srna)
const EnumPropertyItem rna_enum_linestyle_thickness_modifier_type_items[]
static void rna_def_geometry_modifier(StructRNA *srna)
const EnumPropertyItem rna_enum_linestyle_geometry_modifier_type_items[]
static void rna_def_linestyle_modifiers(BlenderRNA *brna)
void RNA_def_linestyle(BlenderRNA *brna)
static void rna_def_color_modifier(StructRNA *srna)
static void rna_def_freestyle_color_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_freestyle_thickness_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_thickness_modifier(StructRNA *srna)
static void rna_def_modifier_type_common(StructRNA *srna, const EnumPropertyItem *modifier_type_items, const bool blend, const bool color)
static void rna_def_linestyle(BlenderRNA *brna)
static void rna_def_freestyle_alpha_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_alpha_modifier(StructRNA *srna)
const EnumPropertyItem rna_enum_linestyle_color_modifier_type_items[]
static void rna_def_modifier_curve_common(StructRNA *srna, bool range, bool value)
static void rna_def_freestyle_geometry_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
const EnumPropertyItem rna_enum_linestyle_alpha_modifier_type_items[]
const EnumPropertyItem rna_enum_ramp_blend_items[]
#define FLT_MAX
Definition stdcycles.h:14
struct bNodeTree * nodetree
struct MTex * mtex[18]
ID * owner_id
Definition RNA_types.hh:40
void * data
Definition RNA_types.hh:42
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126