From 322abbd311020b535268da05cdbcb2e497105f16 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 28 Feb 2025 11:45:11 +1100 Subject: [PATCH 1/2] Fix file-selector operators performing an undo push on failure Operators are only expected to perform an undo push when finished. --- .../windowmanager/intern/wm_event_system.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index 8fc38eba296..e4c5601108f 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -2917,12 +2917,14 @@ static eHandlerActionFlag wm_handler_fileselect_do(bContext *C, } /* XXX check this carefully, `CTX_wm_manager(C) == wm` is a bit hackish. */ - if (CTX_wm_manager(C) == wm && wm->op_undo_depth == 0) { - if (handler->op->type->flag & OPTYPE_UNDO) { - ED_undo_push_op(C, handler->op); - } - else if (handler->op->type->flag & OPTYPE_UNDO_GROUPED) { - ED_undo_grouped_push_op(C, handler->op); + if (retval & OPERATOR_FINISHED) { + if (CTX_wm_manager(C) == wm && wm->op_undo_depth == 0) { + if (handler->op->type->flag & OPTYPE_UNDO) { + ED_undo_push_op(C, handler->op); + } + else if (handler->op->type->flag & OPTYPE_UNDO_GROUPED) { + ED_undo_grouped_push_op(C, handler->op); + } } } From 1833d79231464fa408a623c786d8e34d0ec0ca75 Mon Sep 17 00:00:00 2001 From: Jesse Yurkovich Date: Fri, 28 Feb 2025 01:47:37 +0100 Subject: [PATCH 2/2] Fix: USD: Don't attempt to export the special custom_normal attribute Suppress exporting this attribute as there's no conversion to USD that supports its data type (2d, 16-bit int) and because mesh normals (from the `corner_normals` API) are already exported. This causes a rather annoying UI Warning notification that the attribute isn't convertible during export. Pull Request: https://projects.blender.org/blender/blender/pulls/135271 --- source/blender/io/usd/intern/usd_writer_mesh.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/io/usd/intern/usd_writer_mesh.cc b/source/blender/io/usd/intern/usd_writer_mesh.cc index d4c94704f77..61f7f9cde1b 100644 --- a/source/blender/io/usd/intern/usd_writer_mesh.cc +++ b/source/blender/io/usd/intern/usd_writer_mesh.cc @@ -157,7 +157,7 @@ void USDGenericMeshWriter::write_custom_data(const Object *obj, * Skip edge domain because USD doesn't have a good conversion for them. */ if (iter.name[0] == '.' || bke::attribute_name_is_anonymous(iter.name) || iter.domain == bke::AttrDomain::Edge || - ELEM(iter.name, "position", "material_index", "velocity", "crease_vert")) + ELEM(iter.name, "position", "material_index", "velocity", "crease_vert", "custom_normal")) { return; }