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>2016-07-20 22:56:12 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-07-20 23:02:34 +0300
commite0f16bdcc2892036aadb56ced343045822070aaa (patch)
tree4a76f29b4b8666cb4a9e13cbbabd332c7af0a88a
parentdd020caa04cfa009a6ff0b6e9b78ff32bdf514ef (diff)
Cleanup: use BKE naming convention for object materials
Also remove unused 'material_from' function (which isn't very useful).
-rw-r--r--source/blender/blenkernel/BKE_material.h8
-rw-r--r--source/blender/blenkernel/intern/material.c20
-rw-r--r--source/blender/editors/render/render_shading.c4
3 files changed, 9 insertions, 23 deletions
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index bbe104cd6ee..ddead79633f 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -78,15 +78,13 @@ enum {
};
struct Material *give_current_material(struct Object *ob, short act);
-struct ID *material_from(struct Object *ob, short act);
void assign_material_id(struct ID *id, struct Material *ma, short act);
void assign_material(struct Object *ob, struct Material *ma, short act, int assign_type);
void assign_matarar(struct Object *ob, struct Material ***matar, short totcol);
-short find_material_index(struct Object *ob, struct Material *ma);
-
-bool object_add_material_slot(struct Object *ob);
-bool object_remove_material_slot(struct Object *ob);
+short BKE_object_material_slot_find_index(struct Object *ob, struct Material *ma);
+bool BKE_object_material_slot_add(struct Object *ob);
+bool BKE_object_material_slot_remove(struct Object *ob);
void BKE_texpaint_slot_refresh_cache(struct Scene *scene, struct Material *ma);
void BKE_texpaint_slots_refresh_object(struct Scene *scene, struct Object *ob);
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 75fa42f1b61..0387a635c46 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -569,18 +569,6 @@ Material *give_current_material(Object *ob, short act)
return ma;
}
-ID *material_from(Object *ob, short act)
-{
-
- if (ob == NULL) return NULL;
-
- if (ob->totcol == 0) return ob->data;
- if (act == 0) act = 1;
-
- if (ob->matbits[act - 1]) return (ID *)ob;
- else return ob->data;
-}
-
Material *give_node_material(Material *ma)
{
if (ma && ma->use_nodes && ma->nodetree) {
@@ -886,7 +874,7 @@ void assign_matarar(struct Object *ob, struct Material ***matar, short totcol)
int actcol_orig = ob->actcol;
short i;
- while (object_remove_material_slot(ob)) {}
+ while (BKE_object_material_slot_remove(ob)) {}
/* now we have the right number of slots */
for (i = 0; i < totcol; i++)
@@ -899,7 +887,7 @@ void assign_matarar(struct Object *ob, struct Material ***matar, short totcol)
}
-short find_material_index(Object *ob, Material *ma)
+short BKE_object_material_slot_find_index(Object *ob, Material *ma)
{
Material ***matarar;
short a, *totcolp;
@@ -919,7 +907,7 @@ short find_material_index(Object *ob, Material *ma)
return 0;
}
-bool object_add_material_slot(Object *ob)
+bool BKE_object_material_slot_add(Object *ob)
{
if (ob == NULL) return false;
if (ob->totcol >= MAXMAT) return false;
@@ -1201,7 +1189,7 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime)
ma->id.tag &= ~LIB_TAG_DOIT;
}
-bool object_remove_material_slot(Object *ob)
+bool BKE_object_material_slot_remove(Object *ob)
{
Material *mao, ***matarar;
Object *obt;
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index c3f83138707..5865a93c996 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -102,7 +102,7 @@ static int material_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
if (!ob)
return OPERATOR_CANCELLED;
- object_add_material_slot(ob);
+ BKE_object_material_slot_add(ob);
if (ob->mode & OB_MODE_TEXTURE_PAINT) {
Scene *scene = CTX_data_scene(C);
@@ -145,7 +145,7 @@ static int material_slot_remove_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- object_remove_material_slot(ob);
+ BKE_object_material_slot_remove(ob);
if (ob->mode & OB_MODE_TEXTURE_PAINT) {
Scene *scene = CTX_data_scene(C);