Undoing OP.destroy() calls and similar operations causes crash

ui.undo.startBlock('Render Setup')
ui.panes.current.placeOPs(_ops, delOP=parent())
ui.undo.endBlock()

Undoing this consistently crashes for example.

Same with

ui.panes.current.placeOPs(_ops, delOP=parent(), undoName='Operators')

Thanks for report! We’re looking into this. (@selina)

Actually @function.store can you send a test file that crashes. Need to see what “parent” is in your example. Seems strange that you would delete the parent of the current script that is running when you call that.

Sure thing. For context I am developing an OP template / OP snippet system.
Place the attached tox it in a project and enable cooking, then click anywhere to place the OPs from within the COMP, and then hit undo to crash.

renderTOPtemplate_undo_crash.tox (10.0 KB)

(for more context I am copying this COMP to the current pane in my system and want to get rid of the parent comp since only the inside contents were needed)

Thanks for the example. The crash will be fixed in the next release (coming shortly).

You don’t actually need the startBlock & endBlock in your script, since placeOPs happen after your script has finished executing (i.e. the undo blocks you have created are empty), and it will setup undo creations after you place. However undoing everything will recreate and execute the script with placeOPs in onCreate which is something you don’t want. Have you looked into setting up the panel to drop selected items?

1 Like

My pleasure!
Thanks for the tip, but I am summoning this setup when I place a Render TOP and press ctrl+alt hotkey so draggable panels don’t help. Looking forward to the update!