Cleanup: Remove unused function: give_node_material()

This commit is contained in:
Antonio Vazquez 2020-02-05 11:25:50 +01:00
parent 1bc2a98a9d
commit c35d6b1854
3 changed files with 8 additions and 45 deletions

View File

@ -60,7 +60,6 @@ void BKE_material_copy_data(struct Main *bmain,
const int flag);
struct Material *BKE_material_copy(struct Main *bmain, const struct Material *ma);
struct Material *BKE_material_localize(struct Material *ma);
struct Material *give_node_material(struct Material *ma); /* returns node material or self */
void BKE_material_make_local(struct Main *bmain, struct Material *ma, const bool lib_local);
void BKE_gpencil_material_attr_init(struct Material *ma);
@ -87,7 +86,10 @@ struct Material *BKE_object_material_get(struct Object *ob, short act);
void BKE_id_material_assign(struct Main *bmain, struct ID *id, struct Material *ma, short act);
void BKE_object_material_assign(
struct Main *bmain, struct Object *ob, struct Material *ma, short act, int assign_type);
void BKE_object_material_array_assign(struct Main *bmain, struct Object *ob, struct Material ***matar, short totcol);
void BKE_object_material_array_assign(struct Main *bmain,
struct Object *ob,
struct Material ***matar,
short totcol);
short BKE_object_material_slot_find_index(struct Object *ob, struct Material *ma);
bool BKE_object_material_slot_add(struct Main *bmain, struct Object *ob);

View File

@ -618,19 +618,6 @@ MaterialGPencilStyle *BKE_gpencil_material_settings(Object *ob, short act)
}
}
Material *give_node_material(Material *ma)
{
if (ma && ma->use_nodes && ma->nodetree) {
bNode *node = nodeGetActiveID(ma->nodetree, ID_MA);
if (node) {
return (Material *)node->id;
}
}
return NULL;
}
void BKE_material_resize_object(Main *bmain, Object *ob, const short totcol, bool do_id_user)
{
Material **newmatar;
@ -937,7 +924,10 @@ void BKE_material_remap_object_calc(Object *ob_dst, Object *ob_src, short *remap
}
/* XXX - this calls many more update calls per object then are needed, could be optimized */
void BKE_object_material_array_assign(Main *bmain, struct Object *ob, struct Material ***matar, short totcol)
void BKE_object_material_array_assign(Main *bmain,
struct Object *ob,
struct Material ***matar,
short totcol)
{
int actcol_orig = ob->actcol;
short i;

View File

@ -2290,7 +2290,6 @@ static size_t animdata_filter_ds_material(
static size_t animdata_filter_ds_materials(
bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
{
bool has_nested = false;
size_t items = 0;
int a = 0;
@ -2302,34 +2301,6 @@ static size_t animdata_filter_ds_materials(
if (ma) {
/* add channels */
items += animdata_filter_ds_material(ac, anim_data, ads, ma, filter_mode);
/* for optimising second pass - check if there's a nested material here to come back for */
if (has_nested == false) {
has_nested = (give_node_material(ma) != NULL);
}
}
}
/* Second pass: go through a second time looking for "nested" materials
* (material.material references).
*
* NOTE: here we ignore the expanded status of the parent, as it could be too confusing as to
* why these are disappearing/not available,
* since the relationships between these is not that clear.
*/
if (has_nested) {
for (a = 1; a <= ob->totcol; a++) {
Material *base = BKE_object_material_get(ob, a);
Material *ma = give_node_material(base);
/* add channels from the nested material if it exists
* - skip if the same material is referenced in its node tree
* (which is common for BI materials) as that results in
* confusing duplicates
*/
if ((ma) && (ma != base)) {
items += animdata_filter_ds_material(ac, anim_data, ads, ma, filter_mode);
}
}
}