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