Fix T39018: Duplicate entries for material/shader in AnimEditors

In many BI shader setups, the material which owns the nodetree is often itself
included as a node in that nodetree (i.e. to provide the base colour for that
mesh). This would often result in the material (and its subtree) getting included
in the dopesheet results twice.
This commit is contained in:
Joshua Leung 2014-03-09 19:23:32 +13:00
parent fa24ad1fd5
commit d219312d44

@ -1796,11 +1796,16 @@ static size_t animdata_filter_ds_materials(bAnimContext *ac, ListBase *anim_data
Material *base = give_current_material(ob, a); Material *base = give_current_material(ob, a);
Material *ma = give_node_material(base); Material *ma = give_node_material(base);
/* add channels from the nested material if it exists */ /* add channels from the nested material if it exists
if (ma) * - 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); items += animdata_filter_ds_material(ac, anim_data, ads, ma, filter_mode);
} }
} }
}
/* return the number of items added to the list */ /* return the number of items added to the list */
return items; return items;