From 0fc9526178ad7024c9ac0a8af1ec4de957cafb21 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Jan 2022 11:50:02 +1100 Subject: Fix for batch rename operating on library collections & materials --- release/scripts/startup/bl_operators/wm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'release') diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index e99858a64a5..1d2225d7848 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -2538,7 +2538,7 @@ class WM_OT_batch_rename(Operator): return data_type_test if data_type == data_type_test: data = ( - [id for id in context.selected_ids if isinstance(id, Collection)] + [id for id in context.selected_ids if isinstance(id, Collection) and id.library is None] if only_selected else scene.collection.children_recursive, "name", @@ -2613,10 +2613,10 @@ class WM_OT_batch_rename(Operator): elif data_type == 'MATERIAL': data = ( tuple(set( - slot.material + id for ob in context.selected_objects for slot in ob.material_slots - if slot.material is not None + if (id := slot.material) is not None and id.library is None )) if only_selected else [id for id in bpy.data.materials if id.library is None], -- cgit v1.2.3