diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-30 10:48:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-30 10:48:18 +0400 |
commit | 648f40f409f1f3fd351a9baa3d0a9f29c4033cf1 (patch) | |
tree | 9828641c5e9333c697c5d8647e1fa2eb1c9820bf | |
parent | 449f8ce4feeef8cfa57a8cbe299e0e718b9473b4 (diff) |
bugfix [#22660] Text Boxes properties are not animateable.
suggestion [#23093] Curve -> CurveMapping in brush...
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 15 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 7a08e1403e3..b9664c556db 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -731,7 +731,7 @@ static void rna_def_brush(BlenderRNA *brna) prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); - RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve"); + RNA_def_property_ui_text(prop, "CurveMapping", "Editable falloff curve"); RNA_def_property_update(prop, 0, "rna_Brush_update"); /* texture */ diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 84807446f50..e006f3444b0 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -510,6 +510,18 @@ static void rna_Curve_active_spline_set(PointerRNA *ptr, PointerRNA value) cu->actnu= BLI_findindex(nubase, nu); } +static char *rna_TextBox_path(PointerRNA *ptr) +{ + Curve *cu= (Curve*)ptr->id.data; + TextBox *tb= ptr->data; + int index= (int)(tb - cu->tb); + + if (index >= 0 && index < cu->totbox) + return BLI_sprintfN("textboxes[%d]", index); + else + return BLI_strdup(""); +} + #else static void rna_def_bpoint(BlenderRNA *brna) @@ -841,7 +853,6 @@ static void rna_def_textbox(BlenderRNA *brna) srna= RNA_def_struct(brna, "TextBox", NULL); RNA_def_struct_ui_text(srna, "Text Box", "Text bounding box for layout"); - // XXX: still needs path function /* number values */ prop= RNA_def_property(srna, "x", PROP_FLOAT, PROP_NONE); @@ -867,6 +878,8 @@ static void rna_def_textbox(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Textbox Height", ""); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + + RNA_def_struct_path_func(srna, "rna_TextBox_path"); } static void rna_def_charinfo(BlenderRNA *brna) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 6b8c9a5e3a4..2a708c82697 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -4803,7 +4803,7 @@ static PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class) reg= RNA_struct_register(srna); if(!reg) { - PyErr_SetString(PyExc_ValueError, "bpy.types.register(...): expected a Type subclassed from a registerable rna type (no register supported)."); + PyErr_Format(PyExc_ValueError, "bpy.types.register(...): expected a subclass of a registerable rna type (%.200s does not support registration).", RNA_struct_identifier(srna)); return NULL; } |