Fix for batch rename operating on library collections & materials
This commit is contained in:
@@ -2538,7 +2538,7 @@ class WM_OT_batch_rename(Operator):
|
|||||||
return data_type_test
|
return data_type_test
|
||||||
if data_type == data_type_test:
|
if data_type == data_type_test:
|
||||||
data = (
|
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
|
if only_selected else
|
||||||
scene.collection.children_recursive,
|
scene.collection.children_recursive,
|
||||||
"name",
|
"name",
|
||||||
@@ -2613,10 +2613,10 @@ class WM_OT_batch_rename(Operator):
|
|||||||
elif data_type == 'MATERIAL':
|
elif data_type == 'MATERIAL':
|
||||||
data = (
|
data = (
|
||||||
tuple(set(
|
tuple(set(
|
||||||
slot.material
|
id
|
||||||
for ob in context.selected_objects
|
for ob in context.selected_objects
|
||||||
for slot in ob.material_slots
|
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
|
if only_selected else
|
||||||
[id for id in bpy.data.materials if id.library is None],
|
[id for id in bpy.data.materials if id.library is None],
|
||||||
|
|||||||
Reference in New Issue
Block a user