From 9a88524f681d62cee51dfbc3186d59b4b0712a05 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Oct 2011 17:54:33 +0000 Subject: support for object data material assignment in python eg: bpy.context.object.data.materials[0] = bpy.data.materials["SomeMaterial"] --- source/blender/makesrna/intern/rna_curve.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_curve.c') diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 28c1a3bc234..edae977f3f6 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1428,7 +1428,8 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol"); RNA_def_property_struct_type(prop, "Material"); RNA_def_property_ui_text(prop, "Materials", ""); - RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */ + RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */ + RNA_def_property_collection_funcs(prop, 0, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int"); } static void rna_def_curve_nurb(BlenderRNA *brna) -- cgit v1.2.3