Blender V5.0
rna_linestyle.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include <cstdlib>
10
11#include "BLI_math_rotation.h"
12
13#include "BLT_translation.hh"
14
15#include "RNA_define.hh"
16#include "RNA_enum_types.hh"
17
18#include "rna_internal.hh"
19
20#include "DNA_linestyle_types.h"
21#include "DNA_material_types.h"
22#include "DNA_texture_types.h"
23
24#include "WM_api.hh"
25#include "WM_types.hh"
26
28 {LS_MODIFIER_ALONG_STROKE, "ALONG_STROKE", ICON_MODIFIER, "Along Stroke", ""},
29 {LS_MODIFIER_CREASE_ANGLE, "CREASE_ANGLE", ICON_MODIFIER, "Crease Angle", ""},
30 {LS_MODIFIER_CURVATURE_3D, "CURVATURE_3D", ICON_MODIFIER, "Curvature 3D", ""},
32 "DISTANCE_FROM_CAMERA",
33 ICON_MODIFIER,
34 "Distance from Camera",
35 ""},
37 "DISTANCE_FROM_OBJECT",
38 ICON_MODIFIER,
39 "Distance from Object",
40 ""},
41 {LS_MODIFIER_MATERIAL, "MATERIAL", ICON_MODIFIER, "Material", ""},
42 {LS_MODIFIER_NOISE, "NOISE", ICON_MODIFIER, "Noise", ""},
43 {LS_MODIFIER_TANGENT, "TANGENT", ICON_MODIFIER, "Tangent", ""},
44 {0, nullptr, 0, nullptr, nullptr},
45};
46
48 {LS_MODIFIER_ALONG_STROKE, "ALONG_STROKE", ICON_MODIFIER, "Along Stroke", ""},
49 {LS_MODIFIER_CREASE_ANGLE, "CREASE_ANGLE", ICON_MODIFIER, "Crease Angle", ""},
50 {LS_MODIFIER_CURVATURE_3D, "CURVATURE_3D", ICON_MODIFIER, "Curvature 3D", ""},
52 "DISTANCE_FROM_CAMERA",
53 ICON_MODIFIER,
54 "Distance from Camera",
55 ""},
57 "DISTANCE_FROM_OBJECT",
58 ICON_MODIFIER,
59 "Distance from Object",
60 ""},
61 {LS_MODIFIER_MATERIAL, "MATERIAL", ICON_MODIFIER, "Material", ""},
62 {LS_MODIFIER_NOISE, "NOISE", ICON_MODIFIER, "Noise", ""},
63 {LS_MODIFIER_TANGENT, "TANGENT", ICON_MODIFIER, "Tangent", ""},
64 {0, nullptr, 0, nullptr, nullptr},
65};
66
68 {LS_MODIFIER_ALONG_STROKE, "ALONG_STROKE", ICON_MODIFIER, "Along Stroke", ""},
69 {LS_MODIFIER_CALLIGRAPHY, "CALLIGRAPHY", ICON_MODIFIER, "Calligraphy", ""},
70 {LS_MODIFIER_CREASE_ANGLE, "CREASE_ANGLE", ICON_MODIFIER, "Crease Angle", ""},
71 {LS_MODIFIER_CURVATURE_3D, "CURVATURE_3D", ICON_MODIFIER, "Curvature 3D", ""},
73 "DISTANCE_FROM_CAMERA",
74 ICON_MODIFIER,
75 "Distance from Camera",
76 ""},
78 "DISTANCE_FROM_OBJECT",
79 ICON_MODIFIER,
80 "Distance from Object",
81 ""},
82 {LS_MODIFIER_MATERIAL, "MATERIAL", ICON_MODIFIER, "Material", ""},
83 {LS_MODIFIER_NOISE, "NOISE", ICON_MODIFIER, "Noise", ""},
84 {LS_MODIFIER_TANGENT, "TANGENT", ICON_MODIFIER, "Tangent", ""},
85 {0, nullptr, 0, nullptr, nullptr},
86};
87
89 {LS_MODIFIER_2D_OFFSET, "2D_OFFSET", ICON_MODIFIER, "2D Offset", ""},
90 {LS_MODIFIER_2D_TRANSFORM, "2D_TRANSFORM", ICON_MODIFIER, "2D Transform", ""},
92 "BACKBONE_STRETCHER",
93 ICON_MODIFIER,
94 "Backbone Stretcher",
95 ""},
96 {LS_MODIFIER_BEZIER_CURVE, "BEZIER_CURVE", ICON_MODIFIER, "Bézier Curve", ""},
97 {LS_MODIFIER_BLUEPRINT, "BLUEPRINT", ICON_MODIFIER, "Blueprint", ""},
98 {LS_MODIFIER_GUIDING_LINES, "GUIDING_LINES", ICON_MODIFIER, "Guiding Lines", ""},
99 {LS_MODIFIER_PERLIN_NOISE_1D, "PERLIN_NOISE_1D", ICON_MODIFIER, "Perlin Noise 1D", ""},
100 {LS_MODIFIER_PERLIN_NOISE_2D, "PERLIN_NOISE_2D", ICON_MODIFIER, "Perlin Noise 2D", ""},
101 {LS_MODIFIER_POLYGONIZATION, "POLYGONIZATION", ICON_MODIFIER, "Polygonization", ""},
102 {LS_MODIFIER_SAMPLING, "SAMPLING", ICON_MODIFIER, "Sampling", ""},
103 {LS_MODIFIER_SIMPLIFICATION, "SIMPLIFICATION", ICON_MODIFIER, "Simplification", ""},
105 "SINUS_DISPLACEMENT",
106 ICON_MODIFIER,
107 "Sinus Displacement",
108 ""},
109 {LS_MODIFIER_SPATIAL_NOISE, "SPATIAL_NOISE", ICON_MODIFIER, "Spatial Noise", ""},
110 {LS_MODIFIER_TIP_REMOVER, "TIP_REMOVER", ICON_MODIFIER, "Tip Remover", ""},
111 {0, nullptr, 0, nullptr, nullptr},
112};
113
114#ifdef RNA_RUNTIME
115
116# include <fmt/format.h>
117
118# include "BLI_string_utils.hh"
119
120# include "BKE_linestyle.h"
121# include "BKE_texture.h"
122
123# include "DEG_depsgraph.hh"
124
125# include "ED_node.hh"
126
127# include "RNA_access.hh"
128
129static StructRNA *rna_LineStyle_color_modifier_refine(PointerRNA *ptr)
130{
132
133 switch (m->type) {
135 return &RNA_LineStyleColorModifier_AlongStroke;
137 return &RNA_LineStyleColorModifier_DistanceFromCamera;
139 return &RNA_LineStyleColorModifier_DistanceFromObject;
141 return &RNA_LineStyleColorModifier_Material;
143 return &RNA_LineStyleColorModifier_Tangent;
145 return &RNA_LineStyleColorModifier_Noise;
147 return &RNA_LineStyleColorModifier_CreaseAngle;
149 return &RNA_LineStyleColorModifier_Curvature_3D;
150 default:
151 return &RNA_LineStyleColorModifier;
152 }
153}
154
155static StructRNA *rna_LineStyle_alpha_modifier_refine(PointerRNA *ptr)
156{
158
159 switch (m->type) {
161 return &RNA_LineStyleAlphaModifier_AlongStroke;
163 return &RNA_LineStyleAlphaModifier_DistanceFromCamera;
165 return &RNA_LineStyleAlphaModifier_DistanceFromObject;
167 return &RNA_LineStyleAlphaModifier_Material;
169 return &RNA_LineStyleAlphaModifier_Tangent;
171 return &RNA_LineStyleAlphaModifier_Noise;
173 return &RNA_LineStyleAlphaModifier_CreaseAngle;
175 return &RNA_LineStyleAlphaModifier_Curvature_3D;
176 default:
177 return &RNA_LineStyleAlphaModifier;
178 }
179}
180
181static StructRNA *rna_LineStyle_thickness_modifier_refine(PointerRNA *ptr)
182{
184
185 switch (m->type) {
187 return &RNA_LineStyleThicknessModifier_AlongStroke;
189 return &RNA_LineStyleThicknessModifier_DistanceFromCamera;
191 return &RNA_LineStyleThicknessModifier_DistanceFromObject;
193 return &RNA_LineStyleThicknessModifier_Material;
195 return &RNA_LineStyleThicknessModifier_Calligraphy;
197 return &RNA_LineStyleThicknessModifier_Tangent;
199 return &RNA_LineStyleThicknessModifier_Noise;
201 return &RNA_LineStyleThicknessModifier_CreaseAngle;
203 return &RNA_LineStyleThicknessModifier_Curvature_3D;
204 default:
205 return &RNA_LineStyleThicknessModifier;
206 }
207}
208
209static StructRNA *rna_LineStyle_geometry_modifier_refine(PointerRNA *ptr)
210{
212
213 switch (m->type) {
215 return &RNA_LineStyleGeometryModifier_Sampling;
217 return &RNA_LineStyleGeometryModifier_BezierCurve;
219 return &RNA_LineStyleGeometryModifier_SinusDisplacement;
221 return &RNA_LineStyleGeometryModifier_SpatialNoise;
223 return &RNA_LineStyleGeometryModifier_PerlinNoise1D;
225 return &RNA_LineStyleGeometryModifier_PerlinNoise2D;
227 return &RNA_LineStyleGeometryModifier_BackboneStretcher;
229 return &RNA_LineStyleGeometryModifier_TipRemover;
231 return &RNA_LineStyleGeometryModifier_Polygonalization;
233 return &RNA_LineStyleGeometryModifier_GuidingLines;
235 return &RNA_LineStyleGeometryModifier_Blueprint;
237 return &RNA_LineStyleGeometryModifier_2DOffset;
239 return &RNA_LineStyleGeometryModifier_2DTransform;
241 return &RNA_LineStyleGeometryModifier_Simplification;
242 default:
243 return &RNA_LineStyleGeometryModifier;
244 }
245}
246
247static std::optional<std::string> rna_LineStyle_color_modifier_path(const PointerRNA *ptr)
248{
249 const LineStyleModifier *m = (LineStyleModifier *)ptr->data;
250 char name_esc[sizeof(m->name) * 2];
251 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
252 return fmt::format("color_modifiers[\"{}\"]", name_esc);
253}
254
255static std::optional<std::string> rna_LineStyle_alpha_modifier_path(const PointerRNA *ptr)
256{
257 const LineStyleModifier *m = (LineStyleModifier *)ptr->data;
258 char name_esc[sizeof(m->name) * 2];
259 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
260 return fmt::format("alpha_modifiers[\"{}\"]", name_esc);
261}
262
263static std::optional<std::string> rna_LineStyle_thickness_modifier_path(const PointerRNA *ptr)
264{
265 const LineStyleModifier *m = (LineStyleModifier *)ptr->data;
266 char name_esc[sizeof(m->name) * 2];
267 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
268 return fmt::format("thickness_modifiers[\"{}\"]", name_esc);
269}
270
271static std::optional<std::string> rna_LineStyle_geometry_modifier_path(const PointerRNA *ptr)
272{
273 const LineStyleModifier *m = (LineStyleModifier *)ptr->data;
274 char name_esc[sizeof(m->name) * 2];
275 BLI_str_escape(name_esc, m->name, sizeof(name_esc));
276 return fmt::format("geometry_modifiers[\"{}\"]", name_esc);
277}
278
279static void rna_LineStyleColorModifier_name_set(PointerRNA *ptr, const char *value)
280{
281 FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id;
283
284 STRNCPY_UTF8(m->name, value);
285 BLI_uniquename(&linestyle->color_modifiers,
286 m,
287 "ColorModifier",
288 '.',
290 sizeof(m->name));
291}
292
293static void rna_LineStyleAlphaModifier_name_set(PointerRNA *ptr, const char *value)
294{
295 FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id;
297
298 STRNCPY_UTF8(m->name, value);
299 BLI_uniquename(&linestyle->alpha_modifiers,
300 m,
301 "AlphaModifier",
302 '.',
304 sizeof(m->name));
305}
306
307static void rna_LineStyleThicknessModifier_name_set(PointerRNA *ptr, const char *value)
308{
309 FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id;
311
312 STRNCPY_UTF8(m->name, value);
313 BLI_uniquename(&linestyle->thickness_modifiers,
314 m,
315 "ThicknessModifier",
316 '.',
318 sizeof(m->name));
319}
320
321static void rna_LineStyleGeometryModifier_name_set(PointerRNA *ptr, const char *value)
322{
323 FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id;
325
326 STRNCPY_UTF8(m->name, value);
327 BLI_uniquename(&linestyle->geometry_modifiers,
328 m,
329 "GeometryModifier",
330 '.',
332 sizeof(m->name));
333}
334
335static void rna_LineStyle_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
336{
337 FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id;
339 iter, ptr, (void *)linestyle->mtex, sizeof(MTex *), MAX_MTEX, 0, nullptr);
340}
341
342static PointerRNA rna_LineStyle_active_texture_get(PointerRNA *ptr)
343{
344 FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id;
345 Tex *tex;
346
347 tex = give_current_linestyle_texture(linestyle);
348 return RNA_id_pointer_create(reinterpret_cast<ID *>(tex));
349}
350
351static void rna_LineStyle_active_texture_set(PointerRNA *ptr,
352 PointerRNA value,
353 ReportList * /*reports*/)
354{
355 FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id;
356
357 set_current_linestyle_texture(linestyle, static_cast<Tex *>(value.data));
358}
359
360static void rna_LineStyle_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
361{
362 FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->owner_id;
363
364 DEG_id_tag_update(&linestyle->id, 0);
366}
367
368static void rna_LineStyle_use_nodes_update(bContext *C, PointerRNA *ptr)
369{
370 FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->data;
371
372 if (linestyle->use_nodes && linestyle->nodetree == nullptr) {
374 }
375
376 rna_LineStyle_update(CTX_data_main(C), CTX_data_scene(C), ptr);
377}
378
379static LineStyleModifier *rna_LineStyle_color_modifier_add(FreestyleLineStyle *linestyle,
380 ReportList *reports,
381 const char *name,
382 int type)
383{
384 LineStyleModifier *modifier = BKE_linestyle_color_modifier_add(linestyle, name, type);
385
386 if (!modifier) {
387 BKE_report(reports, RPT_ERROR, "Failed to add the color modifier");
388 return nullptr;
389 }
390
391 DEG_id_tag_update(&linestyle->id, 0);
393
394 return modifier;
395}
396
397static void rna_LineStyle_color_modifier_remove(FreestyleLineStyle *linestyle,
398 ReportList *reports,
399 PointerRNA *modifier_ptr)
400{
401 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
402
403 if (BKE_linestyle_color_modifier_remove(linestyle, modifier) == -1) {
404 BKE_reportf(reports, RPT_ERROR, "Color modifier '%s' could not be removed", modifier->name);
405 return;
406 }
407
408 modifier_ptr->invalidate();
409
410 DEG_id_tag_update(&linestyle->id, 0);
412}
413
414static LineStyleModifier *rna_LineStyle_alpha_modifier_add(FreestyleLineStyle *linestyle,
415 ReportList *reports,
416 const char *name,
417 int type)
418{
419 LineStyleModifier *modifier = BKE_linestyle_alpha_modifier_add(linestyle, name, type);
420
421 if (!modifier) {
422 BKE_report(reports, RPT_ERROR, "Failed to add the alpha modifier");
423 return nullptr;
424 }
425
426 DEG_id_tag_update(&linestyle->id, 0);
428
429 return modifier;
430}
431
432static void rna_LineStyle_alpha_modifier_remove(FreestyleLineStyle *linestyle,
433 ReportList *reports,
434 PointerRNA *modifier_ptr)
435{
436 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
437
438 if (BKE_linestyle_alpha_modifier_remove(linestyle, modifier) == -1) {
439 BKE_reportf(reports, RPT_ERROR, "Alpha modifier '%s' could not be removed", modifier->name);
440 return;
441 }
442
443 modifier_ptr->invalidate();
444
445 DEG_id_tag_update(&linestyle->id, 0);
447}
448
449static LineStyleModifier *rna_LineStyle_thickness_modifier_add(FreestyleLineStyle *linestyle,
450 ReportList *reports,
451 const char *name,
452 int type)
453{
454 LineStyleModifier *modifier = BKE_linestyle_thickness_modifier_add(linestyle, name, type);
455
456 if (!modifier) {
457 BKE_report(reports, RPT_ERROR, "Failed to add the thickness modifier");
458 return nullptr;
459 }
460
461 DEG_id_tag_update(&linestyle->id, 0);
463
464 return modifier;
465}
466
467static void rna_LineStyle_thickness_modifier_remove(FreestyleLineStyle *linestyle,
468 ReportList *reports,
469 PointerRNA *modifier_ptr)
470{
471 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
472
473 if (BKE_linestyle_thickness_modifier_remove(linestyle, modifier) == -1) {
475 reports, RPT_ERROR, "Thickness modifier '%s' could not be removed", modifier->name);
476 return;
477 }
478
479 modifier_ptr->invalidate();
480
481 DEG_id_tag_update(&linestyle->id, 0);
483}
484
485static LineStyleModifier *rna_LineStyle_geometry_modifier_add(FreestyleLineStyle *linestyle,
486 ReportList *reports,
487 const char *name,
488 int type)
489{
490 LineStyleModifier *modifier = BKE_linestyle_geometry_modifier_add(linestyle, name, type);
491
492 if (!modifier) {
493 BKE_report(reports, RPT_ERROR, "Failed to add the geometry modifier");
494 return nullptr;
495 }
496
497 DEG_id_tag_update(&linestyle->id, 0);
499
500 return modifier;
501}
502
503static void rna_LineStyle_geometry_modifier_remove(FreestyleLineStyle *linestyle,
504 ReportList *reports,
505 PointerRNA *modifier_ptr)
506{
507 LineStyleModifier *modifier = static_cast<LineStyleModifier *>(modifier_ptr->data);
508
509 if (BKE_linestyle_geometry_modifier_remove(linestyle, modifier) == -1) {
510 BKE_reportf(reports, RPT_ERROR, "Geometry modifier '%s' could not be removed", modifier->name);
511 return;
512 }
513
514 modifier_ptr->invalidate();
515
516 DEG_id_tag_update(&linestyle->id, 0);
518}
519
520#else
521
523{
524 StructRNA *srna;
525 PropertyRNA *prop;
526
527 static const EnumPropertyItem texco_items[] = {
528 {TEXCO_WINDOW, "WINDOW", 0, "Window", "Use screen coordinates as texture coordinates"},
529 {TEXCO_GLOB, "GLOBAL", 0, "Global", "Use global coordinates for the texture coordinates"},
531 "ALONG_STROKE",
532 0,
533 "Along stroke",
534 "Use stroke length for texture coordinates"},
535 {TEXCO_ORCO,
536 "ORCO",
537 0,
538 "Generated",
539 "Use the original undeformed coordinates of the object"},
540 {0, nullptr, 0, nullptr, nullptr},
541 };
542
543 static const EnumPropertyItem prop_mapping_items[] = {
544 {MTEX_FLAT, "FLAT", 0, "Flat", "Map X and Y coordinates directly"},
545 {MTEX_CUBE, "CUBE", 0, "Cube", "Map using the normal vector"},
546 {MTEX_TUBE, "TUBE", 0, "Tube", "Map with Z as central axis"},
547 {MTEX_SPHERE, "SPHERE", 0, "Sphere", "Map with Z as central axis"},
548 {0, nullptr, 0, nullptr, nullptr},
549 };
550
551 static const EnumPropertyItem prop_x_mapping_items[] = {
552 {0, "NONE", 0, "None", ""},
553 {1, "X", 0, "X", ""},
554 {2, "Y", 0, "Y", ""},
555 {3, "Z", 0, "Z", ""},
556 {0, nullptr, 0, nullptr, nullptr},
557 };
558
559 static const EnumPropertyItem prop_y_mapping_items[] = {
560 {0, "NONE", 0, "None", ""},
561 {1, "X", 0, "X", ""},
562 {2, "Y", 0, "Y", ""},
563 {3, "Z", 0, "Z", ""},
564 {0, nullptr, 0, nullptr, nullptr},
565 };
566
567 static const EnumPropertyItem prop_z_mapping_items[] = {
568 {0, "NONE", 0, "None", ""},
569 {1, "X", 0, "X", ""},
570 {2, "Y", 0, "Y", ""},
571 {3, "Z", 0, "Z", ""},
572 {0, nullptr, 0, nullptr, nullptr},
573 };
574
575 srna = RNA_def_struct(brna, "LineStyleTextureSlot", "TextureSlot");
576 RNA_def_struct_sdna(srna, "MTex");
578 srna, "LineStyle Texture Slot", "Texture slot for textures in a LineStyle data-block");
579
580 prop = RNA_def_property(srna, "mapping_x", PROP_ENUM, PROP_NONE);
581 RNA_def_property_enum_sdna(prop, nullptr, "projx");
582 RNA_def_property_enum_items(prop, prop_x_mapping_items);
583 RNA_def_property_ui_text(prop, "X Mapping", "");
584 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
585
586 prop = RNA_def_property(srna, "mapping_y", PROP_ENUM, PROP_NONE);
587 RNA_def_property_enum_sdna(prop, nullptr, "projy");
588 RNA_def_property_enum_items(prop, prop_y_mapping_items);
589 RNA_def_property_ui_text(prop, "Y Mapping", "");
590 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
591
592 prop = RNA_def_property(srna, "mapping_z", PROP_ENUM, PROP_NONE);
593 RNA_def_property_enum_sdna(prop, nullptr, "projz");
594 RNA_def_property_enum_items(prop, prop_z_mapping_items);
595 RNA_def_property_ui_text(prop, "Z Mapping", "");
596 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
597
598 prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
599 RNA_def_property_enum_items(prop, prop_mapping_items);
600 RNA_def_property_ui_text(prop, "Mapping", "");
602 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
603
604 /* map to */
605 prop = RNA_def_property(srna, "use_map_color_diffuse", PROP_BOOLEAN, PROP_NONE);
606 RNA_def_property_boolean_sdna(prop, nullptr, "mapto", MAP_COL);
607 RNA_def_property_ui_text(prop, "Diffuse Color", "The texture affects basic color of the stroke");
608 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
609
610 prop = RNA_def_property(srna, "use_map_alpha", PROP_BOOLEAN, PROP_NONE);
611 RNA_def_property_boolean_sdna(prop, nullptr, "mapto", MAP_ALPHA);
612 RNA_def_property_ui_text(prop, "Alpha", "The texture affects the alpha value");
613 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
614
615 prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
616 RNA_def_property_enum_sdna(prop, nullptr, "texco");
617 RNA_def_property_enum_items(prop, texco_items);
620 "Texture Coordinates",
621 "Texture coordinates used to map the texture onto the background");
622 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
623
624 prop = RNA_def_property(srna, "alpha_factor", PROP_FLOAT, PROP_NONE);
625 RNA_def_property_float_sdna(prop, nullptr, "alphafac");
626 RNA_def_property_ui_range(prop, -1, 1, 10, 3);
627 RNA_def_property_ui_text(prop, "Alpha Factor", "Amount texture affects alpha");
628 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
629
630 prop = RNA_def_property(srna, "diffuse_color_factor", PROP_FLOAT, PROP_NONE);
631 RNA_def_property_float_sdna(prop, nullptr, "colfac");
632 RNA_def_property_ui_range(prop, 0, 1, 10, 3);
633 RNA_def_property_ui_text(prop, "Diffuse Color Factor", "Amount texture affects diffuse color");
634 RNA_def_property_update(prop, 0, "rna_LineStyle_update");
635}
636
638 const EnumPropertyItem *modifier_type_items,
639 const bool blend,
640 const bool color)
641{
642 PropertyRNA *prop;
643
644 /* TODO: Check this is not already defined somewhere else, e.g. in nodes... */
645 static const EnumPropertyItem value_blend_items[] = {
646 {LS_VALUE_BLEND, "MIX", 0, "Mix", ""},
647 {LS_VALUE_ADD, "ADD", 0, "Add", ""},
648 {LS_VALUE_SUB, "SUBTRACT", 0, "Subtract", ""},
649 {LS_VALUE_MULT, "MULTIPLY", 0, "Multiply", ""},
650 {LS_VALUE_DIV, "DIVIDE", 0, "Divide", ""},
651 {LS_VALUE_DIFF, "DIFFERENCE", 0, "Difference", ""},
652 {LS_VALUE_MIN, "MINIMUM", 0, "Minimum", ""},
653 {LS_VALUE_MAX, "MAXIMUM", 0, "Maximum", ""},
654 {0, nullptr, 0, nullptr, nullptr},
655 };
656
657 prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
658 RNA_def_property_enum_sdna(prop, nullptr, "modifier.type");
659 RNA_def_property_enum_items(prop, modifier_type_items);
661 RNA_def_property_ui_text(prop, "Modifier Type", "Type of the modifier");
662
663 if (blend) {
664 prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
665 RNA_def_property_enum_sdna(prop, nullptr, "modifier.blend");
666 RNA_def_property_enum_items(prop, (color) ? rna_enum_ramp_blend_items : value_blend_items);
668 prop, "Blend", "Specify how the modifier value is blended into the base value");
669 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
670
671 prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
672 RNA_def_property_float_sdna(prop, nullptr, "modifier.influence");
673 RNA_def_property_range(prop, 0.0f, 1.0f);
675 prop, "Influence", "Influence factor by which the modifier changes the property");
676 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
677 }
678
679 prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
680 RNA_def_property_boolean_sdna(prop, nullptr, "modifier.flags", LS_MODIFIER_ENABLED);
681 RNA_def_property_ui_text(prop, "Use", "Enable or disable this modifier during stroke rendering");
682 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
683
684 prop = RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
685 RNA_def_property_boolean_sdna(prop, nullptr, "modifier.flags", LS_MODIFIER_EXPANDED);
686 RNA_def_property_ui_text(prop, "Expanded", "True if the modifier tab is expanded");
687}
688
693
698
704
710
712{
713 PropertyRNA *prop;
714
715 prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NONE);
716 RNA_def_property_pointer_sdna(prop, nullptr, "color_ramp");
717 RNA_def_property_struct_type(prop, "ColorRamp");
718 RNA_def_property_ui_text(prop, "Color Ramp", "Color ramp used to change line color");
719 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
720
721 if (range) {
722 prop = RNA_def_property(srna, "range_min", PROP_FLOAT, PROP_DISTANCE);
723 RNA_def_property_float_sdna(prop, nullptr, "range_min");
725 prop, "Range Min", "Lower bound of the input range the mapping is applied");
726 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
727
728 prop = RNA_def_property(srna, "range_max", PROP_FLOAT, PROP_DISTANCE);
729 RNA_def_property_float_sdna(prop, nullptr, "range_max");
731 prop, "Range Max", "Upper bound of the input range the mapping is applied");
732 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
733 }
734}
735
736static void rna_def_modifier_curve_common(StructRNA *srna, bool range, bool value)
737{
738 PropertyRNA *prop;
739
740 static const EnumPropertyItem mapping_items[] = {
741 {0, "LINEAR", 0, "Linear", "Use linear mapping"},
742 {LS_MODIFIER_USE_CURVE, "CURVE", 0, "Curve", "Use curve mapping"},
743 {0, nullptr, 0, nullptr, nullptr},
744 };
745
746 prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
747 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
748 RNA_def_property_enum_items(prop, mapping_items);
749 RNA_def_property_ui_text(prop, "Mapping", "Select the mapping type");
750 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
751
752 prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
753 RNA_def_property_boolean_sdna(prop, nullptr, "flags", LS_MODIFIER_INVERT);
754 RNA_def_property_ui_text(prop, "Invert", "Invert the fade-out direction of the linear mapping");
755 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
756
757 prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
758 RNA_def_property_pointer_sdna(prop, nullptr, "curve");
759 RNA_def_property_struct_type(prop, "CurveMapping");
760 RNA_def_property_ui_text(prop, "Curve", "Curve used for the curve mapping");
761 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
762
763 if (range) {
764 prop = RNA_def_property(srna, "range_min", PROP_FLOAT, PROP_DISTANCE);
765 RNA_def_property_float_sdna(prop, nullptr, "range_min");
767 prop, "Range Min", "Lower bound of the input range the mapping is applied");
768 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
769
770 prop = RNA_def_property(srna, "range_max", PROP_FLOAT, PROP_DISTANCE);
771 RNA_def_property_float_sdna(prop, nullptr, "range_max");
773 prop, "Range Max", "Upper bound of the input range the mapping is applied");
774 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
775 }
776
777 if (value) {
778 prop = RNA_def_property(srna, "value_min", PROP_FLOAT, PROP_NONE);
779 RNA_def_property_float_sdna(prop, nullptr, "value_min");
780 RNA_def_property_ui_text(prop, "Value Min", "Minimum output value of the mapping");
781 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
782
783 prop = RNA_def_property(srna, "value_max", PROP_FLOAT, PROP_NONE);
784 RNA_def_property_float_sdna(prop, nullptr, "value_max");
785 RNA_def_property_ui_text(prop, "Value Max", "Maximum output value of the mapping");
786 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
787 }
788}
789
791{
792 PropertyRNA *prop;
793
794 static const EnumPropertyItem mat_attr_items[] = {
795 {LS_MODIFIER_MATERIAL_LINE, "LINE", 0, "Line Color", ""},
796 {LS_MODIFIER_MATERIAL_LINE_R, "LINE_R", 0, "Line Color Red", ""},
797 {LS_MODIFIER_MATERIAL_LINE_G, "LINE_G", 0, "Line Color Green", ""},
798 {LS_MODIFIER_MATERIAL_LINE_B, "LINE_B", 0, "Line Color Blue", ""},
799 {LS_MODIFIER_MATERIAL_LINE_A, "LINE_A", 0, "Line Color Alpha", ""},
800 {LS_MODIFIER_MATERIAL_DIFF, "DIFF", 0, "Diffuse Color", ""},
801 {LS_MODIFIER_MATERIAL_DIFF_R, "DIFF_R", 0, "Diffuse Color Red", ""},
802 {LS_MODIFIER_MATERIAL_DIFF_G, "DIFF_G", 0, "Diffuse Color Green", ""},
803 {LS_MODIFIER_MATERIAL_DIFF_B, "DIFF_B", 0, "Diffuse Color Blue", ""},
804 {LS_MODIFIER_MATERIAL_SPEC, "SPEC", 0, "Specular Color", ""},
805 {LS_MODIFIER_MATERIAL_SPEC_R, "SPEC_R", 0, "Specular Color Red", ""},
806 {LS_MODIFIER_MATERIAL_SPEC_G, "SPEC_G", 0, "Specular Color Green", ""},
807 {LS_MODIFIER_MATERIAL_SPEC_B, "SPEC_B", 0, "Specular Color Blue", ""},
808 {LS_MODIFIER_MATERIAL_SPEC_HARD, "SPEC_HARD", 0, "Specular Hardness", ""},
809 {LS_MODIFIER_MATERIAL_ALPHA, "ALPHA", 0, "Alpha Transparency", ""},
810 {0, nullptr, 0, nullptr, nullptr},
811 };
812
813 prop = RNA_def_property(srna, "material_attribute", PROP_ENUM, PROP_NONE);
814 RNA_def_property_enum_sdna(prop, nullptr, "mat_attr");
815 RNA_def_property_enum_items(prop, mat_attr_items);
816 RNA_def_property_ui_text(prop, "Material Attribute", "Specify which material attribute is used");
817 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
818}
819
821{
822 StructRNA *srna;
823 PropertyRNA *prop;
824
825 static const EnumPropertyItem blueprint_shape_items[] = {
827 "CIRCLES",
828 0,
829 "Circles",
830 "Draw a blueprint using circular contour strokes"},
832 "ELLIPSES",
833 0,
834 "Ellipses",
835 "Draw a blueprint using elliptic contour strokes"},
837 "SQUARES",
838 0,
839 "Squares",
840 "Draw a blueprint using square contour strokes"},
841 {0, nullptr, 0, nullptr, nullptr},
842 };
843
844 static const EnumPropertyItem transform_pivot_items[] = {
845 {LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER, "CENTER", 0, "Stroke Center", ""},
846 {LS_MODIFIER_2D_TRANSFORM_PIVOT_START, "START", 0, "Stroke Start", ""},
847 {LS_MODIFIER_2D_TRANSFORM_PIVOT_END, "END", 0, "Stroke End", ""},
848 {LS_MODIFIER_2D_TRANSFORM_PIVOT_PARAM, "PARAM", 0, "Stroke Point Parameter", ""},
849 {LS_MODIFIER_2D_TRANSFORM_PIVOT_ABSOLUTE, "ABSOLUTE", 0, "Absolute 2D Point", ""},
850 {0, nullptr, 0, nullptr, nullptr},
851 };
852
853 srna = RNA_def_struct(brna, "LineStyleModifier", nullptr);
854 RNA_def_struct_ui_text(srna, "Line Style Modifier", "Base type to define modifiers");
855
856 /* line color modifiers */
857
858 srna = RNA_def_struct(brna, "LineStyleColorModifier", "LineStyleModifier");
859 RNA_def_struct_sdna(srna, "LineStyleModifier");
860 RNA_def_struct_refine_func(srna, "rna_LineStyle_color_modifier_refine");
861 RNA_def_struct_path_func(srna, "rna_LineStyle_color_modifier_path");
863 srna, "Line Style Color Modifier", "Base type to define line color modifiers");
864
865 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
866 RNA_def_property_string_sdna(prop, nullptr, "name");
867 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleColorModifier_name_set");
868 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
871
872 srna = RNA_def_struct(brna, "LineStyleColorModifier_AlongStroke", "LineStyleColorModifier");
873 RNA_def_struct_ui_text(srna, "Along Stroke", "Change line color along stroke");
876
877 srna = RNA_def_struct(
878 brna, "LineStyleColorModifier_DistanceFromCamera", "LineStyleColorModifier");
880 srna, "Distance from Camera", "Change line color based on the distance from the camera");
883
884 srna = RNA_def_struct(
885 brna, "LineStyleColorModifier_DistanceFromObject", "LineStyleColorModifier");
887 srna, "Distance from Object", "Change line color based on the distance from an object");
890
891 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
892 RNA_def_property_pointer_sdna(prop, nullptr, "target");
893 RNA_def_property_struct_type(prop, "Object");
895 RNA_def_property_ui_text(prop, "Target", "Target object from which the distance is measured");
896 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
897
898 srna = RNA_def_struct(brna, "LineStyleColorModifier_Material", "LineStyleColorModifier");
899 RNA_def_struct_ui_text(srna, "Material", "Change line color based on a material attribute");
903
904 prop = RNA_def_property(srna, "use_ramp", PROP_BOOLEAN, PROP_NONE);
906 RNA_def_property_ui_text(prop, "Ramp", "Use color ramp to map the BW average into an RGB color");
907 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
908
909 srna = RNA_def_struct(brna, "LineStyleColorModifier_Tangent", "LineStyleColorModifier");
910 RNA_def_struct_ui_text(srna, "Tangent", "Change line color based on the direction of a stroke");
913
914 srna = RNA_def_struct(brna, "LineStyleColorModifier_Noise", "LineStyleColorModifier");
915 RNA_def_struct_ui_text(srna, "Noise", "Change line color based on random noise");
918
919 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
920 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
921 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the noise");
922 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
923
924 prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE);
925 RNA_def_property_float_sdna(prop, nullptr, "period");
926 RNA_def_property_ui_text(prop, "Period", "Period of the noise");
927 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
928
929 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
930 RNA_def_property_int_sdna(prop, nullptr, "seed");
931 RNA_def_property_range(prop, 1, SHRT_MAX);
932 RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
933 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
934
935 srna = RNA_def_struct(brna, "LineStyleColorModifier_CreaseAngle", "LineStyleColorModifier");
937 srna, "Crease Angle", "Change line color based on the underlying crease angle");
940
941 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
942 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
943 RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle to modify thickness");
944 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
945
946 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
947 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
948 RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle to modify thickness");
949 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
950
951 srna = RNA_def_struct(brna, "LineStyleColorModifier_Curvature_3D", "LineStyleColorModifier");
953 srna, "Curvature 3D", "Change line color based on the radial curvature of 3D mesh surfaces");
956
957 prop = RNA_def_property(srna, "curvature_min", PROP_FLOAT, PROP_NONE);
958 RNA_def_property_float_sdna(prop, nullptr, "min_curvature");
959 RNA_def_property_ui_text(prop, "Min Curvature", "Minimum Curvature");
960 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
961
962 prop = RNA_def_property(srna, "curvature_max", PROP_FLOAT, PROP_NONE);
963 RNA_def_property_float_sdna(prop, nullptr, "max_curvature");
964 RNA_def_property_ui_text(prop, "Max Curvature", "Maximum Curvature");
965 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
966
967 /* alpha transparency modifiers */
968
969 srna = RNA_def_struct(brna, "LineStyleAlphaModifier", "LineStyleModifier");
970 RNA_def_struct_sdna(srna, "LineStyleModifier");
971 RNA_def_struct_refine_func(srna, "rna_LineStyle_alpha_modifier_refine");
972 RNA_def_struct_path_func(srna, "rna_LineStyle_alpha_modifier_path");
974 srna, "Line Style Alpha Modifier", "Base type to define alpha transparency modifiers");
975
976 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
977 RNA_def_property_string_sdna(prop, nullptr, "name");
978 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleAlphaModifier_name_set");
979 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
982
983 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_AlongStroke", "LineStyleAlphaModifier");
984 RNA_def_struct_ui_text(srna, "Along Stroke", "Change alpha transparency along stroke");
986 rna_def_modifier_curve_common(srna, false, false);
987
988 srna = RNA_def_struct(
989 brna, "LineStyleAlphaModifier_DistanceFromCamera", "LineStyleAlphaModifier");
991 "Distance from Camera",
992 "Change alpha transparency based on the distance from the camera");
994 rna_def_modifier_curve_common(srna, true, false);
995
996 srna = RNA_def_struct(
997 brna, "LineStyleAlphaModifier_DistanceFromObject", "LineStyleAlphaModifier");
999 "Distance from Object",
1000 "Change alpha transparency based on the distance from an object");
1002 rna_def_modifier_curve_common(srna, true, false);
1003
1004 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1005 RNA_def_property_pointer_sdna(prop, nullptr, "target");
1006 RNA_def_property_struct_type(prop, "Object");
1008 RNA_def_property_ui_text(prop, "Target", "Target object from which the distance is measured");
1009 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1010
1011 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Material", "LineStyleAlphaModifier");
1013 srna, "Material", "Change alpha transparency based on a material attribute");
1016 rna_def_modifier_curve_common(srna, false, false);
1017
1018 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Tangent", "LineStyleAlphaModifier");
1020 srna, "Tangent", "Alpha transparency based on the direction of the stroke");
1022 rna_def_modifier_curve_common(srna, false, false);
1023
1024 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Noise", "LineStyleAlphaModifier");
1025 RNA_def_struct_ui_text(srna, "Noise", "Alpha transparency based on random noise");
1027 rna_def_modifier_curve_common(srna, false, false);
1028
1029 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1030 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1031 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the noise");
1032 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1033
1034 prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE);
1035 RNA_def_property_float_sdna(prop, nullptr, "period");
1036 RNA_def_property_ui_text(prop, "Period", "Period of the noise");
1037 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1038
1039 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
1040 RNA_def_property_int_sdna(prop, nullptr, "seed");
1041 RNA_def_property_range(prop, 1, SHRT_MAX);
1042 RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
1043 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1044
1045 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_CreaseAngle", "LineStyleAlphaModifier");
1047 srna, "Crease Angle", "Alpha transparency based on the angle between two adjacent faces");
1049 rna_def_modifier_curve_common(srna, false, false);
1050
1051 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
1052 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
1053 RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle to modify thickness");
1054 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1055
1056 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
1057 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
1058 RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle to modify thickness");
1059 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1060
1061 srna = RNA_def_struct(brna, "LineStyleAlphaModifier_Curvature_3D", "LineStyleAlphaModifier");
1063 "Curvature 3D",
1064 "Alpha transparency based on the radial curvature of 3D mesh surfaces");
1066 rna_def_modifier_curve_common(srna, false, false);
1067
1068 prop = RNA_def_property(srna, "curvature_min", PROP_FLOAT, PROP_NONE);
1069 RNA_def_property_float_sdna(prop, nullptr, "min_curvature");
1070 RNA_def_property_range(prop, 0.0f, 10000.0f);
1071 RNA_def_property_ui_text(prop, "Min Curvature", "Minimum Curvature");
1072 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1073
1074 prop = RNA_def_property(srna, "curvature_max", PROP_FLOAT, PROP_NONE);
1075 RNA_def_property_float_sdna(prop, nullptr, "max_curvature");
1076 RNA_def_property_range(prop, 0.0f, 10000.0f);
1077 RNA_def_property_ui_text(prop, "Max Curvature", "Maximum Curvature");
1078 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1079
1080 /* line thickness modifiers */
1081 srna = RNA_def_struct(brna, "LineStyleThicknessModifier", "LineStyleModifier");
1082 RNA_def_struct_sdna(srna, "LineStyleModifier");
1083 RNA_def_struct_refine_func(srna, "rna_LineStyle_thickness_modifier_refine");
1084 RNA_def_struct_path_func(srna, "rna_LineStyle_thickness_modifier_path");
1086 srna, "Line Style Thickness Modifier", "Base type to define line thickness modifiers");
1087
1088 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1089 RNA_def_property_string_sdna(prop, nullptr, "name");
1090 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleThicknessModifier_name_set");
1091 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
1092 RNA_def_property_update(prop, NC_LINESTYLE, nullptr);
1093 RNA_def_struct_name_property(srna, prop);
1094
1095 srna = RNA_def_struct(brna, "LineStyleThicknessModifier_Tangent", "LineStyleThicknessModifier");
1096 RNA_def_struct_ui_text(srna, "Tangent", "Thickness based on the direction of the stroke");
1098 rna_def_modifier_curve_common(srna, false, false);
1099
1100 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1101 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1102 RNA_def_property_range(prop, 0.0f, 10000.0f);
1103 RNA_def_property_ui_text(prop, "Min Thickness", "Minimum thickness");
1104 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1105
1106 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1107 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1108 RNA_def_property_range(prop, 0.0f, 10000.0f);
1109 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness");
1110 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1111
1112 srna = RNA_def_struct(
1113 brna, "LineStyleThicknessModifier_AlongStroke", "LineStyleThicknessModifier");
1114 RNA_def_struct_ui_text(srna, "Along Stroke", "Change line thickness along stroke");
1116 rna_def_modifier_curve_common(srna, false, true);
1117
1118 srna = RNA_def_struct(
1119 brna, "LineStyleThicknessModifier_DistanceFromCamera", "LineStyleThicknessModifier");
1121 srna, "Distance from Camera", "Change line thickness based on the distance from the camera");
1123 rna_def_modifier_curve_common(srna, true, true);
1124
1125 srna = RNA_def_struct(
1126 brna, "LineStyleThicknessModifier_DistanceFromObject", "LineStyleThicknessModifier");
1128 srna, "Distance from Object", "Change line thickness based on the distance from an object");
1130 rna_def_modifier_curve_common(srna, true, true);
1131
1132 prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
1133 RNA_def_property_pointer_sdna(prop, nullptr, "target");
1134 RNA_def_property_struct_type(prop, "Object");
1136 RNA_def_property_ui_text(prop, "Target", "Target object from which the distance is measured");
1137 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1138
1139 srna = RNA_def_struct(brna, "LineStyleThicknessModifier_Material", "LineStyleThicknessModifier");
1140 RNA_def_struct_ui_text(srna, "Material", "Change line thickness based on a material attribute");
1143 rna_def_modifier_curve_common(srna, false, true);
1144
1145 srna = RNA_def_struct(
1146 brna, "LineStyleThicknessModifier_Calligraphy", "LineStyleThicknessModifier");
1148 srna,
1149 "Calligraphy",
1150 "Change line thickness so that stroke looks like made with a calligraphic pen");
1152
1153 prop = RNA_def_property(srna, "orientation", PROP_FLOAT, PROP_ANGLE);
1154 RNA_def_property_float_sdna(prop, nullptr, "orientation");
1155 RNA_def_property_ui_text(prop, "Orientation", "Angle of the main direction");
1156 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1157
1158 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1159 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1160 RNA_def_property_range(prop, 0.0f, 10000.0f);
1162 prop,
1163 "Min Thickness",
1164 "Minimum thickness in the direction perpendicular to the main direction");
1165 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1166
1167 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1168 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1169 RNA_def_property_range(prop, 0.0f, 10000.0f);
1170 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness in the main direction");
1171 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1172
1173 srna = RNA_def_struct(brna, "LineStyleThicknessModifier_Noise", "LineStyleThicknessModifier");
1174 RNA_def_struct_ui_text(srna, "Noise", "Line thickness based on random noise");
1176
1177 prop = RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
1178 RNA_def_property_float_sdna(prop, nullptr, "amplitude");
1179 RNA_def_property_ui_text(prop, "Amplitude", "Amplitude of the noise");
1180 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1181
1182 prop = RNA_def_property(srna, "period", PROP_FLOAT, PROP_NONE);
1183 RNA_def_property_float_sdna(prop, nullptr, "period");
1184 RNA_def_property_ui_text(prop, "Period", "Period of the noise");
1185 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1186
1187 prop = RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED);
1188 RNA_def_property_int_sdna(prop, nullptr, "seed");
1189 RNA_def_property_range(prop, 1, SHRT_MAX);
1190 RNA_def_property_ui_text(prop, "Seed", "Seed for the noise generation");
1191 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1192
1193 prop = RNA_def_property(srna, "use_asymmetric", PROP_BOOLEAN, PROP_NONE);
1195 RNA_def_property_ui_text(prop, "Asymmetric", "Allow thickness to be assigned asymmetrically");
1196 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1197
1198 srna = RNA_def_struct(
1199 brna, "LineStyleThicknessModifier_Curvature_3D", "LineStyleThicknessModifier");
1201 srna, "Curvature 3D", "Line thickness based on the radial curvature of 3D mesh surfaces");
1203 rna_def_modifier_curve_common(srna, false, false);
1204
1205 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1206 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1207 RNA_def_property_range(prop, 0.0f, 10000.0f);
1208 RNA_def_property_ui_text(prop, "Min Thickness", "Minimum thickness");
1209 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1210
1211 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1212 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1213 RNA_def_property_range(prop, 0.0f, 10000.0f);
1214 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness");
1215 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1216
1217 prop = RNA_def_property(srna, "curvature_min", PROP_FLOAT, PROP_NONE);
1218 RNA_def_property_float_sdna(prop, nullptr, "min_curvature");
1219 RNA_def_property_range(prop, 0.0f, 10000.0f);
1220 RNA_def_property_ui_text(prop, "Min Curvature", "Minimum Curvature");
1221 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1222
1223 prop = RNA_def_property(srna, "curvature_max", PROP_FLOAT, PROP_NONE);
1224 RNA_def_property_float_sdna(prop, nullptr, "max_curvature");
1225 RNA_def_property_range(prop, 0.0f, 10000.0f);
1226 RNA_def_property_ui_text(prop, "Max Curvature", "Maximum Curvature");
1227 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1228
1229 srna = RNA_def_struct(
1230 brna, "LineStyleThicknessModifier_CreaseAngle", "LineStyleThicknessModifier");
1232 srna, "Crease Angle", "Line thickness based on the angle between two adjacent faces");
1234 rna_def_modifier_curve_common(srna, false, false);
1235
1236 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
1237 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
1238 RNA_def_property_ui_text(prop, "Min Angle", "Minimum angle to modify thickness");
1239 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1240
1241 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
1242 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
1243 RNA_def_property_ui_text(prop, "Max Angle", "Maximum angle to modify thickness");
1244 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1245
1246 prop = RNA_def_property(srna, "thickness_min", PROP_FLOAT, PROP_NONE);
1247 RNA_def_property_float_sdna(prop, nullptr, "min_thickness");
1248 RNA_def_property_range(prop, 0.0f, 10000.0f);
1249 RNA_def_property_ui_text(prop, "Min Thickness", "Minimum thickness");
1250 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1251
1252 prop = RNA_def_property(srna, "thickness_max", PROP_FLOAT, PROP_NONE);
1253 RNA_def_property_float_sdna(prop, nullptr, "max_thickness");
1254 RNA_def_property_range(prop, 0.0f, 10000.0f);
1255 RNA_def_property_ui_text(prop, "Max Thickness", "Maximum thickness");
1256 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1257
1258 /* geometry modifiers */
1259
1260 srna = RNA_def_struct(brna, "LineStyleGeometryModifier", "LineStyleModifier");
1261 RNA_def_struct_sdna(srna, "LineStyleModifier");
1262 RNA_def_struct_refine_func(srna, "rna_LineStyle_geometry_modifier_refine");
1263 RNA_def_struct_path_func(srna, "rna_LineStyle_geometry_modifier_path");
1265 srna, "Line Style Geometry Modifier", "Base type to define stroke geometry modifiers");
1266
1267 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
1268 RNA_def_property_string_sdna(prop, nullptr, "name");
1269 RNA_def_property_string_funcs(prop, nullptr, nullptr, "rna_LineStyleGeometryModifier_name_set");
1270 RNA_def_property_ui_text(prop, "Modifier Name", "Name of the modifier");
1271 RNA_def_property_update(prop, NC_LINESTYLE, nullptr);
1272 RNA_def_struct_name_property(srna, prop);
1273
1274 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_Sampling", "LineStyleGeometryModifier");
1276 srna,
1277 "Sampling",
1278 "Specify a new sampling value that determines the resolution of stroke polylines");
1280
1281 prop = RNA_def_property(srna, "sampling", PROP_FLOAT, PROP_NONE);
1282 RNA_def_property_float_sdna(prop, nullptr, "sampling");
1283 RNA_def_property_range(prop, 0.0f, 10000.0f);
1285 prop, "Sampling", "New sampling value to be used for subsequent modifiers");
1286 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1287
1288 srna = RNA_def_struct(
1289 brna, "LineStyleGeometryModifier_BezierCurve", "LineStyleGeometryModifier");
1291 "Bézier Curve",
1292 "Replace stroke backbone geometry by a Bézier curve approximation of the "
1293 "original backbone geometry");
1295
1296 prop = RNA_def_property(srna, "error", PROP_FLOAT, PROP_NONE);
1297 RNA_def_property_float_sdna(prop, nullptr, "error");
1299 "Error",
1300 "Maximum distance allowed between the new Bézier curve and the "
1301 "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");
1466 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1467
1468 srna = RNA_def_struct(
1469 brna, "LineStyleGeometryModifier_GuidingLines", "LineStyleGeometryModifier");
1471 srna,
1472 "Guiding Lines",
1473 "Modify the stroke geometry so that it corresponds to its main direction line");
1475
1476 prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
1477 RNA_def_property_float_sdna(prop, nullptr, "offset");
1479 prop, "Offset", "Displacement that is applied to the main direction line along its normal");
1480 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1481
1482 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_Blueprint", "LineStyleGeometryModifier");
1484 srna,
1485 "Blueprint",
1486 "Produce a blueprint using circular, elliptic, and square contour strokes");
1488
1489 prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
1490 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flags");
1491 RNA_def_property_enum_items(prop, blueprint_shape_items);
1492 RNA_def_property_ui_text(prop, "Shape", "Select the shape of blueprint contour strokes");
1493 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1494
1495 prop = RNA_def_property(srna, "rounds", PROP_INT, PROP_UNSIGNED);
1496 RNA_def_property_int_sdna(prop, nullptr, "rounds");
1497 RNA_def_property_range(prop, 1, 1000);
1498 RNA_def_property_ui_text(prop, "Rounds", "Number of rounds in contour strokes");
1499 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1500
1501 prop = RNA_def_property(srna, "backbone_length", PROP_FLOAT, PROP_NONE);
1502 RNA_def_property_float_sdna(prop, nullptr, "backbone_length");
1503 RNA_def_property_ui_text(prop, "Backbone Length", "Amount of backbone stretching");
1504 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1505
1506 prop = RNA_def_property(srna, "random_radius", PROP_INT, PROP_UNSIGNED);
1507 RNA_def_property_int_sdna(prop, nullptr, "random_radius");
1508 RNA_def_property_ui_text(prop, "Random Radius", "Randomness of the radius");
1509 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1510
1511 prop = RNA_def_property(srna, "random_center", PROP_INT, PROP_UNSIGNED);
1512 RNA_def_property_int_sdna(prop, nullptr, "random_center");
1513 RNA_def_property_ui_text(prop, "Random Center", "Randomness of the center");
1514 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1515
1516 prop = RNA_def_property(srna, "random_backbone", PROP_INT, PROP_UNSIGNED);
1517 RNA_def_property_int_sdna(prop, nullptr, "random_backbone");
1518 RNA_def_property_ui_text(prop, "Random Backbone", "Randomness of the backbone stretching");
1519 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1520
1521 srna = RNA_def_struct(brna, "LineStyleGeometryModifier_2DOffset", "LineStyleGeometryModifier");
1523 srna, "2D Offset", "Add two-dimensional offsets to stroke backbone geometry");
1525
1526 prop = RNA_def_property(srna, "start", PROP_FLOAT, PROP_NONE);
1527 RNA_def_property_float_sdna(prop, nullptr, "start");
1529 prop, "Start", "Displacement that is applied from the beginning of the stroke");
1530 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1531
1532 prop = RNA_def_property(srna, "end", PROP_FLOAT, PROP_NONE);
1533 RNA_def_property_float_sdna(prop, nullptr, "end");
1534 RNA_def_property_ui_text(prop, "End", "Displacement that is applied from the end of the stroke");
1535 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1536
1537 prop = RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE);
1538 RNA_def_property_float_sdna(prop, nullptr, "x");
1540 prop, "X", "Displacement that is applied to the X coordinates of stroke vertices");
1541 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1542
1543 prop = RNA_def_property(srna, "y", PROP_FLOAT, PROP_NONE);
1544 RNA_def_property_float_sdna(prop, nullptr, "y");
1546 prop, "Y", "Displacement that is applied to the Y coordinates of stroke vertices");
1547 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1548
1549 srna = RNA_def_struct(
1550 brna, "LineStyleGeometryModifier_2DTransform", "LineStyleGeometryModifier");
1552 "2D Transform",
1553 "Apply two-dimensional scaling and rotation to stroke backbone geometry");
1555
1556 prop = RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE);
1557 RNA_def_property_enum_sdna(prop, nullptr, "pivot");
1558 RNA_def_property_enum_items(prop, transform_pivot_items);
1559 RNA_def_property_ui_text(prop, "Pivot", "Pivot of scaling and rotation operations");
1560 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1561
1562 prop = RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_NONE);
1563 RNA_def_property_float_sdna(prop, nullptr, "scale_x");
1565 RNA_def_property_ui_text(prop, "Scale X", "Scaling factor that is applied along the X axis");
1566 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1567
1568 prop = RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_NONE);
1569 RNA_def_property_float_sdna(prop, nullptr, "scale_y");
1571 RNA_def_property_ui_text(prop, "Scale Y", "Scaling factor that is applied along the Y axis");
1572 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1573
1574 prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
1575 RNA_def_property_float_sdna(prop, nullptr, "angle");
1576 RNA_def_property_ui_text(prop, "Rotation Angle", "Rotation angle");
1577 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1578
1579 prop = RNA_def_property(srna, "pivot_u", PROP_FLOAT, PROP_FACTOR);
1580 RNA_def_property_float_sdna(prop, nullptr, "pivot_u");
1581 RNA_def_property_range(prop, 0.0f, 1.0f);
1583 "Stroke Point Parameter",
1584 "Pivot in terms of the stroke point parameter u (0 <= u <= 1)");
1585 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1586
1587 prop = RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_NONE);
1588 RNA_def_property_float_sdna(prop, nullptr, "pivot_x");
1589 RNA_def_property_ui_text(prop, "Pivot X", "2D X coordinate of the absolute pivot");
1590 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1591
1592 prop = RNA_def_property(srna, "pivot_y", PROP_FLOAT, PROP_NONE);
1593 RNA_def_property_float_sdna(prop, nullptr, "pivot_y");
1594 RNA_def_property_ui_text(prop, "Pivot Y", "2D Y coordinate of the absolute pivot");
1595 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1596
1597 srna = RNA_def_struct(
1598 brna, "LineStyleGeometryModifier_Simplification", "LineStyleGeometryModifier");
1599 RNA_def_struct_ui_text(srna, "Simplification", "Simplify the stroke set");
1601
1602 prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE);
1603 RNA_def_property_float_sdna(prop, nullptr, "tolerance");
1604 RNA_def_property_ui_text(prop, "Tolerance", "Distance below which segments will be merged");
1605 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1606}
1607
1609{
1610 StructRNA *srna;
1611 FunctionRNA *func;
1612 PropertyRNA *parm;
1613
1614 RNA_def_property_srna(cprop, "LineStyleColorModifiers");
1615 srna = RNA_def_struct(brna, "LineStyleColorModifiers", nullptr);
1616 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1617 RNA_def_struct_ui_text(srna, "Color Modifiers", "Color modifiers for changing line colors");
1618
1619 func = RNA_def_function(srna, "new", "rna_LineStyle_color_modifier_add");
1620 RNA_def_function_ui_description(func, "Add a color modifier to line style");
1622 parm = RNA_def_string(
1623 func, "name", "ColorModifier", 0, "", "New name for the color modifier (not unique)");
1625 parm = RNA_def_enum(func,
1626 "type",
1628 0,
1629 "",
1630 "Color modifier type to add");
1632 parm = RNA_def_pointer(
1633 func, "modifier", "LineStyleColorModifier", "", "Newly added color modifier");
1634 RNA_def_function_return(func, parm);
1635
1636 func = RNA_def_function(srna, "remove", "rna_LineStyle_color_modifier_remove");
1637 RNA_def_function_ui_description(func, "Remove a color modifier from line style");
1639 parm = RNA_def_pointer(
1640 func, "modifier", "LineStyleColorModifier", "", "Color modifier to remove");
1643}
1644
1646{
1647 StructRNA *srna;
1648 FunctionRNA *func;
1649 PropertyRNA *parm;
1650
1651 RNA_def_property_srna(cprop, "LineStyleAlphaModifiers");
1652 srna = RNA_def_struct(brna, "LineStyleAlphaModifiers", nullptr);
1653 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1654 RNA_def_struct_ui_text(srna, "Alpha Modifiers", "Alpha modifiers for changing line alphas");
1655
1656 func = RNA_def_function(srna, "new", "rna_LineStyle_alpha_modifier_add");
1657 RNA_def_function_ui_description(func, "Add a alpha modifier to line style");
1659 parm = RNA_def_string(
1660 func, "name", "AlphaModifier", 0, "", "New name for the alpha modifier (not unique)");
1662 parm = RNA_def_enum(func,
1663 "type",
1665 0,
1666 "",
1667 "Alpha modifier type to add");
1669 parm = RNA_def_pointer(
1670 func, "modifier", "LineStyleAlphaModifier", "", "Newly added alpha modifier");
1671 RNA_def_function_return(func, parm);
1672
1673 func = RNA_def_function(srna, "remove", "rna_LineStyle_alpha_modifier_remove");
1674 RNA_def_function_ui_description(func, "Remove a alpha modifier from line style");
1676 parm = RNA_def_pointer(
1677 func, "modifier", "LineStyleAlphaModifier", "", "Alpha modifier to remove");
1680}
1681
1683{
1684 StructRNA *srna;
1685 FunctionRNA *func;
1686 PropertyRNA *parm;
1687
1688 RNA_def_property_srna(cprop, "LineStyleThicknessModifiers");
1689 srna = RNA_def_struct(brna, "LineStyleThicknessModifiers", nullptr);
1690 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1692 srna, "Thickness Modifiers", "Thickness modifiers for changing line thickness");
1693
1694 func = RNA_def_function(srna, "new", "rna_LineStyle_thickness_modifier_add");
1695 RNA_def_function_ui_description(func, "Add a thickness modifier to line style");
1697 parm = RNA_def_string(func,
1698 "name",
1699 "ThicknessModifier",
1700 0,
1701 "",
1702 "New name for the thickness modifier (not unique)");
1704 parm = RNA_def_enum(func,
1705 "type",
1707 0,
1708 "",
1709 "Thickness modifier type to add");
1711 parm = RNA_def_pointer(
1712 func, "modifier", "LineStyleThicknessModifier", "", "Newly added thickness modifier");
1713 RNA_def_function_return(func, parm);
1714
1715 func = RNA_def_function(srna, "remove", "rna_LineStyle_thickness_modifier_remove");
1716 RNA_def_function_ui_description(func, "Remove a thickness modifier from line style");
1718 parm = RNA_def_pointer(
1719 func, "modifier", "LineStyleThicknessModifier", "", "Thickness modifier to remove");
1722}
1723
1725{
1726 StructRNA *srna;
1727 FunctionRNA *func;
1728 PropertyRNA *parm;
1729
1730 RNA_def_property_srna(cprop, "LineStyleGeometryModifiers");
1731 srna = RNA_def_struct(brna, "LineStyleGeometryModifiers", nullptr);
1732 RNA_def_struct_sdna(srna, "FreestyleLineStyle");
1734 srna, "Geometry Modifiers", "Geometry modifiers for changing line geometries");
1735
1736 func = RNA_def_function(srna, "new", "rna_LineStyle_geometry_modifier_add");
1737 RNA_def_function_ui_description(func, "Add a geometry modifier to line style");
1739 parm = RNA_def_string(
1740 func, "name", "GeometryModifier", 0, "", "New name for the geometry modifier (not unique)");
1742 parm = RNA_def_enum(func,
1743 "type",
1745 0,
1746 "",
1747 "Geometry modifier type to add");
1749 parm = RNA_def_pointer(
1750 func, "modifier", "LineStyleGeometryModifier", "", "Newly added geometry modifier");
1751 RNA_def_function_return(func, parm);
1752
1753 func = RNA_def_function(srna, "remove", "rna_LineStyle_geometry_modifier_remove");
1754 RNA_def_function_ui_description(func, "Remove a geometry modifier from line style");
1756 parm = RNA_def_pointer(
1757 func, "modifier", "LineStyleGeometryModifier", "", "Geometry modifier to remove");
1760}
1761
1763{
1764 StructRNA *srna;
1765 PropertyRNA *prop;
1766
1767 static const EnumPropertyItem panel_items[] = {
1768 {LS_PANEL_STROKES, "STROKES", 0, "Strokes", "Show the panel for stroke construction"},
1769 {LS_PANEL_COLOR, "COLOR", 0, "Color", "Show the panel for line color options"},
1770 {LS_PANEL_ALPHA, "ALPHA", 0, "Alpha", "Show the panel for alpha transparency options"},
1772 "THICKNESS",
1773 0,
1774 "Thickness",
1775 "Show the panel for line thickness options"},
1776 {LS_PANEL_GEOMETRY, "GEOMETRY", 0, "Geometry", "Show the panel for stroke geometry options"},
1777 {LS_PANEL_TEXTURE, "TEXTURE", 0, "Texture", "Show the panel for stroke texture options"},
1778# if 0 /* hidden for now */
1779 {LS_PANEL_MISC, "MISC", 0, "Misc", "Show the panel for miscellaneous options"},
1780# endif
1781 {0, nullptr, 0, nullptr, nullptr},
1782 };
1783 static const EnumPropertyItem chaining_items[] = {
1784 {LS_CHAINING_PLAIN, "PLAIN", 0, "Plain", "Plain chaining"},
1785 {LS_CHAINING_SKETCHY, "SKETCHY", 0, "Sketchy", "Sketchy chaining with a multiple touch"},
1786 {0, nullptr, 0, nullptr, nullptr},
1787 };
1788 static const EnumPropertyItem cap_items[] = {
1789 {LS_CAPS_BUTT, "BUTT", 0, "Butt", "Butt cap (flat)"},
1790 {LS_CAPS_ROUND, "ROUND", 0, "Round", "Round cap (half-circle)"},
1791 {LS_CAPS_SQUARE, "SQUARE", 0, "Square", "Square cap (flat and extended)"},
1792 {0, nullptr, 0, nullptr, nullptr},
1793 };
1794 static const EnumPropertyItem thickness_position_items[] = {
1796 "CENTER",
1797 0,
1798 "Center",
1799 "Silhouettes and border edges are centered along stroke geometry"},
1801 "INSIDE",
1802 0,
1803 "Inside",
1804 "Silhouettes and border edges are drawn inside of stroke geometry"},
1806 "OUTSIDE",
1807 0,
1808 "Outside",
1809 "Silhouettes and border edges are drawn outside of stroke geometry"},
1811 "RELATIVE",
1812 0,
1813 "Relative",
1814 "Silhouettes and border edges are shifted by a user-defined ratio"},
1815 {0, nullptr, 0, nullptr, nullptr},
1816 };
1817 static const EnumPropertyItem sort_key_items[] = {
1819 "DISTANCE_FROM_CAMERA",
1820 0,
1821 "Distance from Camera",
1822 "Sort by distance from camera (closer lines lie on top of further lines)"},
1824 "2D_LENGTH",
1825 0,
1826 "2D Length",
1827 "Sort by curvilinear 2D length (longer lines lie on top of shorter lines)"},
1829 "PROJECTED_X",
1830 0,
1831 "Projected X",
1832 "Sort by the projected X value in the image coordinate system"},
1834 "PROJECTED_Y",
1835 0,
1836 "Projected Y",
1837 "Sort by the projected Y value in the image coordinate system"},
1838 {0, nullptr, 0, nullptr, nullptr},
1839 };
1840 static const EnumPropertyItem sort_order_items[] = {
1841 {0, "DEFAULT", 0, "Default", "Default order of the sort key"},
1842 {LS_REVERSE_ORDER, "REVERSE", 0, "Reverse", "Reverse order"},
1843 {0, nullptr, 0, nullptr, nullptr},
1844 };
1845 static const EnumPropertyItem integration_type_items[] = {
1847 "MEAN",
1848 0,
1849 "Mean",
1850 "The value computed for the chain is the mean of the values obtained for chain vertices"},
1852 "MIN",
1853 0,
1854 "Min",
1855 "The value computed for the chain is the minimum of the values obtained for chain "
1856 "vertices"},
1858 "MAX",
1859 0,
1860 "Max",
1861 "The value computed for the chain is the maximum of the values obtained for chain "
1862 "vertices"},
1864 "FIRST",
1865 0,
1866 "First",
1867 "The value computed for the chain is the value obtained for the first chain vertex"},
1869 "LAST",
1870 0,
1871 "Last",
1872 "The value computed for the chain is the value obtained for the last chain vertex"},
1873 {0, nullptr, 0, nullptr, nullptr},
1874 };
1875
1876 srna = RNA_def_struct(brna, "FreestyleLineStyle", "ID");
1878 srna, "Freestyle Line Style", "Freestyle line style, reusable by multiple line sets");
1879 RNA_def_struct_ui_icon(srna, ICON_LINE_DATA);
1880
1882 srna,
1883 "rna_LineStyle_mtex_begin",
1884 "rna_LineStyle_active_texture_get",
1885 "rna_LineStyle_active_texture_set",
1886 nullptr,
1887 "LineStyleTextureSlot",
1888 "LineStyleTextureSlots",
1889 "rna_LineStyle_update",
1890 "rna_LineStyle_update");
1891
1892 prop = RNA_def_property(srna, "panel", PROP_ENUM, PROP_NONE);
1893 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "panel");
1894 RNA_def_property_enum_items(prop, panel_items);
1896 RNA_def_property_ui_text(prop, "Panel", "Select the property panel to be shown");
1897
1898 prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
1899 RNA_def_property_float_sdna(prop, nullptr, "r");
1900 RNA_def_property_array(prop, 3);
1902 prop, "Color", "Base line color, possibly modified by line color modifiers");
1903 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1904
1905 prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR);
1906 RNA_def_property_float_sdna(prop, nullptr, "alpha");
1907 RNA_def_property_range(prop, 0.0f, 1.0f);
1909 prop,
1910 "Alpha Transparency",
1911 "Base alpha transparency, possibly modified by alpha transparency modifiers");
1912 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1913
1914 prop = RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_NONE);
1915 RNA_def_property_float_sdna(prop, nullptr, "thickness");
1916 RNA_def_property_range(prop, 0.0f, 10000.0f);
1918 prop, "Thickness", "Base line thickness, possibly modified by line thickness modifiers");
1919 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1920
1921 prop = RNA_def_property(srna, "thickness_position", PROP_ENUM, PROP_NONE);
1922 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "thickness_position");
1923 RNA_def_property_enum_items(prop, thickness_position_items);
1925 "Thickness Position",
1926 "Thickness position of silhouettes and border edges (applicable when "
1927 "plain chaining is used with the Same Object option)");
1928 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1929
1930 prop = RNA_def_property(srna, "thickness_ratio", PROP_FLOAT, PROP_FACTOR);
1931 RNA_def_property_float_sdna(prop, nullptr, "thickness_ratio");
1932 RNA_def_property_range(prop, 0.0f, 1.0f);
1934 prop,
1935 "Thickness Ratio",
1936 "A number between 0 (inside) and 1 (outside) specifying the relative position of "
1937 "stroke thickness");
1938 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1939
1940 prop = RNA_def_property(srna, "color_modifiers", PROP_COLLECTION, PROP_NONE);
1941 RNA_def_property_collection_sdna(prop, nullptr, "color_modifiers", nullptr);
1942 RNA_def_property_struct_type(prop, "LineStyleColorModifier");
1943 RNA_def_property_ui_text(prop, "Color Modifiers", "List of line color modifiers");
1945
1946 prop = RNA_def_property(srna, "alpha_modifiers", PROP_COLLECTION, PROP_NONE);
1947 RNA_def_property_collection_sdna(prop, nullptr, "alpha_modifiers", nullptr);
1948 RNA_def_property_struct_type(prop, "LineStyleAlphaModifier");
1949 RNA_def_property_ui_text(prop, "Alpha Modifiers", "List of alpha transparency modifiers");
1951
1952 prop = RNA_def_property(srna, "thickness_modifiers", PROP_COLLECTION, PROP_NONE);
1953 RNA_def_property_collection_sdna(prop, nullptr, "thickness_modifiers", nullptr);
1954 RNA_def_property_struct_type(prop, "LineStyleThicknessModifier");
1955 RNA_def_property_ui_text(prop, "Thickness Modifiers", "List of line thickness modifiers");
1957
1958 prop = RNA_def_property(srna, "geometry_modifiers", PROP_COLLECTION, PROP_NONE);
1959 RNA_def_property_collection_sdna(prop, nullptr, "geometry_modifiers", nullptr);
1960 RNA_def_property_struct_type(prop, "LineStyleGeometryModifier");
1961 RNA_def_property_ui_text(prop, "Geometry Modifiers", "List of stroke geometry modifiers");
1963
1964 prop = RNA_def_property(srna, "use_chaining", PROP_BOOLEAN, PROP_NONE);
1966 RNA_def_property_ui_text(prop, "Chaining", "Enable chaining of feature edges");
1967 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1968
1969 prop = RNA_def_property(srna, "chaining", PROP_ENUM, PROP_NONE);
1970 RNA_def_property_enum_sdna(prop, nullptr, "chaining");
1971 RNA_def_property_enum_items(prop, chaining_items);
1973 prop, "Chaining Method", "Select the way how feature edges are jointed to form chains");
1974 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1975
1976 prop = RNA_def_property(srna, "rounds", PROP_INT, PROP_UNSIGNED);
1977 RNA_def_property_int_sdna(prop, nullptr, "rounds");
1978 RNA_def_property_range(prop, 1, 1000);
1979 RNA_def_property_ui_text(prop, "Rounds", "Number of rounds in a sketchy multiple touch");
1980 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1981
1982 prop = RNA_def_property(srna, "use_same_object", PROP_BOOLEAN, PROP_NONE);
1983 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_SAME_OBJECT);
1985 prop, "Same Object", "If true, only feature edges of the same object are joined");
1986 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1987
1988 prop = RNA_def_property(srna, "use_split_length", PROP_BOOLEAN, PROP_NONE);
1989 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_SPLIT_LENGTH);
1991 prop, "Use Split Length", "Enable chain splitting by curvilinear 2D length");
1992 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1993
1994 prop = RNA_def_property(srna, "split_length", PROP_FLOAT, PROP_NONE);
1995 RNA_def_property_float_sdna(prop, nullptr, "split_length");
1996 RNA_def_property_range(prop, 0.0f, 10000.0f);
1997 RNA_def_property_ui_text(prop, "Split Length", "Curvilinear 2D length for chain splitting");
1998 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
1999
2000 prop = RNA_def_property(srna, "use_angle_min", PROP_BOOLEAN, PROP_NONE);
2001 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MIN_2D_ANGLE);
2003 "Use Min 2D Angle",
2004 "Split chains at points with angles smaller than the minimum 2D angle");
2005 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2006
2007 prop = RNA_def_property(srna, "angle_min", PROP_FLOAT, PROP_ANGLE);
2008 RNA_def_property_float_sdna(prop, nullptr, "min_angle");
2009 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
2010 RNA_def_property_ui_text(prop, "Min 2D Angle", "Minimum 2D angle for splitting chains");
2011 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2012
2013 prop = RNA_def_property(srna, "use_angle_max", PROP_BOOLEAN, PROP_NONE);
2014 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MAX_2D_ANGLE);
2016 "Use Max 2D Angle",
2017 "Split chains at points with angles larger than the maximum 2D angle");
2018 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2019
2020 prop = RNA_def_property(srna, "angle_max", PROP_FLOAT, PROP_ANGLE);
2021 RNA_def_property_float_sdna(prop, nullptr, "max_angle");
2022 RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
2023 RNA_def_property_ui_text(prop, "Max 2D Angle", "Maximum 2D angle for splitting chains");
2024 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2025
2026 prop = RNA_def_property(srna, "use_length_min", PROP_BOOLEAN, PROP_NONE);
2027 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MIN_2D_LENGTH);
2029 prop, "Use Min 2D Length", "Enable the selection of chains by a minimum 2D length");
2030 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2031
2032 prop = RNA_def_property(srna, "length_min", PROP_FLOAT, PROP_NONE);
2033 RNA_def_property_float_sdna(prop, nullptr, "min_length");
2034 RNA_def_property_range(prop, 0.0f, 10000.0f);
2036 prop, "Min 2D Length", "Minimum curvilinear 2D length for the selection of chains");
2037 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2038
2039 prop = RNA_def_property(srna, "use_length_max", PROP_BOOLEAN, PROP_NONE);
2040 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_MAX_2D_LENGTH);
2042 prop, "Use Max 2D Length", "Enable the selection of chains by a maximum 2D length");
2043 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2044
2045 prop = RNA_def_property(srna, "length_max", PROP_FLOAT, PROP_NONE);
2046 RNA_def_property_float_sdna(prop, nullptr, "max_length");
2047 RNA_def_property_range(prop, 0.0f, 10000.0f);
2049 prop, "Max 2D Length", "Maximum curvilinear 2D length for the selection of chains");
2050 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2051
2052 prop = RNA_def_property(srna, "use_chain_count", PROP_BOOLEAN, PROP_NONE);
2053 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_CHAIN_COUNT);
2054 RNA_def_property_ui_text(prop, "Use Chain Count", "Enable the selection of first N chains");
2055 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2056
2057 prop = RNA_def_property(srna, "chain_count", PROP_INT, PROP_UNSIGNED);
2058 RNA_def_property_int_sdna(prop, nullptr, "chain_count");
2059 RNA_def_property_ui_text(prop, "Chain Count", "Chain count for the selection of first N chains");
2060 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2061
2062 prop = RNA_def_property(srna, "use_split_pattern", PROP_BOOLEAN, PROP_NONE);
2063 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_SPLIT_PATTERN);
2065 prop, "Use Split Pattern", "Enable chain splitting by dashed line patterns");
2066 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2067
2068 prop = RNA_def_property(srna, "split_dash1", PROP_INT, PROP_UNSIGNED);
2069 RNA_def_property_int_sdna(prop, nullptr, "split_dash1");
2070 RNA_def_property_range(prop, 0, USHRT_MAX);
2071 RNA_def_property_ui_text(prop, "Split Dash 1", "Length of the 1st dash for splitting");
2072 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2073
2074 prop = RNA_def_property(srna, "split_gap1", PROP_INT, PROP_UNSIGNED);
2075 RNA_def_property_int_sdna(prop, nullptr, "split_gap1");
2076 RNA_def_property_range(prop, 0, USHRT_MAX);
2077 RNA_def_property_ui_text(prop, "Split Gap 1", "Length of the 1st gap for splitting");
2078 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2079
2080 prop = RNA_def_property(srna, "split_dash2", PROP_INT, PROP_UNSIGNED);
2081 RNA_def_property_int_sdna(prop, nullptr, "split_dash2");
2082 RNA_def_property_range(prop, 0, USHRT_MAX);
2083 RNA_def_property_ui_text(prop, "Split Dash 2", "Length of the 2nd dash for splitting");
2084 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2085
2086 prop = RNA_def_property(srna, "split_gap2", PROP_INT, PROP_UNSIGNED);
2087 RNA_def_property_int_sdna(prop, nullptr, "split_gap2");
2088 RNA_def_property_range(prop, 0, USHRT_MAX);
2089 RNA_def_property_ui_text(prop, "Split Gap 2", "Length of the 2nd gap for splitting");
2090 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2091
2092 prop = RNA_def_property(srna, "split_dash3", PROP_INT, PROP_UNSIGNED);
2093 RNA_def_property_int_sdna(prop, nullptr, "split_dash3");
2094 RNA_def_property_range(prop, 0, USHRT_MAX);
2095 RNA_def_property_ui_text(prop, "Split Dash 3", "Length of the 3rd dash for splitting");
2096 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2097
2098 prop = RNA_def_property(srna, "split_gap3", PROP_INT, PROP_UNSIGNED);
2099 RNA_def_property_int_sdna(prop, nullptr, "split_gap3");
2100 RNA_def_property_range(prop, 0, USHRT_MAX);
2101 RNA_def_property_ui_text(prop, "Split Gap 3", "Length of the 3rd gap for splitting");
2102 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2103
2104 prop = RNA_def_property(srna, "material_boundary", PROP_BOOLEAN, PROP_NONE);
2107 "Material Boundary",
2108 "If true, chains of feature edges are split at material boundaries");
2109 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2110
2111 prop = RNA_def_property(srna, "use_sorting", PROP_BOOLEAN, PROP_NONE);
2113 RNA_def_property_ui_text(prop, "Sorting", "Arrange the stacking order of strokes");
2114 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2115
2116 prop = RNA_def_property(srna, "sort_key", PROP_ENUM, PROP_NONE);
2117 RNA_def_property_enum_sdna(prop, nullptr, "sort_key");
2118 RNA_def_property_enum_items(prop, sort_key_items);
2120 prop, "Sort Key", "Select the sort key to determine the stacking order of chains");
2121 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2122
2123 prop = RNA_def_property(srna, "sort_order", PROP_ENUM, PROP_NONE);
2124 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "flag");
2125 RNA_def_property_enum_items(prop, sort_order_items);
2126 RNA_def_property_ui_text(prop, "Sort Order", "Select the sort order");
2127 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2128
2129 prop = RNA_def_property(srna, "integration_type", PROP_ENUM, PROP_NONE);
2130 RNA_def_property_enum_sdna(prop, nullptr, "integration_type");
2131 RNA_def_property_enum_items(prop, integration_type_items);
2133 prop, "Integration Type", "Select the way how the sort key is computed for each chain");
2134 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2135
2136 prop = RNA_def_property(srna, "use_dashed_line", PROP_BOOLEAN, PROP_NONE);
2137 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_DASHED_LINE);
2138 RNA_def_property_ui_text(prop, "Dashed Line", "Enable or disable dashed line");
2139 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2140
2141 prop = RNA_def_property(srna, "caps", PROP_ENUM, PROP_NONE);
2142 RNA_def_property_enum_bitflag_sdna(prop, nullptr, "caps");
2143 RNA_def_property_enum_items(prop, cap_items);
2144 RNA_def_property_ui_text(prop, "Caps", "Select the shape of both ends of strokes");
2145 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2146
2147 prop = RNA_def_property(srna, "dash1", PROP_INT, PROP_UNSIGNED);
2148 RNA_def_property_int_sdna(prop, nullptr, "dash1");
2149 RNA_def_property_range(prop, 0, USHRT_MAX);
2150 RNA_def_property_ui_text(prop, "Dash 1", "Length of the 1st dash for dashed lines");
2151 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2152
2153 prop = RNA_def_property(srna, "gap1", PROP_INT, PROP_UNSIGNED);
2154 RNA_def_property_int_sdna(prop, nullptr, "gap1");
2155 RNA_def_property_range(prop, 0, USHRT_MAX);
2156 RNA_def_property_ui_text(prop, "Gap 1", "Length of the 1st gap for dashed lines");
2157 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2158
2159 prop = RNA_def_property(srna, "dash2", PROP_INT, PROP_UNSIGNED);
2160 RNA_def_property_int_sdna(prop, nullptr, "dash2");
2161 RNA_def_property_range(prop, 0, USHRT_MAX);
2162 RNA_def_property_ui_text(prop, "Dash 2", "Length of the 2nd dash for dashed lines");
2163 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2164
2165 prop = RNA_def_property(srna, "gap2", PROP_INT, PROP_UNSIGNED);
2166 RNA_def_property_int_sdna(prop, nullptr, "gap2");
2167 RNA_def_property_range(prop, 0, USHRT_MAX);
2168 RNA_def_property_ui_text(prop, "Gap 2", "Length of the 2nd gap for dashed lines");
2169 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2170
2171 prop = RNA_def_property(srna, "dash3", PROP_INT, PROP_UNSIGNED);
2172 RNA_def_property_int_sdna(prop, nullptr, "dash3");
2173 RNA_def_property_range(prop, 0, USHRT_MAX);
2174 RNA_def_property_ui_text(prop, "Dash 3", "Length of the 3rd dash for dashed lines");
2175 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2176
2177 prop = RNA_def_property(srna, "gap3", PROP_INT, PROP_UNSIGNED);
2178 RNA_def_property_int_sdna(prop, nullptr, "gap3");
2179 RNA_def_property_range(prop, 0, USHRT_MAX);
2180 RNA_def_property_ui_text(prop, "Gap 3", "Length of the 3rd gap for dashed lines");
2181 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2182
2183 prop = RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE);
2184 RNA_def_property_boolean_sdna(prop, nullptr, "flag", LS_TEXTURE);
2185 RNA_def_property_ui_text(prop, "Use Textures", "Enable or disable textured strokes");
2186 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2187
2188 prop = RNA_def_property(srna, "texture_spacing", PROP_FLOAT, PROP_FACTOR);
2189 RNA_def_property_float_sdna(prop, nullptr, "texstep");
2190 RNA_def_property_range(prop, 0.01f, 100.0f);
2191 RNA_def_property_ui_text(prop, "Texture Spacing", "Spacing for textures along stroke length");
2192 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
2193
2194 /* anim */
2196
2197 /* nodes */
2198 prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
2199 RNA_def_property_pointer_sdna(prop, nullptr, "nodetree");
2202 RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based shaders");
2203
2204 prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
2205 RNA_def_property_boolean_sdna(prop, nullptr, "use_nodes", 1);
2208 RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes for the line style");
2209 RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_use_nodes_update");
2210}
2211
2218
2219#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:930
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)
LineStyleModifier * BKE_linestyle_color_modifier_add(FreestyleLineStyle *linestyle, const char *name, int type)
Definition linestyle.cc:780
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
@ RPT_ERROR
Definition BKE_report.hh:39
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:153
struct Tex * give_current_linestyle_texture(struct FreestyleLineStyle *linestyle)
Definition texture.cc:443
void set_current_linestyle_texture(struct FreestyleLineStyle *linestyle, struct Tex *tex)
Definition texture.cc:458
#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_AMOUNT
#define BLT_I18NCONTEXT_ID_IMAGE
#define BLT_I18NCONTEXT_ID_TEXTURE
void DEG_id_tag_update(ID *id, unsigned int flags)
@ LS_MODIFIER_SPATIAL_NOISE_PURERANDOM
@ LS_MODIFIER_SPATIAL_NOISE_SMOOTH
@ 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
#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_BLUEPRINT_SQUARES
@ LS_MODIFIER_BLUEPRINT_CIRCLES
@ LS_MODIFIER_BLUEPRINT_ELLIPSES
@ 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_THICKNESS_RELATIVE
@ LS_THICKNESS_CENTER
@ LS_THICKNESS_INSIDE
@ LS_THICKNESS_OUTSIDE
@ LS_THICKNESS_ASYMMETRIC
@ LS_INTEGRATION_MEAN
@ LS_INTEGRATION_FIRST
@ LS_INTEGRATION_MAX
@ LS_INTEGRATION_LAST
@ LS_INTEGRATION_MIN
@ 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_USE_RAMP
@ 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_INVERT
@ LS_MODIFIER_USE_CURVE
@ 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_SORT_KEY_PROJECTED_X
@ LS_SORT_KEY_2D_LENGTH
@ LS_SORT_KEY_DISTANCE_FROM_CAMERA
@ LS_SORT_KEY_PROJECTED_Y
@ LS_MODIFIER_EXPANDED
@ LS_MODIFIER_ENABLED
@ TEXCO_WINDOW
@ TEXCO_ORCO
@ TEXCO_GLOB
@ MAP_ALPHA
@ MTEX_FLAT
@ MTEX_SPHERE
@ MTEX_CUBE
@ MTEX_TUBE
ParameterFlag
Definition RNA_types.hh:544
@ PARM_RNAPTR
Definition RNA_types.hh:547
@ PARM_REQUIRED
Definition RNA_types.hh:545
@ FUNC_USE_REPORTS
Definition RNA_types.hh:914
@ PROP_FLOAT
Definition RNA_types.hh:164
@ PROP_BOOLEAN
Definition RNA_types.hh:162
@ PROP_ENUM
Definition RNA_types.hh:166
@ PROP_INT
Definition RNA_types.hh:163
@ PROP_STRING
Definition RNA_types.hh:165
@ PROP_POINTER
Definition RNA_types.hh:167
@ PROP_COLLECTION
Definition RNA_types.hh:168
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition RNA_types.hh:503
PropertyFlag
Definition RNA_types.hh:300
@ PROP_THICK_WRAP
Definition RNA_types.hh:423
@ PROP_CONTEXT_UPDATE
Definition RNA_types.hh:407
@ PROP_ANIMATABLE
Definition RNA_types.hh:319
@ PROP_PROPORTIONAL
Definition RNA_types.hh:349
@ PROP_EDITABLE
Definition RNA_types.hh:306
@ PROP_NEVER_NULL
Definition RNA_types.hh:377
@ PROP_PTR_NO_OWNERSHIP
Definition RNA_types.hh:395
@ PROP_DISTANCE
Definition RNA_types.hh:256
@ PROP_COLOR
Definition RNA_types.hh:260
@ PROP_ANGLE
Definition RNA_types.hh:252
@ PROP_NONE
Definition RNA_types.hh:233
@ PROP_FACTOR
Definition RNA_types.hh:251
@ PROP_UNSIGNED
Definition RNA_types.hh:249
#define C
Definition RandGen.cpp:29
#define MAX_MTEX
Definition Stroke.h:31
#define NC_LINESTYLE
Definition WM_types.hh:400
#define offsetof(t, d)
const char * name
void rna_iterator_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, void *data, size_t itemsize, int64_t length, bool free_ptr, IteratorSkipFunc skip)
PointerRNA RNA_id_pointer_create(ID *id)
void rna_def_animdata_common(StructRNA *srna)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
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_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
Definition DNA_ID.h:414
void invalidate()
Definition RNA_types.hh:110
void * data
Definition RNA_types.hh:53
static int blend(const Tex *tex, const float texvec[3], TexResult *texres)
void WM_main_add_notifier(uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4238