diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-27 19:52:28 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-27 19:52:28 +0300 |
commit | e7010a05beba64af032707b1818af707f398cc8d (patch) | |
tree | 238bec03b65cbc3690301c51257186abc4495e7c /source/blender/makesrna/intern/rna_ID.c | |
parent | 1863883a248faa1fcae4b99332c8d5e6d3957845 (diff) | |
parent | 38cb29d67e5947f99824987dcd567a82cfd51646 (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_scene_api.c
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 952d27fa18d..1ea452bf389 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -500,9 +500,9 @@ static Material *rna_IDMaterials_pop_id(ID *id, Main *bmain, ReportList *reports return ma; } -static void rna_IDMaterials_clear_id(ID *id, int remove_material_slot) +static void rna_IDMaterials_clear_id(ID *id, Main *bmain, int remove_material_slot) { - BKE_material_clear_id(G.main, id, remove_material_slot); + BKE_material_clear_id(bmain, id, remove_material_slot); DEG_id_tag_update(id, OB_RECALC_DATA); WM_main_add_notifier(NC_OBJECT | ND_DRAW, id); @@ -945,6 +945,7 @@ static void rna_def_ID_materials(BlenderRNA *brna) RNA_def_function_return(func, parm); func = RNA_def_function(srna, "clear", "rna_IDMaterials_clear_id"); + RNA_def_function_flag(func, FUNC_USE_MAIN); RNA_def_function_ui_description(func, "Remove all materials from the data-block"); RNA_def_boolean(func, "update_data", 0, "", "Update data by re-adjusting the material slots assigned"); } |