Node editor: Changing object pointers for multiple nodes registers as a single action for undo
Open, Needs TriagePublic


System Information
win 8.1x64, 3x gtx580

Blender Version

Short description of error
Either changing object pointers for multiple nodes or repeated changes of a single node object pointer registers as a single action for undo. Executing Undo reverts all the pointer changes simultaneously, regardless if there were 1 or 10 of them.

Exact steps for others to reproduce the error

  • In the node editor, change the Object parameter of one, then another Texture Coordinate nodes.
  • Do Undo.
  • Object parameter of both changes gets undone.

If this is hard to correct due to some inherent property of particular parameter type, maybe when changing it, the node affected could get selected, as node selection seems to register with undo fine.



This is true for any pointer property afaics [changing any of these wont register in undo on first sight], so nothing particular to the Node editor.
This might be a known limitation, or a design decission, needs further clarification...

Soo, looked into this a bit further and it seems like PROP_POINTER buttons indeed dont get undo pushes.
For a little detour: these are not flagged with UI_BUT_UNDO because they are of type UI_BTYPE_SEARCH_MENU (when they get defined via uiDefAutoButR)
Code is explicitly stating (here) that

/* buttons with value >= UI_BTYPE_SEARCH_MENU don't get undo pushes */

as can be followed here and here (we dont get an uiAfterFunc with undostr, so no undo push here...)

If we actually allow SEARCH_MENU buttons [only the ones that represent PROP_POINTER] like in D3489
blender seems to go properly through undosys_step_encode, undosys_step_decode and I didnt run into problems yet.
(but it may very well be that I dont oversee all consequences this might have...)

I think @Campbell Barton (campbellbarton) needs to have a look here though, current behavior could as well be by design and report could be closed...