Blender Addons with Python Tutorial

Python

Video is ready, Click Here to View ×


This is a tutorial for programming your first Blender addon. You know I have the Python programming tutorials to get you started if you are not familiar with the Python programming language.

The Blender addon we develop here is pretty simple but it’s a nice template to understand addon development with Blender and Python.

Here are some useful links for blender addon programming:

Blender Python API Documentation:
https://www.blender.org/api/blender_python_api_2_78_release/

Blender wiki…

19 thoughts on “Blender Addons with Python Tutorial

  1. Could you please write a addon, which can blur effects which were made in the compositing?
    So that Blender has something like RSMB or Pixel Motion Blur from Ae

  2. Lessons in variables and operators by in blender I have watch your whole Python lesson but I am more visual and I really think teaching those lesson agiain but with visual elements will help a lot more people trying to get it program with Python 3.5.2 using blender 3d

  3. Can't unregister panel, im getting this error:

    RuntimeError: unregister_class(…):, missing bl_rna attribute from 'RNAMeta' in
    stance (may not be registered)

    #Blender 2.78
    #script.py :

    import bpy
    from bpy.types import Panel

    class SimplePanel( Panel ):

    bl_space_type = "VIEW_3D" # Add new panel in 3D view
    bl_region_type = "TOOLS" # Add new panel in 3D View side [T] Tools Panel
    bl_label = "Tools Tab Label" # Group
    bl_context = "objectmode"
    bl_category = "Mycategory" # Side panel target tab

    #Add UI Elements here
    def draw( self, context ):
    layout = self.layout
    layout.operator('mesh.primitive_cube_add', text="add new CUBE 3")

    #Register
    def register():
    bpy.utils.register_class( SimplePanel )

    #Unregister
    def unregister():
    bpy.utils.unregister_class( SimplePanel )

    if _name_ == '__main__' :
    unregister()

    #Edit:
    I am still able to move the tool into different categories and change it's label, but it still doesn't seem to unregister

  4. What is the difference or advantage of importing panel from bpy and passing it in instead of passing in bpy.types.panel as the class argument. Also I've noticed all of the tools in the View3DPanel inherit from both panel from bpy.types and View3DPanel created from panel. What is the advantage or point of this? If you could shed some light on it for me I'd be very grateful. Thank you for the tutorials.

  5. Great video i like it. I have made a 2 line script. Its running perfect what i need. I have saved with.py extension and installed. Problem is i cant find my addon in official, community and testing category. May i know where it has installed and how to find it and activate. This is the script
    import bpy
    bpy.ops.object.delete(use_global=True)
    Plz give me little more information in details what is missing and how can it will be a perfect addon working

  6. Very nice tutorial! I need this for placing Empties so i managed to use your code/addon for this. But is it possible to add x empties, where x is user selected? Also need specific names and rotation. I can do it in a script – but not in an addon.
    Would you help?

Leave a Reply

Your email address will not be published. Required fields are marked *