Page MenuHome

WM: batch rename collections
AbandonedPublic

Authored by RedMser (RedMser) on Jan 12 2022, 7:24 PM.

Details

Summary

WM: batch rename collections

User must activate the operator from the outliner,
so that the selected collections can be determined.


Diff Detail

Repository
rB Blender
Branch
collection-batch (branched from master)
Build Status
Buildable 19951
Build 19951: arc lint + arc unit

Event Timeline

RedMser (RedMser) requested review of this revision.Jan 12 2022, 7:24 PM
RedMser (RedMser) created this revision.
RedMser (RedMser) edited the summary of this revision. (Show Details)Jan 12 2022, 7:27 PM
Campbell Barton (campbellbarton) requested changes to this revision.Jan 14 2022, 2:24 AM
Campbell Barton (campbellbarton) added inline comments.
release/scripts/startup/bl_operators/wm.py
2540–2547

Committed children_recursive rB7c568e7d36710aba782a628dfff3b8bcea88be3b so this function doesn't need to be included in-line.

2549

Extra space.

2551

Use list comprehensions (following the convention of other functions here).

This revision now requires changes to proceed.Jan 14 2022, 2:24 AM
RedMser (RedMser) marked 3 inline comments as done.
  • Rebase onto master
  • Apply feedback from review
Campbell Barton (campbellbarton) requested changes to this revision.Jan 17 2022, 10:14 AM
Campbell Barton (campbellbarton) added inline comments.
release/scripts/startup/bl_operators/wm.py
2541

Missed this last review:

Regarding: id.rna_type.identifier == 'Collection' - Accessing rna_type is needed in some rare cases, in general though isinstance() should be used (or compare it's type if an exact check is what's intended).

eg:

from bpy.types import Collection
... snip ...
[id for id in context.selected_ids if isinstance(id, Collection)]
This revision now requires changes to proceed.Jan 17 2022, 10:14 AM

Use isinstance for checking if id is a collection

RedMser (RedMser) marked an inline comment as done.Jan 17 2022, 12:54 PM

This was committed in rB54fb1a75ee19