How to add objects to collections with Python in Blender

preview_player
Показать описание

In this video we will go over how to work with collections using Python in Blender.
We will look at creating collections, adding objects to collections, moving objects between collections, and nesting collections in other collections.

Start Code:

Finished Code:

Beginner Blender Python Exercise: Introduction to If Statements (part 1)

Beginner Blender Python Exercise: Using If Statements in For Loops (part 2)

Beginner Blender Python Exercise: Using If Statements to find text (part 3)

00:00 - Intro
00:46 - Setup Workspace
02:07 - Create a collection
05:48 - Move an object into the collection
08:00 - Moving object into a collection in bulk
11:51 - Exercise #1
14:00 - Exercise #2
09:57 - Outro

Intro Music
Fiery Trails - Silent Partner

Background Music
Where To - Birocratic

Outro Music
Geographer - Easy Shake

#blender #python #scripting
Рекомендации по теме
Комментарии
Автор

Awesome tutorial. Exactly what I was looking for. Just subscribed. Thanks!

ShirazHazrat
Автор

Victor is an amazing, passionate teacher! Thank you for your valuable time!!

philippe
Автор

Oddly satisfying to see new Collections pop up in the Outliner through working in the Python Console.

jmfs
Автор

thanks, I'm not very grasped but your tutorials are clear

nomecognome
Автор

your video helped me a lot
i would like to ask Is there a way to find the collection of an object through their variables
I get the active object and want to see what collection it belongs to

spirosmarinis
Автор

I would like to ask you for help regarding a code that, after importing an fbx, transforms the "empty" nodes into collections, leaving all the Object blocks inside.
I have a script that already works but doesn't maintain the hierarchy.
that is, if the emty node is inside another empty the child collection does not remain inside the parent collection
I don't know if I managed to explain myself..
If you can you would do me a great favor

nomecognome
Автор

Very interesting video. I am trying to create an add-on, and I created a panel that can select all existing collection under my master scene, However, when I try to set the selected scene as my active scene, it will not work, it will tell me bpy_prop_collection[key}: key: "Collection Name" not found. But it is in the collection. Could it be because it is a child collection?

WHATEVERGT
Автор

Still dont udnerstand why there is no drop code like the outliner has exposed in blender pthon api. Would be way more easier than this.

RomboutVersluijs
welcome to shbcf.ru