diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-09-17 17:07:48 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-09-17 17:07:48 +0400 |
commit | 29b546fe7f9ee4f03f785c7f985a9a15493a0afc (patch) | |
tree | 6ca380f0406e0de167a292779e2547b18aa30734 /source/blender/editors/transform/transform_ops.c | |
parent | 40b5b665273eb84771f41dd4a60db98e2cb845f5 (diff) |
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).
Diffstat (limited to 'source/blender/editors/transform/transform_ops.c')
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index eb204be3220..53b43b6c969 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -537,6 +537,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags) if (flags & P_OPTIONS) { RNA_def_boolean(ot->srna, "texture_space", 0, "Edit Texture Space", "Edit Object data texture space"); + RNA_def_boolean(ot->srna, "remove_on_cancel", 0, "Remove on Cancel", "Remove elements on cancel"); } if (flags & P_CORRECT_UV) { |