Blender  V3.3
rna_curve.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stdlib.h>
8 
9 #include "DNA_curve_types.h"
10 #include "DNA_key_types.h"
11 #include "DNA_material_types.h"
12 #include "DNA_scene_types.h"
13 
14 #include "BLI_math.h"
15 #include "BLI_utildefines.h"
16 
17 #include "BLT_translation.h"
18 
19 #include "BKE_vfont.h"
20 
21 #include "RNA_access.h"
22 #include "RNA_define.h"
23 #include "RNA_enum_types.h"
24 
25 #include "rna_internal.h"
26 
27 #include "WM_types.h"
28 
29 #ifndef RNA_RUNTIME
31  {HD_FREE, "FREE", 0, "Free", ""},
32  {HD_VECT, "VECTOR", 0, "Vector", ""},
33  {HD_ALIGN, "ALIGNED", 0, "Aligned", ""},
34  {HD_AUTO, "AUTO", 0, "Auto", ""},
35  {0, NULL, 0, NULL, NULL},
36 };
37 #endif
38 
40  {HD_FREE, "FREE", ICON_HANDLE_FREE, "Free", "Completely independent manually set handle"},
41  {HD_ALIGN,
42  "ALIGNED",
43  ICON_HANDLE_ALIGNED,
44  "Aligned",
45  "Manually set handle with rotation locked together with its pair"},
46  {HD_VECT,
47  "VECTOR",
48  ICON_HANDLE_VECTOR,
49  "Vector",
50  "Automatic handles that create straight lines"},
51  {HD_AUTO,
52  "AUTO",
53  ICON_HANDLE_AUTO,
54  "Automatic",
55  "Automatic handles that create smooth curves"},
56  {HD_AUTO_ANIM,
57  "AUTO_CLAMPED",
58  ICON_HANDLE_AUTOCLAMPED,
59  "Auto Clamped",
60  "Automatic handles that create smooth curves which only change direction at keyframes"},
61  {0, NULL, 0, NULL, NULL},
62 };
63 
69  /* Interpolation. */
71  N_("Standard transitions between keyframes")),
73  "CONSTANT",
74  ICON_IPO_CONSTANT,
75  "Constant",
76  "No interpolation, value of A gets held until B is encountered"},
77  {BEZT_IPO_LIN,
78  "LINEAR",
79  ICON_IPO_LINEAR,
80  "Linear",
81  "Straight-line interpolation between A and B (i.e. no ease in/out)"},
82  {BEZT_IPO_BEZ,
83  "BEZIER",
84  ICON_IPO_BEZIER,
85  "Bezier",
86  "Smooth interpolation between A and B, with some control over curve shape"},
87 
88  /* Easing. */
90  N_("Predefined inertial transitions, useful for motion graphics "
91  "(from least to most \"dramatic\")")),
93  "SINE",
94  ICON_IPO_SINE,
95  "Sinusoidal",
96  "Sinusoidal easing (weakest, almost linear but with a slight curvature)"},
97  {BEZT_IPO_QUAD, "QUAD", ICON_IPO_QUAD, "Quadratic", "Quadratic easing"},
98  {BEZT_IPO_CUBIC, "CUBIC", ICON_IPO_CUBIC, "Cubic", "Cubic easing"},
99  {BEZT_IPO_QUART, "QUART", ICON_IPO_QUART, "Quartic", "Quartic easing"},
100  {BEZT_IPO_QUINT, "QUINT", ICON_IPO_QUINT, "Quintic", "Quintic easing"},
101  {BEZT_IPO_EXPO, "EXPO", ICON_IPO_EXPO, "Exponential", "Exponential easing (dramatic)"},
102  {BEZT_IPO_CIRC,
103  "CIRC",
104  ICON_IPO_CIRC,
105  "Circular",
106  "Circular easing (strongest and most dynamic)"},
107 
109  N_("Simple physics-inspired easing effects")),
110  {BEZT_IPO_BACK, "BACK", ICON_IPO_BACK, "Back", "Cubic easing with overshoot and settle"},
112  "BOUNCE",
113  ICON_IPO_BOUNCE,
114  "Bounce",
115  "Exponentially decaying parabolic bounce, like when objects collide"},
117  "ELASTIC",
118  ICON_IPO_ELASTIC,
119  "Elastic",
120  "Exponentially decaying sine wave, like an elastic band"},
121 
122  {0, NULL, 0, NULL, NULL},
123 };
124 
125 #ifndef RNA_RUNTIME
127  {CU_POLY, "POLY", 0, "Poly", ""},
128  {CU_BEZIER, "BEZIER", 0, "Bezier", ""},
129  {CU_NURBS, "NURBS", 0, "Ease", ""},
130  {0, NULL, 0, NULL, NULL},
131 };
132 #endif
133 
135  {0, "FULL", 0, "Full", ""},
136  {CU_BACK, "BACK", 0, "Back", ""},
137  {CU_FRONT, "FRONT", 0, "Front", ""},
138  {CU_FRONT | CU_BACK, "HALF", 0, "Half", ""},
139  {0, NULL, 0, NULL, NULL},
140 };
141 
142 #ifdef RNA_RUNTIME
143 static const EnumPropertyItem curve2d_fill_mode_items[] = {
144  {0, "NONE", 0, "None", ""},
145  {CU_BACK, "BACK", 0, "Back", ""},
146  {CU_FRONT, "FRONT", 0, "Front", ""},
147  {CU_FRONT | CU_BACK, "BOTH", 0, "Both", ""},
148  {0, NULL, 0, NULL, NULL},
149 };
150 #endif
151 
152 #ifdef RNA_RUNTIME
153 
154 # include "DNA_object_types.h"
155 
156 # include "BKE_curve.h"
157 # include "BKE_curveprofile.h"
158 # include "BKE_main.h"
159 
160 # include "DEG_depsgraph.h"
161 # include "DEG_depsgraph_build.h"
162 
163 # include "WM_api.h"
164 
165 # include "MEM_guardedalloc.h"
166 
167 # include "ED_curve.h" /* for BKE_curve_nurbs_get */
168 
169 /* highly irritating but from RNA we can't know this */
170 static Nurb *curve_nurb_from_point(Curve *cu, const void *point, int *nu_index, int *pt_index)
171 {
172  ListBase *nurbs = BKE_curve_nurbs_get(cu);
173  Nurb *nu;
174  int i = 0;
175 
176  for (nu = nurbs->first; nu; nu = nu->next, i++) {
177  if (nu->type == CU_BEZIER) {
178  if (point >= (void *)nu->bezt && point < (void *)(nu->bezt + nu->pntsu)) {
179  break;
180  }
181  }
182  else {
183  if (point >= (void *)nu->bp && point < (void *)(nu->bp + (nu->pntsu * nu->pntsv))) {
184  break;
185  }
186  }
187  }
188 
189  if (nu) {
190  if (nu_index) {
191  *nu_index = i;
192  }
193 
194  if (pt_index) {
195  if (nu->type == CU_BEZIER) {
196  *pt_index = (int)((BezTriple *)point - nu->bezt);
197  }
198  else {
199  *pt_index = (int)((BPoint *)point - nu->bp);
200  }
201  }
202  }
203 
204  return nu;
205 }
206 
207 static StructRNA *rna_Curve_refine(PointerRNA *ptr)
208 {
209  Curve *cu = (Curve *)ptr->data;
210  short obtype = BKE_curve_type_get(cu);
211 
212  if (obtype == OB_FONT) {
213  return &RNA_TextCurve;
214  }
215  else if (obtype == OB_SURF) {
216  return &RNA_SurfaceCurve;
217  }
218  else {
219  return &RNA_Curve;
220  }
221 }
222 
223 static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values)
224 {
225  BezTriple *bezt = (BezTriple *)ptr->data;
226  copy_v3_v3(values, bezt->vec[0]);
227 }
228 
229 static void rna_BezTriple_handle1_set(PointerRNA *ptr, const float *values)
230 {
231  BezTriple *bezt = (BezTriple *)ptr->data;
232  copy_v3_v3(bezt->vec[0], values);
233 }
234 
235 static void rna_BezTriple_handle2_get(PointerRNA *ptr, float *values)
236 {
237  BezTriple *bezt = (BezTriple *)ptr->data;
238  copy_v3_v3(values, bezt->vec[2]);
239 }
240 
241 static void rna_BezTriple_handle2_set(PointerRNA *ptr, const float *values)
242 {
243  BezTriple *bezt = (BezTriple *)ptr->data;
244  copy_v3_v3(bezt->vec[2], values);
245 }
246 
247 static void rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, float *values)
248 {
249  BezTriple *bezt = (BezTriple *)ptr->data;
250  copy_v3_v3(values, bezt->vec[1]);
251 }
252 
253 static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values)
254 {
255  BezTriple *bezt = (BezTriple *)ptr->data;
256  copy_v3_v3(bezt->vec[1], values);
257 }
258 
259 static void rna_Curve_texspace_set(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
260 {
261  Curve *cu = (Curve *)ptr->data;
262 
263  if (cu->texflag & CU_AUTOSPACE) {
265  }
266 }
267 
268 static int rna_Curve_texspace_editable(PointerRNA *ptr, const char **UNUSED(r_info))
269 {
270  Curve *cu = (Curve *)ptr->data;
272 }
273 
274 static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values)
275 {
276  Curve *cu = (Curve *)ptr->data;
277 
279 
280  copy_v3_v3(values, cu->loc);
281 }
282 
283 static void rna_Curve_texspace_loc_set(PointerRNA *ptr, const float *values)
284 {
285  Curve *cu = (Curve *)ptr->data;
286 
287  copy_v3_v3(cu->loc, values);
288 }
289 
290 static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values)
291 {
292  Curve *cu = (Curve *)ptr->data;
293 
295 
296  copy_v3_v3(values, cu->size);
297 }
298 
299 static void rna_Curve_texspace_size_set(PointerRNA *ptr, const float *values)
300 {
301  Curve *cu = (Curve *)ptr->data;
302 
303  copy_v3_v3(cu->size, values);
304 }
305 
306 static void rna_Curve_material_index_range(
307  PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
308 {
309  Curve *cu = (Curve *)ptr->owner_id;
310  *min = 0;
311  *max = max_ii(0, cu->totcol - 1);
312 }
313 
314 /* simply offset by don't expose -1 */
315 static int rna_ChariInfo_material_index_get(PointerRNA *ptr)
316 {
317  CharInfo *info = ptr->data;
318  return info->mat_nr ? info->mat_nr - 1 : 0;
319 }
320 
321 static void rna_ChariInfo_material_index_set(PointerRNA *ptr, int value)
322 {
323  CharInfo *info = ptr->data;
324  info->mat_nr = value + 1;
325 }
326 
327 static void rna_Curve_active_textbox_index_range(
328  PointerRNA *ptr, int *min, int *max, int *UNUSED(softmin), int *UNUSED(softmax))
329 {
330  Curve *cu = (Curve *)ptr->owner_id;
331  *min = 0;
332  *max = max_ii(0, cu->totbox - 1);
333 }
334 
335 static void rna_Curve_dimension_set(PointerRNA *ptr, int value)
336 {
337  Curve *cu = (Curve *)ptr->owner_id;
338  if (value == CU_3D) {
339  cu->flag |= CU_3D;
340  }
341  else {
342  cu->flag &= ~CU_3D;
344  }
345 }
346 
347 static const EnumPropertyItem *rna_Curve_fill_mode_itemf(bContext *UNUSED(C),
348  PointerRNA *ptr,
349  PropertyRNA *UNUSED(prop),
350  bool *UNUSED(r_free))
351 {
352  Curve *cu = (Curve *)ptr->owner_id;
353 
354  /* cast to quiet warning it IS a const still */
356  curve2d_fill_mode_items);
357 }
358 
359 static int rna_Nurb_length(PointerRNA *ptr)
360 {
361  Nurb *nu = (Nurb *)ptr->data;
362  if (nu->type == CU_BEZIER) {
363  return 0;
364  }
365  return nu->pntsv > 0 ? nu->pntsu * nu->pntsv : nu->pntsu;
366 }
367 
368 static void rna_Nurb_type_set(PointerRNA *ptr, int value)
369 {
370  Curve *cu = (Curve *)ptr->owner_id;
371  Nurb *nu = (Nurb *)ptr->data;
372  const int pntsu_prev = nu->pntsu;
373 
374  if (BKE_nurb_type_convert(nu, value, true, NULL)) {
375  if (nu->pntsu != pntsu_prev) {
376  cu->actvert = CU_ACT_NONE;
377  }
378  }
379 }
380 
381 static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
382 {
383  Nurb *nu = (Nurb *)ptr->data;
385  (void *)nu->bp,
386  sizeof(BPoint),
387  nu->pntsv > 0 ? nu->pntsu * nu->pntsv : nu->pntsu,
388  0,
389  NULL);
390 }
391 
392 static void rna_Curve_update_data_id(Main *UNUSED(bmain), Scene *UNUSED(scene), ID *id)
393 {
394  DEG_id_tag_update(id, 0);
396 }
397 
398 static void rna_Curve_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
399 {
400  rna_Curve_update_data_id(bmain, scene, ptr->owner_id);
401 }
402 
403 static void rna_Curve_update_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
404 {
406  rna_Curve_update_data(bmain, scene, ptr);
407 }
408 
409 static void rna_Curve_update_points(Main *bmain, Scene *scene, PointerRNA *ptr)
410 {
411  Curve *cu = (Curve *)ptr->owner_id;
412  Nurb *nu = curve_nurb_from_point(cu, ptr->data, NULL, NULL);
413 
414  if (nu) {
416  }
417 
418  rna_Curve_update_data(bmain, scene, ptr);
419 }
420 
421 static PointerRNA rna_Curve_bevelObject_get(PointerRNA *ptr)
422 {
423  Curve *cu = (Curve *)ptr->owner_id;
424  Object *ob = cu->bevobj;
425 
426  if (ob) {
427  return rna_pointer_inherit_refine(ptr, &RNA_Object, ob);
428  }
429 
431 }
432 
433 static void rna_Curve_bevelObject_set(PointerRNA *ptr,
434  PointerRNA value,
435  struct ReportList *UNUSED(reports))
436 {
437  Curve *cu = (Curve *)ptr->owner_id;
438  Object *ob = (Object *)value.data;
439 
440  if (ob) {
441  /* If bevel object has got the save curve, as object, for which it's set as bevobj,
442  * there could be infinity loop in #DispList calculation. */
443  if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
444  cu->bevobj = ob;
445  id_lib_extern((ID *)ob);
446  }
447  }
448  else {
449  cu->bevobj = NULL;
450  }
451 }
452 
457 static void rna_Curve_bevel_resolution_update(Main *bmain, Scene *scene, PointerRNA *ptr)
458 {
459  Curve *cu = (Curve *)ptr->data;
460 
463  }
464 
465  rna_Curve_update_data(bmain, scene, ptr);
466 }
467 
468 static void rna_Curve_bevel_mode_set(PointerRNA *ptr, int value)
469 {
470  Curve *cu = (Curve *)ptr->owner_id;
471 
472  if (value == CU_BEV_MODE_CURVE_PROFILE) {
473  if (cu->bevel_profile == NULL) {
476  }
477  }
478 
479  cu->bevel_mode = value;
480 }
481 
482 static bool rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value)
483 {
484  Curve *cu = (Curve *)ptr->owner_id;
485  Object *ob = (Object *)value.data;
486 
487  if (ob) {
488  if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
489  return 1;
490  }
491  }
492 
493  return 0;
494 }
495 
496 static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr)
497 {
498  Curve *cu = (Curve *)ptr->owner_id;
499  Object *ob = cu->taperobj;
500 
501  if (ob) {
502  return rna_pointer_inherit_refine(ptr, &RNA_Object, ob);
503  }
504 
506 }
507 
508 static void rna_Curve_taperObject_set(PointerRNA *ptr,
509  PointerRNA value,
510  struct ReportList *UNUSED(reports))
511 {
512  Curve *cu = (Curve *)ptr->owner_id;
513  Object *ob = (Object *)value.data;
514 
515  if (ob) {
516  /* If taper object has got the save curve, as object, for which it's set as bevobj,
517  * there could be infinity loop in #DispList calculation. */
518  if (ob->type == OB_CURVES_LEGACY && ob->data != cu) {
519  cu->taperobj = ob;
520  id_lib_extern((ID *)ob);
521  }
522  }
523  else {
524  cu->taperobj = NULL;
525  }
526 }
527 
528 static void rna_Curve_resolution_u_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
529 {
530  Curve *cu = (Curve *)ptr->owner_id;
531  ListBase *nurbs = BKE_curve_nurbs_get(cu);
532 
533  LISTBASE_FOREACH (Nurb *, nu, nurbs) {
534  nu->resolu = cu->resolu;
535  }
536 
537  rna_Curve_update_data(bmain, scene, ptr);
538 }
539 
540 static void rna_Curve_resolution_v_update_data(Main *bmain, Scene *scene, PointerRNA *ptr)
541 {
542  Curve *cu = (Curve *)ptr->owner_id;
543  ListBase *nurbs = BKE_curve_nurbs_get(cu);
544 
545  LISTBASE_FOREACH (Nurb *, nu, nurbs) {
546  nu->resolv = cu->resolv;
547  }
548 
549  rna_Curve_update_data(bmain, scene, ptr);
550 }
551 
552 static float rna_Curve_offset_get(PointerRNA *ptr)
553 {
554  Curve *cu = (Curve *)ptr->owner_id;
555  return cu->offset - 1.0f;
556 }
557 
558 static void rna_Curve_offset_set(PointerRNA *ptr, float value)
559 {
560  Curve *cu = (Curve *)ptr->owner_id;
561  cu->offset = 1.0f + value;
562 }
563 
564 static int rna_Curve_body_length(PointerRNA *ptr);
565 static void rna_Curve_body_get(PointerRNA *ptr, char *value)
566 {
567  Curve *cu = (Curve *)ptr->owner_id;
568  BLI_strncpy(value, cu->str, rna_Curve_body_length(ptr) + 1);
569 }
570 
571 static int rna_Curve_body_length(PointerRNA *ptr)
572 {
573  Curve *cu = (Curve *)ptr->owner_id;
574  return cu->len;
575 }
576 
577 /* TODO: how to handle editmode? */
578 static void rna_Curve_body_set(PointerRNA *ptr, const char *value)
579 {
580  size_t len_bytes;
581  size_t len_chars = BLI_strlen_utf8_ex(value, &len_bytes);
582 
583  Curve *cu = (Curve *)ptr->owner_id;
584 
585  cu->len_char32 = len_chars;
586  cu->len = len_bytes;
587  cu->pos = len_chars;
588 
589  if (cu->str) {
590  MEM_freeN(cu->str);
591  }
592  if (cu->strinfo) {
593  MEM_freeN(cu->strinfo);
594  }
595 
596  cu->str = MEM_mallocN(len_bytes + sizeof(char32_t), "str");
597  cu->strinfo = MEM_callocN((len_chars + 4) * sizeof(CharInfo), "strinfo");
598 
599  BLI_strncpy(cu->str, value, len_bytes + 1);
600 }
601 
602 static void rna_Nurb_update_cyclic_u(Main *bmain, Scene *scene, PointerRNA *ptr)
603 {
604  Nurb *nu = (Nurb *)ptr->data;
605 
606  if (nu->type == CU_BEZIER) {
608  }
609  else {
611  }
612 
613  rna_Curve_update_data(bmain, scene, ptr);
614 }
615 
616 static void rna_Nurb_update_cyclic_v(Main *bmain, Scene *scene, PointerRNA *ptr)
617 {
618  Nurb *nu = (Nurb *)ptr->data;
619 
621 
622  rna_Curve_update_data(bmain, scene, ptr);
623 }
624 
625 static void rna_Nurb_update_knot_u(Main *bmain, Scene *scene, PointerRNA *ptr)
626 {
627  Nurb *nu = (Nurb *)ptr->data;
628 
631 
632  rna_Curve_update_data(bmain, scene, ptr);
633 }
634 
635 static void rna_Nurb_update_knot_v(Main *bmain, Scene *scene, PointerRNA *ptr)
636 {
637  Nurb *nu = (Nurb *)ptr->data;
638 
641 
642  rna_Curve_update_data(bmain, scene, ptr);
643 }
644 
645 static void rna_Curve_spline_points_add(ID *id, Nurb *nu, ReportList *reports, int number)
646 {
647  if (nu->type == CU_BEZIER) {
648  BKE_report(reports, RPT_ERROR, "Bezier spline cannot have points added");
649  }
650  else if (number == 0) {
651  /* do nothing */
652  }
653  else {
654 
655  BKE_nurb_points_add(nu, number);
656 
657  /* update */
659 
660  rna_Curve_update_data_id(NULL, NULL, id);
661  }
662 }
663 
664 static void rna_Curve_spline_bezpoints_add(ID *id, Nurb *nu, ReportList *reports, int number)
665 {
666  if (nu->type != CU_BEZIER) {
667  BKE_report(reports, RPT_ERROR, "Only Bezier splines can be added");
668  }
669  else if (number == 0) {
670  /* do nothing */
671  }
672  else {
673  BKE_nurb_bezierPoints_add(nu, number);
674 
675  /* update */
677 
678  rna_Curve_update_data_id(NULL, NULL, id);
679  }
680 }
681 
682 static Nurb *rna_Curve_spline_new(Curve *cu, int type)
683 {
684  Nurb *nu = (Nurb *)MEM_callocN(sizeof(Nurb), "spline.new");
685 
686  if (type == CU_BEZIER) {
687  BezTriple *bezt = (BezTriple *)MEM_callocN(sizeof(BezTriple), "spline.new.bezt");
688  bezt->radius = 1.0;
689  nu->bezt = bezt;
690  }
691  else {
692  BPoint *bp = (BPoint *)MEM_callocN(sizeof(BPoint), "spline.new.bp");
693  bp->radius = 1.0f;
694  nu->bp = bp;
695  }
696 
697  nu->type = type;
698  nu->pntsu = 1;
699  nu->pntsv = 1;
700 
701  nu->orderu = nu->orderv = 4;
702  nu->resolu = cu->resolu;
703  nu->resolv = cu->resolv;
704  nu->flag = CU_SMOOTH;
705 
707 
708  return nu;
709 }
710 
711 static void rna_Curve_spline_remove(Curve *cu, ReportList *reports, PointerRNA *nu_ptr)
712 {
713  Nurb *nu = nu_ptr->data;
714  ListBase *nurbs = BKE_curve_nurbs_get(cu);
715 
716  if (BLI_remlink_safe(nurbs, nu) == false) {
717  BKE_reportf(reports, RPT_ERROR, "Curve '%s' does not contain spline given", cu->id.name + 2);
718  return;
719  }
720 
721  BKE_nurb_free(nu);
722  RNA_POINTER_INVALIDATE(nu_ptr);
723 
726 }
727 
728 static void rna_Curve_spline_clear(Curve *cu)
729 {
730  ListBase *nurbs = BKE_curve_nurbs_get(cu);
731 
732  BKE_nurbList_free(nurbs);
733 
736 }
737 
738 static PointerRNA rna_Curve_active_spline_get(PointerRNA *ptr)
739 {
740  Curve *cu = (Curve *)ptr->data;
741  Nurb *nu;
742  ListBase *nurbs = BKE_curve_nurbs_get(cu);
743 
744  /* For curve outside editmode will set to -1,
745  * should be changed to be allowed outside of editmode. */
746  nu = BLI_findlink(nurbs, cu->actnu);
747 
748  if (nu) {
749  return rna_pointer_inherit_refine(ptr, &RNA_Spline, nu);
750  }
751 
753 }
754 
755 static void rna_Curve_active_spline_set(PointerRNA *ptr,
756  PointerRNA value,
757  struct ReportList *UNUSED(reports))
758 {
759  Curve *cu = (Curve *)ptr->data;
760  Nurb *nu = value.data;
761  ListBase *nubase = BKE_curve_nurbs_get(cu);
762 
763  /* -1 is ok for an unset index */
764  if (nu == NULL) {
765  cu->actnu = -1;
766  }
767  else {
768  cu->actnu = BLI_findindex(nubase, nu);
769  }
770 }
771 
772 static char *rna_Curve_spline_path(const PointerRNA *ptr)
773 {
774  Curve *cu = (Curve *)ptr->owner_id;
775  ListBase *nubase = BKE_curve_nurbs_get(cu);
776  Nurb *nu = ptr->data;
777  int index = BLI_findindex(nubase, nu);
778 
779  if (index >= 0) {
780  return BLI_sprintfN("splines[%d]", index);
781  }
782  else {
783  return BLI_strdup("");
784  }
785 }
786 
787 /* use for both bezier and nurbs */
788 static char *rna_Curve_spline_point_path(const PointerRNA *ptr)
789 {
790  Curve *cu = (Curve *)ptr->owner_id;
791  Nurb *nu;
792  void *point = ptr->data;
793  int nu_index, pt_index;
794 
795  nu = curve_nurb_from_point(cu, point, &nu_index, &pt_index);
796 
797  if (nu) {
798  if (nu->type == CU_BEZIER) {
799  return BLI_sprintfN("splines[%d].bezier_points[%d]", nu_index, pt_index);
800  }
801  else {
802  return BLI_sprintfN("splines[%d].points[%d]", nu_index, pt_index);
803  }
804  }
805  else {
806  return BLI_strdup("");
807  }
808 }
809 
810 static char *rna_TextBox_path(const PointerRNA *ptr)
811 {
812  const Curve *cu = (Curve *)ptr->owner_id;
813  const TextBox *tb = ptr->data;
814  int index = (int)(tb - cu->tb);
815 
816  if (index >= 0 && index < cu->totbox) {
817  return BLI_sprintfN("text_boxes[%d]", index);
818  }
819  else {
820  return BLI_strdup("");
821  }
822 }
823 
824 static void rna_Curve_splines_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
825 {
826  Curve *cu = (Curve *)ptr->owner_id;
828 }
829 
830 static bool rna_Curve_is_editmode_get(PointerRNA *ptr)
831 {
832  Curve *cu = (Curve *)ptr->owner_id;
833  const short type = BKE_curve_type_get(cu);
834  if (type == OB_FONT) {
835  return (cu->editfont != NULL);
836  }
837  else {
838  return (cu->editnurb != NULL);
839  }
840 }
841 
842 #else
843 
844 static const float tilt_limit = DEG2RADF(21600.0f);
845 
846 static void rna_def_bpoint(BlenderRNA *brna)
847 {
848  StructRNA *srna;
849  PropertyRNA *prop;
850 
851  srna = RNA_def_struct(brna, "SplinePoint", NULL);
852  RNA_def_struct_sdna(srna, "BPoint");
853  RNA_def_struct_ui_text(srna, "SplinePoint", "Spline point without handles");
854 
855  /* Boolean values */
856  prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
858  RNA_def_property_ui_text(prop, "Select", "Selection status");
859  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
860 
861  prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
862  RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
863  RNA_def_property_ui_text(prop, "Hide", "Visibility status");
864  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
865 
866  /* Vector value */
867  prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
868  RNA_def_property_array(prop, 3);
869  RNA_def_property_float_sdna(prop, NULL, "vec");
870  RNA_def_property_ui_text(prop, "Point", "Point coordinates");
871  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
872  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
873 
874  prop = RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE);
875  RNA_def_property_float_sdna(prop, NULL, "vec[3]");
876  RNA_def_property_ui_text(prop, "Weight", "NURBS weight");
877  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
878 
879  /* Number values */
880  prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_ANGLE);
883  RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3D View");
884  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
885 
886  prop = RNA_def_property(srna, "weight_softbody", PROP_FLOAT, PROP_NONE);
887  RNA_def_property_float_sdna(prop, NULL, "weight");
888  RNA_def_property_range(prop, 0.01f, 100.0f);
889  RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
890  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
891 
892  prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
893  RNA_def_property_float_sdna(prop, NULL, "radius");
894  RNA_def_property_range(prop, 0.0f, FLT_MAX);
895  RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for beveling");
896  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
897 
898  RNA_def_struct_path_func(srna, "rna_Curve_spline_point_path");
899 }
900 
901 static void rna_def_beztriple(BlenderRNA *brna)
902 {
903  StructRNA *srna;
904  PropertyRNA *prop;
905 
906  srna = RNA_def_struct(brna, "BezierSplinePoint", NULL);
907  RNA_def_struct_sdna(srna, "BezTriple");
908  RNA_def_struct_ui_text(srna, "Bezier Curve Point", "Bezier curve point with two handles");
909 
910  /* Boolean values */
911  prop = RNA_def_property(srna, "select_left_handle", PROP_BOOLEAN, PROP_NONE);
913  RNA_def_property_ui_text(prop, "Handle 1 selected", "Handle 1 selection status");
914  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
915 
916  prop = RNA_def_property(srna, "select_right_handle", PROP_BOOLEAN, PROP_NONE);
918  RNA_def_property_ui_text(prop, "Handle 2 selected", "Handle 2 selection status");
919  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
920 
921  prop = RNA_def_property(srna, "select_control_point", PROP_BOOLEAN, PROP_NONE);
923  RNA_def_property_ui_text(prop, "Control Point selected", "Control point selection status");
924  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
925 
926  prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
927  RNA_def_property_boolean_sdna(prop, NULL, "hide", 0);
928  RNA_def_property_ui_text(prop, "Hide", "Visibility status");
929  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
930 
931  /* Enums */
932  prop = RNA_def_property(srna, "handle_left_type", PROP_ENUM, PROP_NONE);
933  RNA_def_property_enum_sdna(prop, NULL, "h1");
935  RNA_def_property_ui_text(prop, "Handle 1 Type", "Handle types");
936  RNA_def_property_update(prop, 0, "rna_Curve_update_points");
937 
938  prop = RNA_def_property(srna, "handle_right_type", PROP_ENUM, PROP_NONE);
939  RNA_def_property_enum_sdna(prop, NULL, "h2");
941  RNA_def_property_ui_text(prop, "Handle 2 Type", "Handle types");
942  RNA_def_property_update(prop, 0, "rna_Curve_update_points");
943 
944  /* Vector values */
945  prop = RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION);
946  RNA_def_property_array(prop, 3);
948  prop, "rna_BezTriple_handle1_get", "rna_BezTriple_handle1_set", NULL);
949  RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
950  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
951  RNA_def_property_update(prop, 0, "rna_Curve_update_points");
952 
953  prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
954  RNA_def_property_array(prop, 3);
956  prop, "rna_BezTriple_ctrlpoint_get", "rna_BezTriple_ctrlpoint_set", NULL);
957  RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
958  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
959  RNA_def_property_update(prop, 0, "rna_Curve_update_points");
960 
961  prop = RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION);
962  RNA_def_property_array(prop, 3);
964  prop, "rna_BezTriple_handle2_get", "rna_BezTriple_handle2_set", NULL);
965  RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle");
966  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
967  RNA_def_property_update(prop, 0, "rna_Curve_update_points");
968 
969  /* Number values */
970  prop = RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_ANGLE);
973  RNA_def_property_ui_text(prop, "Tilt", "Tilt in 3D View");
974  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
975 
976  prop = RNA_def_property(srna, "weight_softbody", PROP_FLOAT, PROP_NONE);
977  RNA_def_property_float_sdna(prop, NULL, "weight");
978  RNA_def_property_range(prop, 0.01f, 100.0f);
979  RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight");
980  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
981 
982  prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE);
983  RNA_def_property_float_sdna(prop, NULL, "radius");
984  RNA_def_property_range(prop, 0.0f, FLT_MAX);
985  RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for beveling");
986  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
987 
988  RNA_def_struct_path_func(srna, "rna_Curve_spline_point_path");
989 }
990 
991 static void rna_def_path(BlenderRNA *UNUSED(brna), StructRNA *srna)
992 {
993  PropertyRNA *prop;
994 
995  /* number values */
996  prop = RNA_def_property(srna, "path_duration", PROP_INT, PROP_TIME);
997  RNA_def_property_int_sdna(prop, NULL, "pathlen");
1000  "Path Length",
1001  "The number of frames that are needed to traverse the path, "
1002  "defining the maximum value for the 'Evaluation Time' setting");
1003  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1004 
1005  /* flags */
1006  prop = RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
1007  RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_PATH);
1008  RNA_def_property_ui_text(prop, "Path", "Enable the curve to become a translation path");
1009  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1010 
1011  prop = RNA_def_property(srna, "use_path_follow", PROP_BOOLEAN, PROP_NONE);
1013  RNA_def_property_ui_text(prop, "Follow", "Make curve path children to rotate along the path");
1014  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1015 
1016  prop = RNA_def_property(srna, "use_path_clamp", PROP_BOOLEAN, PROP_NONE);
1019  prop,
1020  "Clamp",
1021  "Clamp the curve path children so they can't travel past the start/end point of the curve");
1022  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1023 
1024  prop = RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE);
1027  "Stretch",
1028  "Option for curve-deform: "
1029  "make deformed child to stretch along entire path");
1030  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1031 
1032  prop = RNA_def_property(srna, "use_deform_bounds", PROP_BOOLEAN, PROP_NONE);
1035  "Bounds Clamp",
1036  "Option for curve-deform: "
1037  "Use the mesh bounds to clamp the deformation");
1038  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1039 
1040  prop = RNA_def_property(srna, "use_radius", PROP_BOOLEAN, PROP_NONE);
1043  "Radius",
1044  "Option for paths and curve-deform: "
1045  "apply the curve radius with path following it and deforming");
1046  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1047 }
1048 
1049 static void rna_def_nurbs(BlenderRNA *UNUSED(brna), StructRNA *UNUSED(srna))
1050 {
1051  /* Nothing. */
1052 }
1053 
1054 static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna)
1055 {
1056  PropertyRNA *prop;
1057 
1058  static const EnumPropertyItem prop_align_items[] = {
1059  {CU_ALIGN_X_LEFT, "LEFT", ICON_ALIGN_LEFT, "Left", "Align text to the left"},
1060  {CU_ALIGN_X_MIDDLE, "CENTER", ICON_ALIGN_CENTER, "Center", "Center text"},
1061  {CU_ALIGN_X_RIGHT, "RIGHT", ICON_ALIGN_RIGHT, "Right", "Align text to the right"},
1063  "JUSTIFY",
1064  ICON_ALIGN_JUSTIFY,
1065  "Justify",
1066  "Align to the left and the right"},
1068  "FLUSH",
1069  ICON_ALIGN_FLUSH,
1070  "Flush",
1071  "Align to the left and the right, with equal character spacing"},
1072  {0, NULL, 0, NULL, NULL},
1073  };
1074 
1075  static const EnumPropertyItem prop_align_y_items[] = {
1077  "TOP_BASELINE",
1078  ICON_ALIGN_TOP,
1079  "Top Base-Line",
1080  "Align to top but use the base-line of the text"},
1081  {CU_ALIGN_Y_TOP, "TOP", ICON_ALIGN_TOP, "Top", "Align text to the top"},
1082  {CU_ALIGN_Y_CENTER, "CENTER", ICON_ALIGN_MIDDLE, "Center", "Align text to the middle"},
1083  {CU_ALIGN_Y_BOTTOM, "BOTTOM", ICON_ALIGN_BOTTOM, "Bottom", "Align text to the bottom"},
1085  "BOTTOM_BASELINE",
1086  ICON_ALIGN_BOTTOM,
1087  "Bottom Base-Line",
1088  "Align text to the bottom but use the base-line of the text"},
1089  {0, NULL, 0, NULL, NULL},
1090  };
1091 
1092  static const EnumPropertyItem prop_overflow_items[] = {
1093  {CU_OVERFLOW_NONE, "NONE", 0, "Overflow", "Let the text overflow outside the text boxes"},
1095  "SCALE",
1096  0,
1097  "Scale to Fit",
1098  "Scale down the text to fit inside the text boxes"},
1100  "TRUNCATE",
1101  0,
1102  "Truncate",
1103  "Truncate the text that would go outside the text boxes"},
1104  {0, NULL, 0, NULL, NULL},
1105  };
1106 
1107  /* Enums */
1108  prop = RNA_def_property(srna, "align_x", PROP_ENUM, PROP_NONE);
1109  RNA_def_property_enum_sdna(prop, NULL, "spacemode");
1110  RNA_def_property_enum_items(prop, prop_align_items);
1112  prop, "Text Horizontal Align", "Text horizontal align from the object center");
1113  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1114 
1115  prop = RNA_def_property(srna, "align_y", PROP_ENUM, PROP_NONE);
1116  RNA_def_property_enum_sdna(prop, NULL, "align_y");
1117  RNA_def_property_enum_items(prop, prop_align_y_items);
1119  prop, "Text Vertical Align", "Text vertical align from the object center");
1120  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1121 
1122  prop = RNA_def_property(srna, "overflow", PROP_ENUM, PROP_NONE);
1123  RNA_def_property_enum_sdna(prop, NULL, "overflow");
1124  RNA_def_property_enum_items(prop, prop_overflow_items);
1127  prop, "Textbox Overflow", "Handle the text behavior when it doesn't fit in the text boxes");
1128  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1129 
1130  /* number values */
1131  prop = RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
1132  RNA_def_property_float_sdna(prop, NULL, "fsize");
1133  RNA_def_property_range(prop, 0.0001f, 10000.0f);
1134  RNA_def_property_ui_range(prop, 0.01, 10, 1, 3);
1135  RNA_def_property_ui_text(prop, "Font Size", "");
1136  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1137 
1138  prop = RNA_def_property(srna, "small_caps_scale", PROP_FLOAT, PROP_NONE);
1139  RNA_def_property_float_sdna(prop, NULL, "smallcaps_scale");
1140  RNA_def_property_ui_range(prop, 0, 1.0, 1, 2);
1141  RNA_def_property_ui_text(prop, "Small Caps", "Scale of small capitals");
1142  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1143 
1144  prop = RNA_def_property(srna, "space_line", PROP_FLOAT, PROP_NONE);
1145  RNA_def_property_float_sdna(prop, NULL, "linedist");
1146  RNA_def_property_range(prop, 0.0f, 10.0f);
1147  RNA_def_property_ui_text(prop, "Distance between lines of text", "");
1148  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1149 
1150  prop = RNA_def_property(srna, "space_word", PROP_FLOAT, PROP_NONE);
1151  RNA_def_property_float_sdna(prop, NULL, "wordspace");
1152  RNA_def_property_range(prop, 0.0f, 10.0f);
1153  RNA_def_property_ui_text(prop, "Spacing between words", "");
1154  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1155 
1156  prop = RNA_def_property(srna, "space_character", PROP_FLOAT, PROP_NONE);
1157  RNA_def_property_float_sdna(prop, NULL, "spacing");
1158  RNA_def_property_range(prop, 0.0f, 10.0f);
1159  RNA_def_property_ui_text(prop, "Global spacing between characters", "");
1160  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1161 
1162  prop = RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE);
1163  RNA_def_property_float_sdna(prop, NULL, "shear");
1164  RNA_def_property_range(prop, -1.0f, 1.0f);
1165  RNA_def_property_ui_text(prop, "Shear", "Italic angle of the characters");
1166  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1167 
1168  prop = RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_DISTANCE);
1169  RNA_def_property_float_sdna(prop, NULL, "xof");
1170  RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1171  RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3);
1172  RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object origin");
1173  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1174 
1175  prop = RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_DISTANCE);
1176  RNA_def_property_float_sdna(prop, NULL, "yof");
1177  RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1178  RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3);
1179  RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object origin");
1180  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1181 
1182  prop = RNA_def_property(srna, "underline_position", PROP_FLOAT, PROP_NONE);
1183  RNA_def_property_float_sdna(prop, NULL, "ulpos");
1184  RNA_def_property_range(prop, -0.2f, 0.8f);
1185  RNA_def_property_ui_text(prop, "Underline Position", "Vertical position of underline");
1186  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1187 
1188  prop = RNA_def_property(srna, "underline_height", PROP_FLOAT, PROP_NONE);
1189  RNA_def_property_float_sdna(prop, NULL, "ulheight");
1190  RNA_def_property_range(prop, 0.0f, 0.8f);
1191  RNA_def_property_ui_text(prop, "Underline Thickness", "");
1192  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1193 
1194  prop = RNA_def_property(srna, "text_boxes", PROP_COLLECTION, PROP_NONE);
1195  RNA_def_property_collection_sdna(prop, NULL, "tb", "totbox");
1196  RNA_def_property_struct_type(prop, "TextBox");
1197  RNA_def_property_ui_text(prop, "Textboxes", "");
1198 
1199  prop = RNA_def_property(srna, "active_textbox", PROP_INT, PROP_NONE);
1200  RNA_def_property_int_sdna(prop, NULL, "actbox");
1201  RNA_def_property_ui_text(prop, "Active Text Box", "");
1202  RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_active_textbox_index_range");
1203 
1204  /* strings */
1205  prop = RNA_def_property(srna, "family", PROP_STRING, PROP_NONE);
1208  prop,
1209  "Object Font",
1210  "Use objects as font characters (give font objects a common name "
1211  "followed by the character they represent, eg. 'family-a', 'family-b', etc, "
1212  "set this setting to 'family-', and turn on Vertex Instancing)");
1213  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1214 
1215  prop = RNA_def_property(srna, "body", PROP_STRING, PROP_NONE);
1216  RNA_def_property_string_sdna(prop, NULL, "str");
1217  RNA_def_property_ui_text(prop, "Body Text", "Content of this text object");
1219  prop, "rna_Curve_body_get", "rna_Curve_body_length", "rna_Curve_body_set");
1220  /* note that originally str did not have a limit! */
1222  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1223 
1224  prop = RNA_def_property(srna, "body_format", PROP_COLLECTION, PROP_NONE);
1225  RNA_def_property_collection_sdna(prop, NULL, "strinfo", "len_char32");
1226  RNA_def_property_struct_type(prop, "TextCharacterFormat");
1227  RNA_def_property_ui_text(prop, "Character Info", "Stores the style of each character");
1228 
1229  /* pointers */
1230  prop = RNA_def_property(srna, "follow_curve", PROP_POINTER, PROP_NONE);
1231  RNA_def_property_pointer_sdna(prop, NULL, "textoncurve");
1232  RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_otherObject_poll");
1235  RNA_def_property_ui_text(prop, "Text on Curve", "Curve deforming text object");
1236  RNA_def_property_update(prop, 0, "rna_Curve_update_deps");
1237 
1238  prop = RNA_def_property(srna, "font", PROP_POINTER, PROP_NONE);
1239  RNA_def_property_pointer_sdna(prop, NULL, "vfont");
1240  RNA_def_property_ui_text(prop, "Font", "");
1243  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1244 
1245  prop = RNA_def_property(srna, "font_bold", PROP_POINTER, PROP_NONE);
1246  RNA_def_property_pointer_sdna(prop, NULL, "vfontb");
1247  RNA_def_property_ui_text(prop, "Font Bold", "");
1250  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1251 
1252  prop = RNA_def_property(srna, "font_italic", PROP_POINTER, PROP_NONE);
1253  RNA_def_property_pointer_sdna(prop, NULL, "vfonti");
1254  RNA_def_property_ui_text(prop, "Font Italic", "");
1257  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1258 
1259  prop = RNA_def_property(srna, "font_bold_italic", PROP_POINTER, PROP_NONE);
1260  RNA_def_property_pointer_sdna(prop, NULL, "vfontbi");
1261  RNA_def_property_ui_text(prop, "Font Bold Italic", "");
1264  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1265 
1266  prop = RNA_def_property(srna, "edit_format", PROP_POINTER, PROP_NONE);
1267  RNA_def_property_pointer_sdna(prop, NULL, "curinfo");
1268  RNA_def_property_ui_text(prop, "Edit Format", "Editing settings character formatting");
1269  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1270 
1271  /* flags */
1272  prop = RNA_def_property(srna, "use_fast_edit", PROP_BOOLEAN, PROP_NONE);
1273  RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FAST);
1274  RNA_def_property_ui_text(prop, "Fast Editing", "Don't fill polygons while editing");
1275  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1276 }
1277 
1278 static void rna_def_textbox(BlenderRNA *brna)
1279 {
1280  StructRNA *srna;
1281  PropertyRNA *prop;
1282 
1283  srna = RNA_def_struct(brna, "TextBox", NULL);
1284  RNA_def_struct_ui_text(srna, "Text Box", "Text bounding box for layout");
1285 
1286  /* number values */
1287  prop = RNA_def_property(srna, "x", PROP_FLOAT, PROP_DISTANCE);
1288  RNA_def_property_float_sdna(prop, NULL, "x");
1289  RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1290  RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3);
1291  RNA_def_property_ui_text(prop, "Textbox X Offset", "");
1292  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1293 
1294  prop = RNA_def_property(srna, "y", PROP_FLOAT, PROP_DISTANCE);
1295  RNA_def_property_float_sdna(prop, NULL, "y");
1296  RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
1297  RNA_def_property_ui_range(prop, -50.0f, 50.0f, 10, 3);
1298  RNA_def_property_ui_text(prop, "Textbox Y Offset", "");
1299  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1300 
1301  prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE);
1302  RNA_def_property_float_sdna(prop, NULL, "w");
1303  RNA_def_property_range(prop, 0.0f, FLT_MAX);
1304  RNA_def_property_ui_range(prop, 0.0f, 50.0f, 10, 3);
1305  RNA_def_property_ui_text(prop, "Textbox Width", "");
1306  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1307 
1308  prop = RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE);
1309  RNA_def_property_float_sdna(prop, NULL, "h");
1310  RNA_def_property_range(prop, 0.0f, FLT_MAX);
1311  RNA_def_property_ui_range(prop, 0.0f, 50.0f, 10, 3);
1312  RNA_def_property_ui_text(prop, "Textbox Height", "");
1313  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1314 
1315  RNA_def_struct_path_func(srna, "rna_TextBox_path");
1316 }
1317 
1318 static void rna_def_charinfo(BlenderRNA *brna)
1319 {
1320  StructRNA *srna;
1321  PropertyRNA *prop;
1322 
1323  srna = RNA_def_struct(brna, "TextCharacterFormat", NULL);
1324  RNA_def_struct_sdna(srna, "CharInfo");
1325  RNA_def_struct_ui_text(srna, "Text Character Format", "Text character formatting settings");
1326 
1327  /* flags */
1328  prop = RNA_def_property(srna, "use_bold", PROP_BOOLEAN, PROP_NONE);
1330  RNA_def_property_ui_text(prop, "Bold", "");
1331  RNA_def_property_ui_icon(prop, ICON_BOLD, 0);
1332  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1333 
1334  prop = RNA_def_property(srna, "use_italic", PROP_BOOLEAN, PROP_NONE);
1336  RNA_def_property_ui_text(prop, "Italic", "");
1337  RNA_def_property_ui_icon(prop, ICON_ITALIC, 0);
1338  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1339 
1340  prop = RNA_def_property(srna, "use_underline", PROP_BOOLEAN, PROP_NONE);
1342  RNA_def_property_ui_text(prop, "Underline", "");
1343  RNA_def_property_ui_icon(prop, ICON_UNDERLINE, 0);
1344  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1345 
1346  /* probably there is no reason to expose this */
1347 # if 0
1348  prop = RNA_def_property(srna, "use_wrap", PROP_BOOLEAN, PROP_NONE);
1350  RNA_def_property_ui_text(prop, "Wrap", "");
1351  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1352 # endif
1353 
1354  prop = RNA_def_property(srna, "use_small_caps", PROP_BOOLEAN, PROP_NONE);
1356  RNA_def_property_ui_text(prop, "Small Caps", "");
1357  RNA_def_property_ui_icon(prop, ICON_SMALL_CAPS, 0);
1358  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1359 
1360  prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
1361  // RNA_def_property_int_sdna(prop, NULL, "mat_nr");
1362  RNA_def_property_ui_text(prop, "Material Index", "Material slot index of this character");
1364  "rna_ChariInfo_material_index_get",
1365  "rna_ChariInfo_material_index_set",
1366  "rna_Curve_material_index_range");
1367  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1368 
1369  prop = RNA_def_property(srna, "kerning", PROP_INT, PROP_UNSIGNED);
1370  RNA_def_property_int_sdna(prop, NULL, "kern");
1371  RNA_def_property_ui_text(prop, "Kerning", "Spacing between characters");
1372  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1373 }
1374 
1375 static void rna_def_surface(BlenderRNA *brna)
1376 {
1377  StructRNA *srna;
1378 
1379  srna = RNA_def_struct(brna, "SurfaceCurve", "Curve");
1380  RNA_def_struct_sdna(srna, "Curve");
1381  RNA_def_struct_ui_text(srna, "Surface Curve", "Curve data-block used for storing surfaces");
1382  RNA_def_struct_ui_icon(srna, ICON_SURFACE_DATA);
1383 
1384  rna_def_nurbs(brna, srna);
1385 }
1386 
1387 static void rna_def_text(BlenderRNA *brna)
1388 {
1389  StructRNA *srna;
1390 
1391  srna = RNA_def_struct(brna, "TextCurve", "Curve");
1392  RNA_def_struct_sdna(srna, "Curve");
1393  RNA_def_struct_ui_text(srna, "Text Curve", "Curve data-block used for storing text");
1394  RNA_def_struct_ui_icon(srna, ICON_FONT_DATA);
1395 
1396  rna_def_font(brna, srna);
1397  rna_def_nurbs(brna, srna);
1398 }
1399 
1400 /* curve.splines[0].points */
1402 {
1403  StructRNA *srna;
1404  // PropertyRNA *prop;
1405 
1406  FunctionRNA *func;
1407  PropertyRNA *parm;
1408 
1409  RNA_def_property_srna(cprop, "SplinePoints");
1410  srna = RNA_def_struct(brna, "SplinePoints", NULL);
1411  RNA_def_struct_sdna(srna, "Nurb");
1412  RNA_def_struct_ui_text(srna, "Spline Points", "Collection of spline points");
1413 
1414  func = RNA_def_function(srna, "add", "rna_Curve_spline_points_add");
1415  RNA_def_function_ui_description(func, "Add a number of points to this spline");
1417  parm = RNA_def_int(
1418  func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
1420 
1421 # if 0
1422  func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
1423  RNA_def_function_ui_description(func, "Remove a spline from a curve");
1425  parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
1428 # endif
1429 }
1430 
1432 {
1433  StructRNA *srna;
1434  // PropertyRNA *prop;
1435 
1436  FunctionRNA *func;
1437  PropertyRNA *parm;
1438 
1439  RNA_def_property_srna(cprop, "SplineBezierPoints");
1440  srna = RNA_def_struct(brna, "SplineBezierPoints", NULL);
1441  RNA_def_struct_sdna(srna, "Nurb");
1442  RNA_def_struct_ui_text(srna, "Spline Bezier Points", "Collection of spline Bezier points");
1443 
1444  func = RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add");
1445  RNA_def_function_ui_description(func, "Add a number of points to this spline");
1447  parm = RNA_def_int(
1448  func, "count", 1, 0, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX);
1450 
1451 # if 0
1452  func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
1453  RNA_def_function_ui_description(func, "Remove a spline from a curve");
1455  parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
1458 # endif
1459 }
1460 
1461 /* curve.splines */
1463 {
1464  StructRNA *srna;
1465  PropertyRNA *prop;
1466 
1467  FunctionRNA *func;
1468  PropertyRNA *parm;
1469 
1470  RNA_def_property_srna(cprop, "CurveSplines");
1471  srna = RNA_def_struct(brna, "CurveSplines", NULL);
1472  RNA_def_struct_sdna(srna, "Curve");
1473  RNA_def_struct_ui_text(srna, "Curve Splines", "Collection of curve splines");
1474 
1475  func = RNA_def_function(srna, "new", "rna_Curve_spline_new");
1476  RNA_def_function_ui_description(func, "Add a new spline to the curve");
1477  parm = RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline");
1479  parm = RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline");
1480  RNA_def_function_return(func, parm);
1481 
1482  func = RNA_def_function(srna, "remove", "rna_Curve_spline_remove");
1483  RNA_def_function_ui_description(func, "Remove a spline from a curve");
1485  parm = RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove");
1488 
1489  func = RNA_def_function(srna, "clear", "rna_Curve_spline_clear");
1490  RNA_def_function_ui_description(func, "Remove all splines from a curve");
1491 
1492  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
1493  RNA_def_property_struct_type(prop, "Spline");
1495  prop, "rna_Curve_active_spline_get", "rna_Curve_active_spline_set", NULL, NULL);
1497  RNA_def_property_ui_text(prop, "Active Spline", "Active curve spline");
1498 }
1499 
1500 static void rna_def_curve(BlenderRNA *brna)
1501 {
1502  StructRNA *srna;
1503  PropertyRNA *prop;
1504 
1505  static const EnumPropertyItem curve_twist_mode_items[] = {
1506  {CU_TWIST_Z_UP,
1507  "Z_UP",
1508  0,
1509  "Z-Up",
1510  "Use Z-Up axis to calculate the curve twist at each point"},
1511  {CU_TWIST_MINIMUM, "MINIMUM", 0, "Minimum", "Use the least twist over the entire curve"},
1512  {CU_TWIST_TANGENT, "TANGENT", 0, "Tangent", "Use the tangent to calculate twist"},
1513  {0, NULL, 0, NULL, NULL},
1514  };
1515 
1516  static const EnumPropertyItem curve_axis_items[] = {
1517  {0, "2D", 0, "2D", "Clamp the Z axis of the curve"},
1518  {CU_3D,
1519  "3D",
1520  0,
1521  "3D",
1522  "Allow editing on the Z axis of this curve, also allows tilt and curve radius to be used"},
1523  {0, NULL, 0, NULL, NULL},
1524  };
1525 
1526  static const EnumPropertyItem bevfac_mapping_items[] = {
1528  "RESOLUTION",
1529  0,
1530  "Resolution",
1531  "Map the geometry factor to the number of subdivisions of a spline (U resolution)"},
1533  "SEGMENTS",
1534  0,
1535  "Segments",
1536  "Map the geometry factor to the length of a segment and to the number of subdivisions of a "
1537  "segment"},
1539  "SPLINE",
1540  0,
1541  "Spline",
1542  "Map the geometry factor to the length of a spline"},
1543  {0, NULL, 0, NULL, NULL},
1544  };
1545 
1546  static const EnumPropertyItem bevel_mode_items[] = {
1548  "ROUND",
1549  0,
1550  "Round",
1551  "Use circle for the section of the curve's bevel geometry"},
1553  "OBJECT",
1554  0,
1555  "Object",
1556  "Use an object for the section of the curve's bevel geometry segment"},
1558  "PROFILE",
1559  0,
1560  "Profile",
1561  "Use a custom profile for each quarter of curve's bevel geometry"},
1562  {0, NULL, 0, NULL, NULL},
1563  };
1564 
1565  static const EnumPropertyItem curve_taper_radius_mode_items[] = {
1567  "OVERRIDE",
1568  0,
1569  "Override",
1570  "Override the radius of the spline point with the taper radius"},
1572  "MULTIPLY",
1573  0,
1574  "Multiply",
1575  "Multiply the radius of the spline point by the taper radius"},
1577  "ADD",
1578  0,
1579  "Add",
1580  "Add the radius of the bevel point to the taper radius"},
1581  {0, NULL, 0, NULL, NULL},
1582  };
1583 
1584  srna = RNA_def_struct(brna, "Curve", "ID");
1585  RNA_def_struct_ui_text(srna, "Curve", "Curve data-block storing curves, splines and NURBS");
1586  RNA_def_struct_ui_icon(srna, ICON_CURVE_DATA);
1587  RNA_def_struct_refine_func(srna, "rna_Curve_refine");
1588 
1589  prop = RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE);
1590  RNA_def_property_pointer_sdna(prop, NULL, "key");
1593  RNA_def_property_ui_text(prop, "Shape Keys", "");
1594 
1595  prop = RNA_def_property(srna, "splines", PROP_COLLECTION, PROP_NONE);
1596 # if 0
1597  RNA_def_property_collection_sdna(prop, NULL, "nurb", NULL);
1598 # else
1599  /* this way we get editmode nurbs too, keyframe in editmode */
1601  "rna_Curve_splines_begin",
1602  "rna_iterator_listbase_next",
1603  "rna_iterator_listbase_end",
1604  "rna_iterator_listbase_get",
1605  NULL,
1606  NULL,
1607  NULL,
1608  NULL);
1609 # endif
1610  RNA_def_property_struct_type(prop, "Spline");
1611  RNA_def_property_ui_text(prop, "Splines", "Collection of splines in this curve data object");
1612  rna_def_curve_splines(brna, prop);
1613 
1614  rna_def_path(brna, srna);
1615 
1616  prop = RNA_def_property(srna, "bevel_mode", PROP_ENUM, PROP_NONE);
1617  RNA_def_property_enum_sdna(prop, NULL, "bevel_mode");
1618  RNA_def_property_enum_items(prop, bevel_mode_items);
1620  prop, "Bevel Mode", "Determine how to build the curve's bevel geometry");
1621  RNA_def_property_enum_funcs(prop, NULL, "rna_Curve_bevel_mode_set", NULL);
1622  /* Use this update function so the curve profile is properly initialized when
1623  * switching back to "Profile" mode after changing the resolution. */
1624  RNA_def_property_update(prop, 0, "rna_Curve_bevel_resolution_update");
1625 
1626  prop = RNA_def_property(srna, "bevel_profile", PROP_POINTER, PROP_NONE);
1627  RNA_def_property_struct_type(prop, "CurveProfile");
1628  RNA_def_property_pointer_sdna(prop, NULL, "bevel_profile");
1629  RNA_def_property_ui_text(prop, "Custom Profile Path", "The path for the curve's custom profile");
1630  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1631 
1632  /* Number values */
1633  prop = RNA_def_property(srna, "bevel_resolution", PROP_INT, PROP_NONE);
1634  RNA_def_property_int_sdna(prop, NULL, "bevresol");
1635  RNA_def_property_range(prop, 0, 32);
1636  RNA_def_property_ui_range(prop, 0, 32, 1.0, -1);
1638  prop, "Bevel Resolution", "The number of segments in each quarter-circle of the bevel");
1639  RNA_def_property_update(prop, 0, "rna_Curve_bevel_resolution_update");
1640 
1641  prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH);
1642  RNA_def_property_float_sdna(prop, NULL, "offset");
1643  RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3);
1644  RNA_def_property_float_funcs(prop, "rna_Curve_offset_get", "rna_Curve_offset_set", NULL);
1645  RNA_def_property_ui_text(prop, "Offset", "Distance to move the curve parallel to its normals");
1646  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1647 
1648  prop = RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH);
1649  RNA_def_property_float_sdna(prop, NULL, "extrude");
1650  RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3);
1651  RNA_def_property_range(prop, 0.0, FLT_MAX);
1653  "Extrude",
1654  "Length of the depth added in the local Z direction along the curve, "
1655  "perpendicular to its normals");
1656  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1657 
1658  prop = RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE | PROP_UNIT_LENGTH);
1659  RNA_def_property_float_sdna(prop, NULL, "bevel_radius");
1660  RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 3);
1662  prop, "Bevel Depth", "Radius of the bevel geometry, not including extrusion");
1663  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1664 
1665  prop = RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
1666  RNA_def_property_int_sdna(prop, NULL, "resolu");
1668  RNA_def_property_range(prop, 1, 1024);
1669  RNA_def_property_ui_range(prop, 1, 64, 1, -1);
1671  prop,
1672  "Resolution U",
1673  "Number of computed points in the U direction between every pair of control points");
1674  RNA_def_property_update(prop, 0, "rna_Curve_resolution_u_update_data");
1675 
1676  prop = RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
1677  RNA_def_property_int_sdna(prop, NULL, "resolv");
1679  RNA_def_property_ui_range(prop, 1, 64, 1, -1);
1680  RNA_def_property_range(prop, 1, 1024);
1682  prop,
1683  "Resolution V",
1684  "The number of computed points in the V direction between every pair of control points");
1685  RNA_def_property_update(prop, 0, "rna_Curve_resolution_v_update_data");
1686 
1687  prop = RNA_def_property(srna, "render_resolution_u", PROP_INT, PROP_NONE);
1688  RNA_def_property_int_sdna(prop, NULL, "resolu_ren");
1689  RNA_def_property_range(prop, 0, 1024);
1690  RNA_def_property_ui_range(prop, 0, 64, 1, -1);
1692  prop,
1693  "Render Resolution U",
1694  "Surface resolution in U direction used while rendering (zero uses preview resolution)");
1695 
1696  prop = RNA_def_property(srna, "render_resolution_v", PROP_INT, PROP_NONE);
1697  RNA_def_property_int_sdna(prop, NULL, "resolv_ren");
1698  RNA_def_property_ui_range(prop, 0, 64, 1, -1);
1699  RNA_def_property_range(prop, 0, 1024);
1701  prop,
1702  "Render Resolution V",
1703  "Surface resolution in V direction used while rendering (zero uses preview resolution)");
1704 
1705  prop = RNA_def_property(srna, "eval_time", PROP_FLOAT, PROP_TIME);
1706  RNA_def_property_float_sdna(prop, NULL, "ctime");
1708  prop,
1709  "Evaluation Time",
1710  "Parametric position along the length of the curve that Objects 'following' it should be "
1711  "at (position is evaluated by dividing by the 'Path Length' value)");
1712  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1713 
1714  /* pointers */
1715  prop = RNA_def_property(srna, "bevel_object", PROP_POINTER, PROP_NONE);
1716  RNA_def_property_struct_type(prop, "Object");
1717  RNA_def_property_pointer_sdna(prop, NULL, "bevobj");
1721  prop, "Bevel Object", "The name of the Curve object that defines the bevel shape");
1722  RNA_def_property_update(prop, 0, "rna_Curve_update_deps");
1724  "rna_Curve_bevelObject_get",
1725  "rna_Curve_bevelObject_set",
1726  NULL,
1727  "rna_Curve_otherObject_poll");
1728 
1729  prop = RNA_def_property(srna, "taper_object", PROP_POINTER, PROP_NONE);
1730  RNA_def_property_struct_type(prop, "Object");
1731  RNA_def_property_pointer_sdna(prop, NULL, "taperobj");
1735  prop, "Taper Object", "Curve object name that defines the taper (width)");
1736  RNA_def_property_update(prop, 0, "rna_Curve_update_deps");
1738  "rna_Curve_taperObject_get",
1739  "rna_Curve_taperObject_set",
1740  NULL,
1741  "rna_Curve_otherObject_poll");
1742 
1743  /* Flags */
1744 
1745  prop = RNA_def_property(srna, "dimensions", PROP_ENUM, PROP_NONE); /* as an enum */
1747  RNA_def_property_enum_items(prop, curve_axis_items);
1748  RNA_def_property_enum_funcs(prop, NULL, "rna_Curve_dimension_set", NULL);
1749  RNA_def_property_ui_text(prop, "Dimensions", "Select 2D or 3D curve type");
1750  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1751 
1752  prop = RNA_def_property(srna, "fill_mode", PROP_ENUM, PROP_NONE);
1755  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Curve_fill_mode_itemf");
1756  RNA_def_property_ui_text(prop, "Fill Mode", "Mode of filling curve");
1757  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1758 
1759  prop = RNA_def_property(srna, "twist_mode", PROP_ENUM, PROP_NONE);
1760  RNA_def_property_enum_sdna(prop, NULL, "twist_mode");
1761  RNA_def_property_enum_items(prop, curve_twist_mode_items);
1762  RNA_def_property_ui_text(prop, "Twist Method", "The type of tilt calculation for 3D Curves");
1763  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1764 
1765  prop = RNA_def_property(srna, "taper_radius_mode", PROP_ENUM, PROP_NONE);
1766  RNA_def_property_enum_sdna(prop, NULL, "taper_radius_mode");
1767  RNA_def_property_enum_items(prop, curve_taper_radius_mode_items);
1769  "Taper Radius",
1770  "Determine how the effective radius of the spline point is computed "
1771  "when a taper object is specified");
1772  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1773 
1774  prop = RNA_def_property(srna, "bevel_factor_mapping_start", PROP_ENUM, PROP_NONE);
1775  RNA_def_property_enum_sdna(prop, NULL, "bevfac1_mapping");
1776  RNA_def_property_enum_items(prop, bevfac_mapping_items);
1778  prop, "Start Mapping Type", "Determine how the geometry start factor is mapped to a spline");
1779  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1780 
1781  prop = RNA_def_property(srna, "bevel_factor_mapping_end", PROP_ENUM, PROP_NONE);
1782  RNA_def_property_enum_sdna(prop, NULL, "bevfac2_mapping");
1783  RNA_def_property_enum_items(prop, bevfac_mapping_items);
1785  prop, "End Mapping Type", "Determine how the geometry end factor is mapped to a spline");
1786  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1787 
1788  /* XXX: would be nice to have a better way to do this, only add for testing. */
1789  prop = RNA_def_property(srna, "twist_smooth", PROP_FLOAT, PROP_NONE);
1790  RNA_def_property_float_sdna(prop, NULL, "twist_smooth");
1791  RNA_def_property_ui_range(prop, 0, 100.0, 1, 2);
1792  RNA_def_property_ui_text(prop, "Twist Smooth", "Smoothing iteration for tangents");
1793  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1794 
1795  prop = RNA_def_property(srna, "use_fill_caps", PROP_BOOLEAN, PROP_NONE);
1797  RNA_def_property_ui_text(prop, "Fill Caps", "Fill caps for beveled curves");
1798  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1799 
1800  prop = RNA_def_property(srna, "use_map_taper", PROP_BOOLEAN, PROP_NONE);
1803  prop, "Map Taper", "Map effect of the taper object to the beveled part of the curve");
1804  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1805 
1806  /* texture space */
1807  prop = RNA_def_property(srna, "use_auto_texspace", PROP_BOOLEAN, PROP_NONE);
1808  RNA_def_property_boolean_sdna(prop, NULL, "texflag", CU_AUTOSPACE);
1810  prop,
1811  "Auto Texture Space",
1812  "Adjust active object's texture space automatically when transforming object");
1813  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Curve_texspace_set");
1814 
1815  prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION);
1816  RNA_def_property_array(prop, 3);
1817  RNA_def_property_ui_text(prop, "Texture Space Location", "");
1818  RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT);
1819  RNA_def_property_editable_func(prop, "rna_Curve_texspace_editable");
1821  prop, "rna_Curve_texspace_loc_get", "rna_Curve_texspace_loc_set", NULL);
1822  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1823 
1824  prop = RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ);
1825  RNA_def_property_array(prop, 3);
1827  RNA_def_property_ui_text(prop, "Texture Space Size", "");
1828  RNA_def_property_editable_func(prop, "rna_Curve_texspace_editable");
1830  prop, "rna_Curve_texspace_size_get", "rna_Curve_texspace_size_set", NULL);
1831  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1832 
1833  /* materials */
1834  prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
1835  RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
1836  RNA_def_property_struct_type(prop, "Material");
1837  RNA_def_property_ui_text(prop, "Materials", "");
1838  RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
1840  prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
1841 
1842  prop = RNA_def_property(srna, "bevel_factor_start", PROP_FLOAT, PROP_FACTOR);
1843  RNA_def_property_float_sdna(prop, NULL, "bevfac1");
1844  RNA_def_property_range(prop, 0, 1.0);
1846  "Geometry Start Factor",
1847  "Define where along the spline the curve geometry starts (0 for the "
1848  "beginning, 1 for the end)");
1849  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1850 
1851  prop = RNA_def_property(srna, "bevel_factor_end", PROP_FLOAT, PROP_FACTOR);
1852  RNA_def_property_float_sdna(prop, NULL, "bevfac2");
1853  RNA_def_property_range(prop, 0, 1.0);
1855  "Geometry End Factor",
1856  "Define where along the spline the curve geometry ends (0 for the "
1857  "beginning, 1 for the end)");
1858  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1859 
1860  prop = RNA_def_property(srna, "is_editmode", PROP_BOOLEAN, PROP_NONE);
1861  RNA_def_property_boolean_funcs(prop, "rna_Curve_is_editmode_get", NULL);
1863  RNA_def_property_ui_text(prop, "Is Editmode", "True when used in editmode");
1864 
1866 
1867  RNA_api_curve(srna);
1868 }
1869 
1870 static void rna_def_curve_nurb(BlenderRNA *brna)
1871 {
1872  static const EnumPropertyItem spline_interpolation_items[] = {
1873  {KEY_LINEAR, "LINEAR", 0, "Linear", ""},
1874  {KEY_CARDINAL, "CARDINAL", 0, "Cardinal", ""},
1875  {KEY_BSPLINE, "BSPLINE", 0, "BSpline", ""},
1876  /* TODO: define somewhere, not one of BEZT_IPO_*. */
1877  {KEY_CU_EASE, "EASE", 0, "Ease", ""},
1878  {0, NULL, 0, NULL, NULL},
1879  };
1880 
1881  StructRNA *srna;
1882  PropertyRNA *prop;
1883 
1884  srna = RNA_def_struct(brna, "Spline", NULL);
1885  RNA_def_struct_sdna(srna, "Nurb");
1887  srna,
1888  "Spline",
1889  "Element of a curve, either NURBS, Bezier or Polyline or a character with text objects");
1890 
1891  prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
1893  RNA_def_property_struct_type(prop, "SplinePoint");
1895  "rna_BPoint_array_begin",
1896  "rna_iterator_array_next",
1897  "rna_iterator_array_end",
1898  "rna_iterator_array_get",
1899  "rna_Nurb_length",
1900  NULL,
1901  NULL,
1902  NULL);
1904  prop, "Points", "Collection of points that make up this poly or nurbs spline");
1905  rna_def_curve_spline_points(brna, prop);
1906 
1907  prop = RNA_def_property(srna, "bezier_points", PROP_COLLECTION, PROP_NONE);
1908  RNA_def_property_struct_type(prop, "BezierSplinePoint");
1909  RNA_def_property_collection_sdna(prop, NULL, "bezt", "pntsu");
1910  RNA_def_property_ui_text(prop, "Bezier Points", "Collection of points for Bezier curves only");
1911  rna_def_curve_spline_bezpoints(brna, prop);
1912 
1913  prop = RNA_def_property(srna, "tilt_interpolation", PROP_ENUM, PROP_NONE);
1914  RNA_def_property_enum_sdna(prop, NULL, "tilt_interp");
1915  RNA_def_property_enum_items(prop, spline_interpolation_items);
1917  prop, "Tilt Interpolation", "The type of tilt interpolation for 3D, Bezier curves");
1918  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1919 
1920  prop = RNA_def_property(srna, "radius_interpolation", PROP_ENUM, PROP_NONE);
1921  RNA_def_property_enum_sdna(prop, NULL, "radius_interp");
1922  RNA_def_property_enum_items(prop, spline_interpolation_items);
1924  prop, "Radius Interpolation", "The type of radius interpolation for Bezier curves");
1925  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1926 
1927  prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
1929  RNA_def_property_enum_funcs(prop, NULL, "rna_Nurb_type_set", NULL);
1930  RNA_def_property_ui_text(prop, "Type", "The interpolation type for this curve element");
1931  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1932 
1933  prop = RNA_def_property(srna, "point_count_u", PROP_INT, PROP_UNSIGNED);
1934  RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* Editing this needs knot recalc. */
1935  RNA_def_property_int_sdna(prop, NULL, "pntsu");
1937  prop, "Points U", "Total number points for the curve or surface in the U direction");
1938  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1939 
1940  prop = RNA_def_property(srna, "point_count_v", PROP_INT, PROP_UNSIGNED);
1941  RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* Editing this needs knot recalc. */
1942  RNA_def_property_int_sdna(prop, NULL, "pntsv");
1944  prop, "Points V", "Total number points for the surface on the V direction");
1945  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1946 
1947  prop = RNA_def_property(srna, "order_u", PROP_INT, PROP_NONE);
1948  RNA_def_property_int_sdna(prop, NULL, "orderu");
1950  RNA_def_property_range(prop, 2, 6);
1952  prop,
1953  "Order U",
1954  "NURBS order in the U direction (for splines and surfaces, higher values "
1955  "let points influence a greater area)");
1956  RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
1957 
1958  prop = RNA_def_property(srna, "order_v", PROP_INT, PROP_NONE);
1959  RNA_def_property_int_sdna(prop, NULL, "orderv");
1961  RNA_def_property_range(prop, 2, 6);
1963  "Order V",
1964  "NURBS order in the V direction (for surfaces only, higher values "
1965  "let points influence a greater area)");
1966  RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
1967 
1968  prop = RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
1969  RNA_def_property_int_sdna(prop, NULL, "resolu");
1971  RNA_def_property_range(prop, 1, 1024);
1972  RNA_def_property_ui_range(prop, 1, 64, 1, -1);
1973  RNA_def_property_ui_text(prop, "Resolution U", "Curve or Surface subdivisions per segment");
1974  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1975 
1976  prop = RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
1977  RNA_def_property_int_sdna(prop, NULL, "resolv");
1979  RNA_def_property_range(prop, 1, 1024);
1980  RNA_def_property_ui_range(prop, 1, 64, 1, -1);
1981  RNA_def_property_ui_text(prop, "Resolution V", "Surface subdivisions per segment");
1982  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
1983 
1984  prop = RNA_def_property(srna, "use_cyclic_u", PROP_BOOLEAN, PROP_NONE);
1988  prop, "Cyclic U", "Make this curve or surface a closed loop in the U direction");
1989  RNA_def_property_update(prop, 0, "rna_Nurb_update_cyclic_u");
1990 
1991  prop = RNA_def_property(srna, "use_cyclic_v", PROP_BOOLEAN, PROP_NONE);
1994  RNA_def_property_ui_text(prop, "Cyclic V", "Make this surface a closed loop in the V direction");
1995  RNA_def_property_update(prop, 0, "rna_Nurb_update_cyclic_v");
1996 
1997  prop = RNA_def_property(srna, "use_endpoint_u", PROP_BOOLEAN, PROP_NONE);
2001  prop,
2002  "Endpoint U",
2003  "Make this nurbs curve or surface meet the endpoints in the U direction");
2004  RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
2005 
2006  prop = RNA_def_property(srna, "use_endpoint_v", PROP_BOOLEAN, PROP_NONE);
2010  prop, "Endpoint V", "Make this nurbs surface meet the endpoints in the V direction ");
2011  RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
2012 
2013  prop = RNA_def_property(srna, "use_bezier_u", PROP_BOOLEAN, PROP_NONE);
2017  prop,
2018  "Bezier U",
2019  "Make this nurbs curve or surface act like a Bezier spline in the U direction");
2020  RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_u");
2021 
2022  prop = RNA_def_property(srna, "use_bezier_v", PROP_BOOLEAN, PROP_NONE);
2026  prop, "Bezier V", "Make this nurbs surface act like a Bezier spline in the V direction");
2027  RNA_def_property_update(prop, 0, "rna_Nurb_update_knot_v");
2028 
2029  prop = RNA_def_property(srna, "use_smooth", PROP_BOOLEAN, PROP_NONE);
2031  RNA_def_property_ui_text(prop, "Smooth", "Smooth the normals of the surface or beveled curve");
2032  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
2033 
2034  prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
2035  RNA_def_property_boolean_sdna(prop, NULL, "hide", 1);
2036  RNA_def_property_ui_text(prop, "Hide", "Hide this curve in Edit mode");
2037  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
2038 
2039  prop = RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED);
2040  RNA_def_property_int_sdna(prop, NULL, "mat_nr");
2041  RNA_def_property_ui_text(prop, "Material Index", "Material slot index of this curve");
2042  RNA_def_property_int_funcs(prop, NULL, NULL, "rna_Curve_material_index_range");
2043  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
2044 
2045  prop = RNA_def_property(srna, "character_index", PROP_INT, PROP_UNSIGNED);
2046  RNA_def_property_int_sdna(prop, NULL, "charidx");
2047  RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* Editing this needs knot recalc. */
2049  "Character Index",
2050  "Location of this character in the text data (only for text curves)");
2051  RNA_def_property_update(prop, 0, "rna_Curve_update_data");
2052 
2053  RNA_def_struct_path_func(srna, "rna_Curve_spline_path");
2054 
2055  RNA_api_curve_nurb(srna);
2056 }
2057 
2059 {
2060  rna_def_curve(brna);
2061  rna_def_surface(brna);
2062  rna_def_text(brna);
2063  rna_def_textbox(brna);
2064  rna_def_charinfo(brna);
2065  rna_def_bpoint(brna);
2066  rna_def_beztriple(brna);
2067  rna_def_curve_nurb(brna);
2068 }
2069 
2070 #endif
void BKE_nurb_handles_calc(struct Nurb *nu)
Definition: curve.cc:3995
void BKE_nurb_knot_calc_v(struct Nurb *nu)
Definition: curve.cc:1239
bool BKE_nurb_type_convert(struct Nurb *nu, short type, bool use_handles, const char **r_err_msg)
Definition: curve.cc:4833
bool BKE_nurb_order_clamp_u(struct Nurb *nu)
Definition: curve.cc:4813
void BKE_nurb_free(struct Nurb *nu)
Definition: curve.cc:622
void BKE_curve_texspace_ensure(struct Curve *cu)
Definition: curve.cc:555
void BKE_curve_dimension_update(struct Curve *cu)
Definition: curve.cc:465
void BKE_nurb_points_add(struct Nurb *nu, int number)
Definition: curve.cc:915
short BKE_curve_type_get(const struct Curve *cu)
void BKE_nurb_knot_calc_u(struct Nurb *nu)
Definition: curve.cc:1234
void BKE_nurbList_free(struct ListBase *lb)
Definition: curve.cc:649
bool BKE_nurb_order_clamp_v(struct Nurb *nu)
Definition: curve.cc:4823
void BKE_nurb_bezierPoints_add(struct Nurb *nu, int number)
Definition: curve.cc:928
ListBase * BKE_curve_nurbs_get(struct Curve *cu)
Definition: curve.cc:4976
void BKE_curve_texspace_calc(struct Curve *cu)
Definition: curve.cc:518
void BKE_curveprofile_init(struct CurveProfile *profile, short segments_len)
struct CurveProfile * BKE_curveprofile_add(eCurveProfilePresets preset)
Definition: curveprofile.cc:31
void id_lib_extern(struct ID *id)
Definition: lib_id.c:237
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition: report.c:83
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
bool BLI_remlink_safe(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:123
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int max_ii(int a, int b)
#define DEG2RADF(_deg)
MINLINE void copy_v3_v3(float r[3], const float a[3])
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
size_t BLI_strlen_utf8_ex(const char *strc, size_t *r_len_bytes) ATTR_NONNULL(1
#define UNUSED(x)
#define BLT_I18NCONTEXT_ID_ACTION
#define CTX_N_(context, msgid)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
#define MAX_ID_NAME
Definition: DNA_ID.h:337
@ CU_BEV_MODE_OBJECT
@ CU_BEV_MODE_ROUND
@ CU_BEV_MODE_CURVE_PROFILE
@ CU_BEZIER
@ CU_POLY
@ CU_NURBS
@ CU_AUTOSPACE
@ CU_ALIGN_X_FLUSH
@ CU_ALIGN_X_MIDDLE
@ CU_ALIGN_X_LEFT
@ CU_ALIGN_X_JUSTIFY
@ CU_ALIGN_X_RIGHT
@ CU_SMOOTH
struct BPoint BPoint
@ CU_BEVFAC_MAP_SPLINE
@ CU_BEVFAC_MAP_RESOLU
@ CU_BEVFAC_MAP_SEGMENT
#define CU_ACT_NONE
@ CU_NURB_CYCLIC
@ CU_NURB_ENDPOINT
@ CU_NURB_BEZIER
@ CU_TAPER_RADIUS_OVERRIDE
@ CU_TAPER_RADIUS_MULTIPLY
@ CU_TAPER_RADIUS_ADD
@ CU_ALIGN_Y_TOP
@ CU_ALIGN_Y_BOTTOM_BASELINE
@ CU_ALIGN_Y_CENTER
@ CU_ALIGN_Y_BOTTOM
@ CU_ALIGN_Y_TOP_BASELINE
@ HD_AUTO_ANIM
@ HD_VECT
@ HD_FREE
@ HD_AUTO
@ HD_ALIGN
#define KEY_CU_EASE
@ CU_CHINFO_WRAP
@ CU_CHINFO_UNDERLINE
@ CU_CHINFO_BOLD
@ CU_CHINFO_ITALIC
@ CU_CHINFO_SMALLCAPS
@ CU_TWIST_MINIMUM
@ CU_TWIST_TANGENT
@ CU_TWIST_Z_UP
@ BEZT_IPO_ELASTIC
@ BEZT_IPO_CIRC
@ BEZT_IPO_QUART
@ BEZT_IPO_BACK
@ BEZT_IPO_BOUNCE
@ BEZT_IPO_CUBIC
@ BEZT_IPO_EXPO
@ BEZT_IPO_CONST
@ BEZT_IPO_BEZ
@ BEZT_IPO_LIN
@ BEZT_IPO_SINE
@ BEZT_IPO_QUAD
@ BEZT_IPO_QUINT
@ CU_OVERFLOW_SCALE
@ CU_OVERFLOW_TRUNCATE
@ CU_OVERFLOW_NONE
@ CU_FILL_CAPS
@ CU_FAST
@ CU_3D
@ CU_FRONT
@ CU_FOLLOW
@ CU_PATH
@ CU_STRETCH
@ CU_PATH_RADIUS
@ CU_PATH_CLAMP
@ CU_MAP_TAPER
@ CU_BACK
@ CU_DEFORM_BOUNDS_OFF
@ PROF_PRESET_LINE
@ KEY_LINEAR
@ KEY_CARDINAL
@ KEY_BSPLINE
Object is a sort of wrapper for general info.
@ OB_SURF
@ OB_FONT
@ OB_CURVES_LEGACY
#define MAXFRAME
_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
Read Guarded memory(de)allocation.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
#define RNA_POINTER_INVALIDATE(ptr)
Definition: RNA_access.h:744
@ PARM_RNAPTR
Definition: RNA_types.h:354
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_USE_REPORTS
Definition: RNA_types.h:663
@ FUNC_USE_SELF_ID
Definition: RNA_types.h:650
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
@ PROP_UNIT_LENGTH
Definition: RNA_types.h:71
#define RNA_TRANSLATION_PREC_DEFAULT
Definition: RNA_types.h:117
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:312
@ PROP_THICK_WRAP
Definition: RNA_types.h:285
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_PROPORTIONAL
Definition: RNA_types.h:223
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_PTR_NO_OWNERSHIP
Definition: RNA_types.h:257
#define RNA_ENUM_ITEM_HEADING(name, description)
Definition: RNA_types.h:477
@ PROP_TIME
Definition: RNA_types.h:146
@ PROP_XYZ
Definition: RNA_types.h:162
@ PROP_DISTANCE
Definition: RNA_types.h:149
@ PROP_ANGLE
Definition: RNA_types.h:145
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_FACTOR
Definition: RNA_types.h:144
@ PROP_TRANSLATION
Definition: RNA_types.h:154
@ PROP_UNSIGNED
Definition: RNA_types.h:142
#define C
Definition: RandGen.cpp:25
#define NC_GEOM
Definition: WM_types.h:343
#define ND_DRAW
Definition: WM_types.h:410
#define ND_DATA
Definition: WM_types.h:456
#define NC_OBJECT
Definition: WM_types.h:329
return(oflags[bm->toolflag_index].f &oflag) !=0
#define SELECT
Scene scene
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
Definition: rna_access.c:4729
void rna_iterator_array_begin(CollectionPropertyIterator *iter, void *ptr, int itemsize, int length, bool free_ptr, IteratorSkipFunc skip)
Definition: rna_access.c:4781
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:186
void rna_def_animdata_common(StructRNA *srna)
static void rna_def_curve_spline_points(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_curve.c:1401
static void rna_def_nurbs(BlenderRNA *UNUSED(brna), StructRNA *UNUSED(srna))
Definition: rna_curve.c:1049
static const EnumPropertyItem beztriple_handle_type_items[]
Definition: rna_curve.c:30
static void rna_def_curve(BlenderRNA *brna)
Definition: rna_curve.c:1500
static void rna_def_bpoint(BlenderRNA *brna)
Definition: rna_curve.c:846
static const EnumPropertyItem curve3d_fill_mode_items[]
Definition: rna_curve.c:134
static void rna_def_text(BlenderRNA *brna)
Definition: rna_curve.c:1387
static void rna_def_beztriple(BlenderRNA *brna)
Definition: rna_curve.c:901
static void rna_def_surface(BlenderRNA *brna)
Definition: rna_curve.c:1375
const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[]
Definition: rna_curve.c:68
static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_curve.c:1462
static void rna_def_charinfo(BlenderRNA *brna)
Definition: rna_curve.c:1318
const EnumPropertyItem rna_enum_keyframe_handle_type_items[]
Definition: rna_curve.c:39
static void rna_def_path(BlenderRNA *UNUSED(brna), StructRNA *srna)
Definition: rna_curve.c:991
static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna)
Definition: rna_curve.c:1054
static const float tilt_limit
Definition: rna_curve.c:844
static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_curve.c:1431
static const EnumPropertyItem curve_type_items[]
Definition: rna_curve.c:126
static void rna_def_textbox(BlenderRNA *brna)
Definition: rna_curve.c:1278
static void rna_def_curve_nurb(BlenderRNA *brna)
Definition: rna_curve.c:1870
void RNA_def_curve(BlenderRNA *brna)
Definition: rna_curve.c:2058
void RNA_api_curve_nurb(StructRNA *srna)
Definition: rna_curve_api.c:93
void RNA_api_curve(StructRNA *srna)
Definition: rna_curve_api.c:71
void RNA_def_struct_refine_func(StructRNA *srna, const char *refine)
Definition: rna_define.c:1148
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2740
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1193
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4170
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1526
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3285
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
void RNA_def_property_enum_default(PropertyRNA *prop, int value)
Definition: rna_define.c:2106
void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3126
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2695
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Definition: rna_define.c:1653
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3474
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
Definition: rna_define.c:3420
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1539
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1737
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
Definition: rna_define.c:1920
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2769
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable)
Definition: rna_define.c:2855
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_def_property_enum_bitflag_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2669
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4342
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
Definition: rna_define.c:3028
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
Definition: rna_define.c:3597
void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2493
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1664
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3783
void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2343
void RNA_def_property_boolean_negative_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
Definition: rna_define.c:2327
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1503
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
#define min(a, b)
Definition: sort.c:35
float radius
float vec[3][3]
struct Object * bevobj
float loc[3]
struct CurveProfile * bevel_profile
short totcol
int len_char32
struct TextBox * tb
short resolv
struct EditFont * editfont
short bevresol
short resolu
struct CharInfo * strinfo
char bevel_mode
char * str
char texflag
EditNurb * editnurb
float offset
struct Object * taperobj
float size[3]
Definition: DNA_ID.h:368
char name[66]
Definition: DNA_ID.h:378
void * first
Definition: DNA_listBase.h:31
Definition: BKE_main.h:121
short orderu
struct Nurb * next
short orderv
short flag
short type
BezTriple * bezt
BPoint * bp
short resolu
short resolv
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
float max
#define N_(msgid)
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480