Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-10-07 20:32:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-10-07 20:32:55 +0400
commit763358fe913c9ede43921f3ccc4cd6fdbfc5f809 (patch)
treed9ecd1ce68e412717e86502efe1380c507b08ec3 /source/blender/blenkernel/intern/material.c
parentdf63ccd904f28c3796f15ae14afcb18b45831fe9 (diff)
copy icon in the material buttons list view so you can copy the current set of materials to other selected objects, (like Ctrl+L, Materials in 2.4x)
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r--source/blender/blenkernel/intern/material.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 7e742dc5631..b44c59baaca 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -625,6 +625,25 @@ void assign_material(Object *ob, Material *ma, int act)
test_object_materials(ob->data);
}
+/* XXX - this calls many more update calls per object then are needed, could be optimized */
+void assign_matarar(struct Object *ob, struct Material ***matar, int totcol)
+{
+ int i, actcol_orig= ob->actcol;
+
+ while(ob->totcol)
+ object_remove_material_slot(ob);
+
+ /* now we have the right number of slots */
+ for(i=0; i<totcol; i++)
+ assign_material(ob, (*matar)[i], i+1);
+
+ if(actcol_orig > ob->totcol)
+ actcol_orig= ob->totcol;
+
+ ob->actcol= actcol_orig;
+}
+
+
int find_material_index(Object *ob, Material *ma)
{
Material ***matarar;