So, we select multiple collections with some objects, use command and select all objects inside all those collections. Im pretty sure there should be some addon for this.
I was able to find this one. But it doesnt work for me in 3.1.2, and anyway its not exactly what i was looking for.
p.s. no putting all collections inside another collections is not the solution.
You donât really need an add-on, just toss this in the simple operator template:
collections = [bpy.data.collections["collection_name"], bpy.data.collections["collection_name1"]]
for collection in collections:
for obj in collection.all_objects:
obj.select_set(True)
You gotta replace those collection_nameâs with the correct ones from your scene. In his example he put only two collections in the array, but you gotta modify the code so all your collections, with the right names, are in that array.
This script will select all selected collection children.
import bpy
class SelectCollectionChildren(bpy.types.Operator):
bl_idname = "outliner.select_collection_children"
bl_label = "Select Collection Children"
def execute(self, context):
for w in context.window_manager.windows:
s = w.screen
for a in s.areas:
if a.type == "OUTLINER":
with context.temp_override(window=w, area=a):
selected_collections = [s for s in context.selected_ids if s.rna_type.name == "Collection"]
for c in selected_collections:
for o in c.all_objects:
o.select_set(True)
break
return {'FINISHED'}
bpy.utils.register_class(SelectCollectionChildren)
You can run this operator by doing F3 â outliner.select_collection_children. Note: Donât forget to run the script in the Text Editor initially to register the add-on.
Are you stating context elsewhere, such as context = bpy.context? This would confuse/override the method assignments. Maybe try running the code without setting it up as a operator.
import bpy
for w in bpy.context.window_manager.windows:
s = w.screen
for a in s.areas:
if a.type == "OUTLINER":
with bpy.context.temp_override(window=w, area=a):
selected_collections = [s for s in bpy.context.selected_ids if s.rna_type.name == "Collection"]
for c in selected_collections:
for o in c.all_objects:
o.select_set(True)
break
Im not sure cause im not familiar with python )
What i was try with first code: run from text editro, when run from F3 menu.
With second code i try to run it directly from text editor. It will throw an:
line 7, in
AttributeError: âContextâ object has no attribute âtemp_overrideâ
Solution, Iâll try to implement context override without that function for backwards compatibility. If no reply till then, Iâll simply edit my message here. Sorry for not catching your maximum version statement earlier.
@SoundDifferent I wasnât able to get the older API to work, even in pre-Blender 3.2 versions. Is it possible you can upgrade to a Blender 3.2+ version instead? I believe thatâll solve your issue.
Hello. Thanks, but i temporarily use workaround with simple scripts with selecting all with specific postfixpostfix. Still want ability to select entire collection, but upgrading blender are always pain for me.
My blender is heavily customized in terms of hotkeys. Its not a problem to simply export/import hotkeys, but the problems start in addons where i disable/change some hotkeys settings.
Like i disable everything for hardops, disable/change something in meshtools addons, some checkboxes enabled/disabled in other addons.
Those tiny fine tunings of hotkeys and UI are ended up in a pretty big list which im doesnt even remember, i.e. i will remember what âthat was differentâ but only when i see it. So every time i update blender and start working i find what something needs to be changed to be as same as in previous blender. In the end its a lot of time wasting on UI tuning, not the modelind.
But⌠why canât you just copy/paste setting files from your previous Blenderâs AppData to your current Blenderâs AppData? Compatibility shouldnât break. As itâs just saved add-on or User Preference settings. Not blend data.
Im not sure its really works. I was trying this approach one time and some addons start to throw an errors. Im not really sure what it was because of settings copy/paste.
And anyway thereâs always a chance to break compatibility for some addons.