diff options
author | Aras Pranckevicius <aras@nesnausk.org> | 2022-09-07 11:47:29 +0300 |
---|---|---|
committer | Aras Pranckevicius <aras@nesnausk.org> | 2022-09-07 12:57:34 +0300 |
commit | 97bd04d665cb8c964e9159da94a3c7941cd4841c (patch) | |
tree | fc6bdebcbe095f461c56b1b6375cc43c220d6195 /source/blender/editors/io/io_obj.c | |
parent | 788952705c623d3748c6e46fa244b63bd9209717 (diff) |
Fix T100797: C++ exporters do not remember the path on subsequent exports
Most/all C++ based IO code had a pattern of doing using
RNA_struct_property_is_set to check whether a default path needs to
be set. However, it returns false for properties restored from
"previous operator settings" (property restoration code sets
IDP_FLAG_GHOST flag on them, which "is set" sees and goes
"nope, not set").
The fix here is to apply similar logic as 10 years ago in the
T32855 fix (rBdb250a4): use RNA_struct_property_is_set_ex instead.
Reviewed By: Campbell Barton
Differential Revision: https://developer.blender.org/D15904
Diffstat (limited to 'source/blender/editors/io/io_obj.c')
-rw-r--r-- | source/blender/editors/io/io_obj.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/io/io_obj.c b/source/blender/editors/io/io_obj.c index 615c992ebff..2c1213d7a09 100644 --- a/source/blender/editors/io/io_obj.c +++ b/source/blender/editors/io/io_obj.c @@ -58,7 +58,7 @@ static const EnumPropertyItem io_obj_path_mode[] = { static int wm_obj_export_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { - if (!RNA_struct_property_is_set(op->ptr, "filepath")) { + if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) { Main *bmain = CTX_data_main(C); char filepath[FILE_MAX]; @@ -79,7 +79,7 @@ static int wm_obj_export_invoke(bContext *C, wmOperator *op, const wmEvent *UNUS static int wm_obj_export_exec(bContext *C, wmOperator *op) { - if (!RNA_struct_property_is_set(op->ptr, "filepath")) { + if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) { BKE_report(op->reports, RPT_ERROR, "No filename given"); return OPERATOR_CANCELLED; } @@ -410,7 +410,7 @@ static int wm_obj_import_exec(bContext *C, wmOperator *op) OBJ_import(C, &import_params); } } - else if (RNA_struct_property_is_set(op->ptr, "filepath")) { + else if (RNA_struct_property_is_set_ex(op->ptr, "filepath", false)) { /* Importing one file. */ RNA_string_get(op->ptr, "filepath", import_params.filepath); OBJ_import(C, &import_params); |