[Bf-blender-cvs] [a75ac18638f] master: Fix T59062: Keyframed node properties stay linked after shading network duplication.

Bastien Montagne noreply at git.blender.org
Wed Feb 13 17:20:59 CET 2019


Commit: a75ac18638f41d8b427b7519628602b6be54d995
Author: Bastien Montagne
Date:   Wed Feb 13 17:19:18 2019 +0100
Branches: master
https://developer.blender.org/rBa75ac18638f41d8b427b7519628602b6be54d995

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?).

===================================================================

M	source/blender/editors/render/render_shading.c

===================================================================

diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 7576ca8f764..6f78b9338f5 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -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");



More information about the Bf-blender-cvs mailing list