diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-20 20:28:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-20 20:28:05 +0300 |
commit | 03e943be527e7d898b4b85b7709f1b5aa852b8a0 (patch) | |
tree | 0d85bd65aee45587ba6d99e7883b48bbe6b55420 /source/blender/makesrna | |
parent | 7b16d7496d7347002f83bd52d779e52c06270115 (diff) |
Allow keyframing editmode curve values, also fix a bug where adding a new curve would always use object mode spline list but removing would use editmode when set.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index efb94e4d19d..ea08930e849 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -544,7 +544,7 @@ static Nurb *rna_Curve_spline_new(Curve *cu, int type) nu->resolu= nu->resolv= 12; nu->flag= CU_SMOOTH; - BLI_addtail(&cu->nurb, nu); + BLI_addtail(BKE_curve_nurbs(cu), nu); return nu; } @@ -642,6 +642,12 @@ static char *rna_TextBox_path(PointerRNA *ptr) return BLI_strdup(""); } +static void rna_Curve_splines_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + Curve *cu= (Curve*)ptr->id.data; + rna_iterator_listbase_begin(iter, BKE_curve_nurbs(cu), NULL); +} + #else static void rna_def_bpoint(BlenderRNA *brna) @@ -1189,8 +1195,14 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "key"); RNA_def_property_ui_text(prop, "Shape Keys", ""); + prop= RNA_def_property(srna, "splines", PROP_COLLECTION, PROP_NONE); +#if 0 RNA_def_property_collection_sdna(prop, NULL, "nurb", NULL); +#else + /* this way we get editmode nurbs too, keyframe in editmode */ + RNA_def_property_collection_funcs(prop, "rna_Curve_splines_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); +#endif RNA_def_property_struct_type(prop, "Spline"); RNA_def_property_ui_text(prop, "Splines", "Collection of splines in this curve data object"); rna_def_curve_splines(brna, prop); |