Page MenuHome

Can't copy and paste Normal Node position value
Open, Confirmed, MediumPublic


System Information
Operating system: Windows 10 (64 bit)
Graphics card: NVIDIA GeForce GTX 1050 Ti

Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-07-18 14:52, hash: 38d4483c6a51, type: Release
build date: Thu 07/18/2019, 09:28 AM platform: Windows

Worked: version: 2.79 (sub 0), branch: master, commit date: 2018-03-22 14:10, hash: f4dc9f9d68b, type:
build date: Thu 03/22/2018, 09:59 AM platform: Windows

Short description of error
The value of the normal node cannot be copied and pasted to another normal node.

Exact steps for others to reproduce the error
-Open a Shader Editor window;
-Add a pair of new Normal nodes (Add->Vector->Normal, two times);
-Click and drag the sphere depicting the normal value in the first Normal node;
-Hover over the sphere, hit ctrl+ckey to copy the normal value;
-Hover over the other sphere in the second normal node;
-Press ctrl+vkey to paste the normal value.

Expected behavior
The second normal node should update to show a normal value matching that of the first node.

Additional notes:
This was working in Blender 2.79. In 2.80 rc2, the "Copy to Selected" option in the RMB context menu works fine, but it can't be used to copy the value of the normal node from one material to another, only within the same material. The mouse-over copy-paste functionality does appear to be working for everything else (colors, numbers, even the RGB Curves node!), so hopefully this is a simple problem to solve.

I'd be happy to provide images or a .blend file if you need them, but it's hard to capture the fact that the program isn't copying or pasting the value from the normal node in an image or a .blend file.



Event Timeline

Sebastian Parborg (zeddb) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.

OK, so issue is that when leaving 'edit' mode of the pasted button, code applies one last time the value from edit struct to the button. This is not good in that case, since pasting directly edit orig data, not temp button editing one, which is hence in orig state.

That simple patch fixes reported issue, but would rather have someone more at ease with UI code to have a look at it, since I cannot understand *why* it seems to only affect the normal widget, and not e.g. the color swatch one?

diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index d4e8b7548bc..01f148711bd 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2296,6 +2296,9 @@ static void ui_but_paste_normalized_vector(bContext *C, uiBut *but, char *buf_pa
       xyz[2] = 1.0;
     ui_but_set_float_array(C, but, NULL, xyz, 3);
+    but->active->applied = true;
+    but->active->applied_interactive = true;
   else {
     WM_report(RPT_ERROR, "Paste expected 3 numbers, formatted: '[n, n, n]'");