Fix T59062: Keyframed node properties stay linked after shading network duplication.
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 13 Feb 2019 16:19:18 +0000 (17:19 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 13 Feb 2019 16:20:49 +0000 (17:20 +0100)
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?).

source/blender/editors/render/render_shading.c

index 7576ca8..6f78b93 100644 (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");