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