Creating our first add-on – object collector
We are going to write an add-on that groups the objects of a scene in collections that reflect their type – one collection for all the meshes, one for all the lights, one for the curves, and so on.
Since we have set up PythonScriptingBlender/ch3
as the directory for our add-ons, we will proceed in VS Code:
- Select
PythonScriptingBlender/ch3/addons
in VS Code. - Create a new file by clicking the New File icon.
- Name the new file
object_collector.py
. - Open the file via a double click.
This Python script’s name starts with object
, since it affects object data. It is a soft convention, as this filename scheme is suggested but not enforced.
At this stage, the add-on is very similar to the previous one – we haven’t added any code yet. Note how, besides the obvious difference in names and descriptions, we haven’t put a warning
entry – we intend to make a non-experimental...