Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undoing operations in 3D Viewport breaks ViewerDraw render #3923

Closed
DolphinDream opened this issue Feb 23, 2021 · 7 comments
Closed

Undoing operations in 3D Viewport breaks ViewerDraw render #3923

DolphinDream opened this issue Feb 23, 2021 · 7 comments
Labels

Comments

@DolphinDream
Copy link
Collaborator

DolphinDream commented Feb 23, 2021

Here’s a simple setup rendering with VD node.. when you annotate on viewport.. and undo, the VD node stops rendering. You have to force an update somehow (e.g. toggle show/hide on the VD node brings the rendering back, or Update All in the property panel).

As a matter of fact this may be due to the UNDO operation isself, not necessarily to what is being undo (e..g the annotation). If you add an object to the scene and then undo, it has the same behavior on the VD node viewport updates.

image

SV-undo-annotation-breaks-VD-render.mov
@DolphinDream
Copy link
Collaborator Author

DolphinDream commented Feb 23, 2021

To be honest.. i had so many issues with various nodes just not updating correctly with the latest SV updates (e.g. compared to the way SV used to work/update 1 year ago). Lately when the updates don’t work correctly I find myself tapping on nodes inputs and toggles just to get them to generate output and update their viewers or the stethoscopes. I noticed that sometimes if any node fails for some reason other nodes in the node tree somehow fail to update correctly even if the failing node is not connected to other nodes. I find myself having to have to fix the failing node just so the other unrelated nodes finish updating themselves correctly.

@zeffii
Copy link
Collaborator

zeffii commented Feb 23, 2021

I haven't had much time with Sverchok lately, if it feels "glitchy" then that definitely needs to be addressed. Unfortunately the undo blender operator has a few side effects, and we have to defend against it in def sv_handler_undo_post(scene):

if you're interested you might look at def sv_handler_undo_post(scene): and see if it gets called after an undo of GPencil. It might just mean that you need to add an extra call to all drawing nodes in all visible node trees at the end of that handler.

@DolphinDream
Copy link
Collaborator Author

@zeffii The “glichy” undo behavior seems to be caused by other undo operations (e.g. adding a mesh object) not necessarily due to grease pencils undos. With grease pencil is where I first observed it though.

@DolphinDream
Copy link
Collaborator Author

DolphinDream commented Feb 23, 2021

Hm.. i’m getting a strange message about a node being removed.. while no node was removed. (undoing adding an object in the viewport).

sv_handler_undo_post called # I added this print to this handler
looks like a node was removed, cleaning

@Durman
Copy link
Collaborator

Durman commented Feb 24, 2021

All links to Blender objects leads to wrong memory address after undo event. Using such objects can cause Blender crash easily. To prevent it cleaning all references is used in the code. Probably it's better to press update tree button after undoing to reavulate whole tree.

@zeffii
Copy link
Collaborator

zeffii commented Feb 24, 2021

I don't believe we have any way to find out what kind of "undo event" was triggered by the user. (or do we?!) Maybe we can figure out the active context from within the undo handler.

  • if the undo event is triggered while a Sverchok node tree is active, then perform the current code
  • if the undo is from a 3dview, then ignore it.

but i suspect this will also not be a complete solution.

@DolphinDream DolphinDream changed the title Undoing annotation breaks ViewerDraw render Undoing operations in 3D Viewport breaks ViewerDraw render Feb 25, 2021
@Durman Durman added the todo label Mar 13, 2021
@Durman
Copy link
Collaborator

Durman commented Jul 27, 2021

Now should work properly #4164

@Durman Durman closed this as completed Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants