Fix #124479: Collection Export: Clear last-used operator properties
Collection Export and File->Export were inadvertently sharing the "last used" operator properties. This would cause settings that were used during File->Export to interfere, silently, when exporting the collections. Or vice versa. Pull Request: https://projects.blender.org/blender/blender/pulls/124481
This commit is contained in:
committed by
Jesse Yurkovich
parent
85760b6a13
commit
a362c225c0
@@ -608,10 +608,21 @@ static int collection_exporter_export(bContext *C,
|
||||
const Main *bmain = CTX_data_main(C);
|
||||
BLI_path_abs(filepath, BKE_main_blendfile_path(bmain));
|
||||
|
||||
/* Ensure that any properties from when this operator was "last used" are cleared. Save them for
|
||||
* restoration later. Otherwise properties from a regular File->Export may contaminate this
|
||||
* collection export. */
|
||||
IDProperty *last_properties = ot->last_properties;
|
||||
ot->last_properties = nullptr;
|
||||
|
||||
RNA_string_set(&properties, "filepath", filepath);
|
||||
RNA_string_set(&properties, "collection", collection_name);
|
||||
int op_result = WM_operator_name_call_ptr(C, ot, WM_OP_EXEC_DEFAULT, &properties, nullptr);
|
||||
|
||||
/* Free the "last used" properties that were just set from the collection export and restore the
|
||||
* original "last used" properties. */
|
||||
IDP_FreeProperty(ot->last_properties);
|
||||
ot->last_properties = last_properties;
|
||||
|
||||
IDP_FreeProperty(op_props);
|
||||
|
||||
if (report_success && op_result == OPERATOR_FINISHED) {
|
||||
|
||||
Reference in New Issue
Block a user