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_meta.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_meta.c') diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 5e5cf0be0ae..1c7359cc195 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -330,7 +330,8 @@ static void rna_def_metaball(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"); /* anim */ rna_def_animdata_common(srna); -- cgit v1.2.3