How to make a blender add-on?

I want to make a blender add-on which allows you to compare render slots. However I am not sure how to approach this since I am experienced with python and blender but I do not know how to mash them together. I would be grateful if somebody provided a list of steps that are just enough detailed for me to google the rest.

There’s a few videos out there for starting out, you could rummage through. Darkfall has some intro ones that are pretty easy to follow:

You can take a look at the template scripts, found under the Text Editor>>Templates>>Python. Particularly the UI Menu and UI Menu Simple are good if you’re creating a dropdown menu. You can look through the other ones too, to get ideas.

That should at least get you started with a basic shell of an addon. You can turn on python tooltips in the preferences: under Interface>>Display>>Python Tooltips. So when you hover over some things you see python data paths for things. They don’t always give much info but it helps.

If you know python, it’s just a matter of wrapping your head around Blenders node structure and paths, where to get data of things and then how to manipulate it.

As for render slots, an example of code to get the active index or active name of a render slot would be:

bpy.data.images[‘Render Result’].render_slots.active_index
bpy.data.images[‘Render Result’].render_slots.active.name

These would return either of the following if Slot 1 was active:
‘0’
‘Slot 1’

You can change active slots by python with the below example:

bpy.data.images[‘Render Result’].render_slots.active_index = 0

I’m not exactly sure what you’re trying to accomplish with render results, if you need the pixel data itself? Someone else may be able to help you there. Hopefully this info can at least get you started on a basic addon structure though.

2 Likes