diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-08-07 17:33:48 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-08-07 17:35:39 +0300 |
commit | 96f20c34a216215a6f4b94e1886485a0d72a4205 (patch) | |
tree | 39e7dc3f36bc86ceccff4e3c7c3b8a176e4aa507 /source/blender | |
parent | c677bd44ceca6ebd85b5aaf225d551fd1da1bdd1 (diff) |
Data Transfer operator: Add a 'freeze' setting to prevent operator from re-running when changing settings.
This is likely weak design, but allows people to change several settings without having to wait
several tenth of seconds each time, when e.g. transferring UVs between heavy geometries.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/object/object_data_transfer.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 0b604a73977..90c3f0026ac 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -329,6 +329,8 @@ static int data_transfer_exec(bContext *C, wmOperator *op) bool changed = false; + const bool is_frozen = RNA_boolean_get(op->ptr, "use_freeze"); + const bool reverse_transfer = RNA_boolean_get(op->ptr, "use_reverse_transfer"); const int data_type = RNA_enum_get(op->ptr, "data_type"); @@ -358,6 +360,12 @@ static int data_transfer_exec(bContext *C, wmOperator *op) SpaceTransform space_transform_data; SpaceTransform *space_transform = (use_object_transform && !use_auto_transform) ? &space_transform_data : NULL; + if (is_frozen) { + BKE_report(op->reports, RPT_INFO, + "Operator is frozen, changes to its settings won't take effect until you unfreeze it"); + return OPERATOR_FINISHED; + } + if (reverse_transfer && ((ID *)(ob_src->data))->lib) { /* Do not transfer to linked data, not supported. */ return OPERATOR_CANCELLED; @@ -524,6 +532,10 @@ void OBJECT_OT_data_transfer(wmOperatorType *ot) "Transfer from selected objects to active one"); RNA_def_property_flag(prop, PROP_HIDDEN); + RNA_def_boolean(ot->srna, "use_freeze", false, "Freeze Operator", + "Prevent changes to settings to re-run the operator, " + "handy to change several things at once with heavy geometry"); + /* Data type to transfer. */ ot->prop = RNA_def_enum(ot->srna, "data_type", DT_layer_items, 0, "Data Type", "Which data to transfer"); RNA_def_boolean(ot->srna, "use_create", true, "Create Data", "Add data layers on destination meshes if needed"); |