Fix for #36739: Delete new nodes added via the Add menu or toolbar if the subsequent...
authorLukas Toenne <lukas.toenne@googlemail.com>
Tue, 17 Sep 2013 13:07:48 +0000 (13:07 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Tue, 17 Sep 2013 13:07:48 +0000 (13:07 +0000)
commit29b546fe7f9ee4f03f785c7f985a9a15493a0afc
tree6ca380f0406e0de167a292779e2547b18aa30734
parent40b5b665273eb84771f41dd4a60db98e2cb845f5
Fix for #36739: Delete new nodes added via the Add menu or toolbar if the subsequent transform operator is cancelled. This prevents ugly situations where nodes stick "under" the toolbar after clicking a
wrong button.

Works by adding a flag to transform operators "remove_on_cancel". This is currently only used for node transforms, the idea is that if set, the operator will remove the transformed elements when it is
cancelled. It's not possible to do that in the original NODE_OT_add_node operator, because transform is modal and there is no way of reacting to a cancel outside of the transform itself (previous attempt
used a macro operator, but that also doesn't work because subsequent operators don't get executed if the previous transform cancels).
release/scripts/startup/bl_operators/node.py
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_ops.c