[Bf-blender-cvs] [0fc9526178a] master: Fix for batch rename operating on library collections & materials
Campbell Barton
noreply at git.blender.org
Tue Jan 18 05:05:17 CET 2022
Commit: 0fc9526178ad7024c9ac0a8af1ec4de957cafb21
Author: Campbell Barton
Date: Tue Jan 18 11:50:02 2022 +1100
Branches: master
https://developer.blender.org/rB0fc9526178ad7024c9ac0a8af1ec4de957cafb21
Fix for batch rename operating on library collections & materials
===================================================================
M release/scripts/startup/bl_operators/wm.py
===================================================================
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],
More information about the Bf-blender-cvs
mailing list