Automate Blender with Python - Give Yourself Superpowers
4.7 (71 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
2,930 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Automate Blender with Python - Give Yourself Superpowers to your Wishlist.

Add to Wishlist

Automate Blender with Python - Give Yourself Superpowers

Learn to use Python scripting to automate your 3D modelling. Including use of fast C libraries, and object manipulation.
4.7 (71 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
2,930 students enrolled
Last updated 3/2017
Current price: $10 Original price: $95 Discount: 89% off
1 day left at this price!
30-Day Money-Back Guarantee
  • 4.5 hours on-demand video
  • 1 Supplemental Resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Setup a great working environment for writing Python code within Blender.
  • Use Blender Python API to automate anything that can be done in the interface.
  • Understand how to use 3rd party libraries, including fast C libraries.
  • Read from and write to files, specifically CSVs and PNG images.
  • Write easy to read and elegant Python code.
View Curriculum
  • A Mac or PC capable of running Blender (Linux is possible but unsupported). The instructor will mainly use a PC, highlighting differences on a Mac.
  • You will need at least 8 GB of RAM in your machine.
  • You will need an internet connection to download libraries and other resources.

Note this is an INTERMEDIATE LEVEL course. 

Blender is an industry-strength 3D-modelling suite, with huge potential for automation using Python. Unfortunately getting setup, and writing Python code to script Blender can be hard.

This course makes it easy to program Blender with Python. By the end you will have a professional working environment that will allow you to rapidly iterate Python code.

If you have never coded before, or you have no Blender experience then this course isn't for you yet. Check-out one of our other beginner courses. If you have some coding experience, and something you want to automate in Blender this course is ideal for you.

Maybe you think it's not worth the time and effort to automate, why not just pay somebody or manually create what you want? Here are three top reasons this is worth your time..

  • Learn how Blender works behind the scenes.
  • Gain confidence in your Python coding.
  • Create realtime automation that can't be done manually.

With over 120,000 happy students here on Udemy, and some of the highest ratings on the platform, we're confident you'll be happy with your investment.

Here are the steps you'll learn how to...

  1. Run and reload Python code in Blender.
  2. Use fast C-libraries such as Pillow.
  3. Duplicate and place 1000s of 3D objects.
  4. Manipulate Blender's data structures.
  5. Change materials including nodes programmatically.

What could you create if you could automate anything in Blender?

Take this course now and find out :-)

Who is the target audience?
  • This course is designed for people with enough prior experience in Python to define functions, write loops, understand dictionaries, use list & handle files. The Python we write will be explained but not from first principles. If you've never coded before this course isn't for you.
  • You will need some familiarity with Blender, particularly its interface and manipulation of basic objects. If you have never used Blender before we suggest you take the first few sections of our Complete Blender Creator course first.
  • If you want to apply your existing Python knowledge to the automation of Blender this course is for you.
  • If you want to automate your workflow in Blender, and are willing or able to code in Python, this course is for you.
Students Who Viewed This Course Also Viewed
Curriculum For This Course
30 Lectures
Running Python Code in Blender
10 Lectures 01:07:39

Ben Tristem explains what this course is about, and why you may want to take it.

Preview 02:13

  • Re-watch promo if not seen recently
  • You’ll need to be familiar with Blender’s interface, Python or programming, the console / terminal
  • An overview of the course
  • How to ask good questions.
Preview 03:33

  • Install Blender 2.78 or above
  • Add a Python Console editor and explore
  • Expand your Info editor to see UI logs
  • Hover to discover Python commands
  • Tab and Shift-Tab to indent or un-indent
Preview 07:27

  • Windows does not come bundled with Python
  • Blender 2.78 for PC is bundled with Python 3.5.1
  • We are replacing bundled version to…
  • Understand how Blender uses Python on PC
  • Get a copy of PIP so we can install Pillow later.
PC - Replacing Bundled Python

  • MacOS 10 is bundled with Python 2.6 & 2.7
  • Blender 2.78 for Mac bundled with Python 3.5.1
  • We are replacing bundled version to…
  • Understand how Blender uses Python on Mac
  • Get a copy of PIP so we can install Pillow later.
Mac - Replacing Bundled Python

  • Pillow is a Python Image Library (PIL) fork
  • Pillow will allow us to render text to an image
  • On PC use: pip install pillow
  • On Mac use: sudo pip3 install pillow
  • Check that Blender has access to Pillow.
Pillow - Python Image Library

  • Choose and setup a Python editor
  • We choose Atom, stick with what you know
  • Install the autocomplete-python add-on
  • Check syntax highlighting is working
  • Write our first script outside Blender, and run it.
External Text Editor (Atom)

  • Using sys.path.append to get access to code
  • Using importlib to make module reloading easy
  • Where to find your console output
  • Quick “Hello World” test
  • Manipulating our first Blender object.
Running Python Code in Blender

  • By default your code won’t update
  • We can use importlib to fix this
  • Test full-circle rapid development of Python.
How To Reload Python Code

  • You’ve learnt a lot
  • Incidental complexity, but really important
  • Share your setup ideas with the community
  • Dive STRAIGHT into next section while fresh.
Section 1 Wrap-Up

End of Section Quiz
10 questions
Project: Texture Painter
20 Lectures 03:22:00
  • Welcome to the project section.
  • What you'll learn.
  • Share your vision with fellow students.
Section 2 Introduction

Project Setup & GitHub

  • There’s no such thing as plain text
  • Using Python’s codecs library
  • Reading a CSV file in a cross-platform manner.
No Such Thing As Plain Text

  • The with keyword establishes a context
  • ...useful for managing file access & scope
  • The yield keyword is subtle and beautiful
  • The combination dict(zip(header, row))
  • Reading and printing our CSV header.
Iterators and csv.reader()

  • Using the Pillow library
  • This is a fork of the Python Image Library (PIL)
  • How to use Image, ImageDraw and ImageFont
  • Rendering text to an image file in Python.
Rendering Text To Images

  • Adjusting our image size
  • Making the filename variable
  • Iterating to quickly create 1000s of image files.
Rendering 1000s Of Images

  • Reading about exception handling in Python

  • How the raise keyword works

  • It’s a bit like return but if not handled in caller…

  • … then eventually the program will quit and error

  • Also using bpy.context.selected_objects

Using raise For Exceptions

  • Learn how to place our text image onto a model.
  • We are going to use Blender Render.
  • We’ll have a prototype ready to repeat a few times!
Placing Text On Our Object

  • How to select objects in Python
  • Using bpy.ops.object.duplicate_move() to duplicate objects, with a fixed offset.
Duplicating Objects

  • How to use Docstrings to comment your code
  • How the % operator works in Python
  • Remember the // integer division operator
  • Calculating offset from our prototype.
Calculating Object Offsets

  • Our csv file already has “backer numbers”
  • However, we shouldn’t rely on this data
  • How about if it doesn’t start at 0?
  • How about if there are duplicates or gaps?
  • Let’s use Python’s enumerate to take charge.
Using enumerate In Loops

Mid Section Quiz
10 questions

  • Changing our file naming
  • Refactoring our code structure.
Refactoring and Integrating

  • Each object can have multiple material slots
  • Each material slot may have a material
  • Materials have texture slots
  • Each texture slot can have a texture
  • Textures image names and paths.
Blender Render Material Data

  • How to open an image in Blender Python
  • How to assign a new texture with Blender render
  • Copying materials and textures.
Finishing Our Code

  • Define the spacing of the names
  • Render out all our names
  • Setup the camera
  • Key your animation ready for the final scene.
Setting Up Our Names

  • Using the compositor to finalise our scene
  • Make it have an interesting background.
Compositing The Final Credits

  • Configure 1 Material for Blender Render and Cycles.
  • Test render our final scene.
  • Then we’ll be ready to adjust our script to work.
Setting The Material For Cycles

  • The data structure for Cycles starts similar to Blender Render
  • However rather than looking at texture slots, we need to investigate the node_tree
  • From there we look at nodes[name].image
Cycles Material Data

Please share what you have created with other students.

Section 2 Wrap-Up

End of Section Quiz
8 questions

About our other courses.

Bonus Video
About the Instructor
Ben Tristem
4.7 Average rating
49,710 Reviews
248,385 Students
11 Courses
Best-selling Instructor, Game Developer, Online Entrepreneur

Hi, I'm Ben. I have a degree in computing from Imperial College London, and a physics diploma from the Open University.

I started working for myself at the age of 15, and never looked back. I explored careers as varied as being a commercial pilot, stunt-man, rock climbing instructor, and more. None of these provided a continued challenge, and stable income in the same way technology does.

After building and selling a home computer support business, I became an angel investor and business mentor here in Cambridge UK. I fell in love with teaching game development through one of my investments, and I now spend all of my time sharing my passion with people like you.

I can't wait to help you experience the fulfilment, and financial freedom, that having a deep understanding of technology brings.

So why not start learning to make games with me and my team now?

See you soon!


Michael Bridges
4.7 Average rating
9,538 Reviews
64,098 Students
5 Courses
Technology Teacher

I am a self confessed technology geek, and love teaching people new things.

I think it is a real shame that so many people carry around such wonderfully capable devices yet do nothing but the basics on them. Computers, laptops tablets and smart phones can do much more than most people know. I would like to guide, reassure and educate people in using their technology to add to their lives

I have been playing, yes playing, with technology for as long as I can remember and I still do that today! Admittedly these days with other commitments I do have to watch what I spend as technology can burn a very deep hole and quickly!

As my parents will testify, I have always been inquisitive! even if it meant taking something apart to see how it worked. Of course not knowing how to put it back together again! To this day I love learning new things and developing myself as a person.

Despite my techy background I remain firmly grounded and talk to people using every day language, unnecessary techno-babble drives me bonkers. This allows me to chat with people with limited knowledge on a subject and help them understand more.

By day (and sometimes night) I run a successful local technology support company in Nottingham (UK).