Fix T59062: Keyframed node properties stay linked after shading network duplication.

There is no reason not to duplicate Actions too here, especially when
Materials' Actions are pretty much impossible to edit from current UI
(afaik, DopeSheet editor does not has any way to change them?).
This commit is contained in:
Bastien Montagne 2019-02-13 17:19:18 +01:00
parent 46c871b4ae
commit a75ac18638
Notes: blender-bot 2023-02-14 10:54:29 +01:00
Referenced by commit f79b4850fb, Fix T81248: World nodetree action is linked after duplication
Referenced by issue #65175, Animation Data on lamp stays linked even after unlinking all its data
Referenced by issue #59256, FCurve modifiers are not autonomous on Nodes
Referenced by issue #59062, Keyframed node properties stay linked after shading network duplication
1 changed files with 3 additions and 1 deletions

View File

@ -526,7 +526,9 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
/* add or copy material */
if (ma) {
ma = BKE_material_copy(bmain, ma);
Material *new_ma = NULL;
BKE_id_copy_ex(bmain, &ma->id, (ID **)&new_ma, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS);
ma = new_ma;
}
else {
const char *name = DATA_("Material");