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