diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-07-17 19:12:12 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-07-17 19:16:07 +0400 |
commit | 1097a3f70d92f888f62a02bb7fb53a25b1059c7b (patch) | |
tree | 52f8f25e9e6039002702fba7473b74943a0d42fb /source/blender/makesrna/intern/rna_curve_api.c | |
parent | f46223f29e64f6a460b5e7a405d3d38abf765d79 (diff) |
Add helper to validate (and fix) material indices of meshes' polygons, curves' splines and texts' letters.
Useful especially for importer addons.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D650
Diffstat (limited to 'source/blender/makesrna/intern/rna_curve_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_curve_api.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_curve_api.c b/source/blender/makesrna/intern/rna_curve_api.c index b689242f68f..560cb633a19 100644 --- a/source/blender/makesrna/intern/rna_curve_api.c +++ b/source/blender/makesrna/intern/rna_curve_api.c @@ -58,6 +58,12 @@ void RNA_api_curve(StructRNA *srna) RNA_def_function_ui_description(func, "Transform curve by a matrix"); parm = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f); RNA_def_property_flag(parm, PROP_REQUIRED); + + func = RNA_def_function(srna, "validate_material_indices", "BKE_curve_material_index_validate"); + RNA_def_function_ui_description(func, "Validate material indices of splines or letters, return True when the curve " + "has had invalid indices corrected (to default 0)"); + parm = RNA_def_boolean(func, "result", 0, "Result", ""); + RNA_def_function_return(func, parm); } #endif |