Advertisement

You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

Free e-book: Programming Add-ons for Blender 2.5

32

Witold Jaworski, the author of the amazing free e-book 'Making of realistic airplane with Blender' (in Polish, but cool to read for anyone), now gives us an extensive ebook on Python programming in Blender.

Witold Jaworski writes:

This is a booklet (135 pages) for those, who are familiar with with the basic Python programming concepts, and have some knowledge in Blender (but they may know nothing about Python in Blender).

I am presenting here a complete IDE for writing Blender add-ons. It is based solely on the Open Source, multi-platform software: Eclipse and its PyDev plugin. It offers you a user-friendly, graphical remote debugger, intelligent Blender Python API code autocompletion, and other features, which make the writing of longer scripts easier.

The best way to present a tool is to show it in the real work. Hence you will find here the step-by-step description of creating a Blender add-on.

It is simple, but non-trivial plugin, implementing the "destructive" Bevel command. I am showing here not the ready solution, but the whole process - from the problem to solve (the lack of the Bevel command in Blender 2.5) to the ultimate Blender plugin. In this book you will learn how to deal with the Big Unknown - the Blender Python API, with its thousand classes and properties, and its quirks. I am showing here how to find the solution, not wasting the time for the learning of the broad aspects of its endless possibilites :)

If you want contribute to this work, just let me know about any grammar/style or any other error, which you can find in this book. I did my best to write this publication, but still want to improve my English - to write my next books even better!

Link

32 Comments

  1. Wow, this book is well written with lots of screenshots.
    It also gives a clear way to develop py-scripts for Blender.
    This is looking to be the best all around introduction to creating plug-ins for Blender
    and I'm really jazzed about this as it's my latest interest.
    And you can't beat the price!
    Thanks a bunch Witold for taking such meticulous care and time to write this!

  2. wow, i know how much work it is and how much time it takes to write everything, create the screenshots and edit them etc. thank you so much for your effort. I definitely will read and use it to get into Python with Blender.

  3. Witold Jaworski, thanks very much for the free book.

    It will be used a lot and I will learn a lot from it.

    I look forward to seeing more good books from you in the future.

  4. Big thank you! Can I urge you to translate your Airplane book into English? That would make a lot of people very happy.

  5. @ Witold Jaworski,

    If you ever translate the airplane tutorial book into English I would buy it.

    My Polish is very basic, but from what I can read, it is a very good book.

  6. Well, this was quite cool up until the point where I had to use the Run.py script in Blender with the debugger in eclipse listening. After over an hour of changing things around (run as administrator and reinstalling pydev after searching my entire hard drive for the proper pydev path, which is no longer an org. but is com. something now) I still can't get it to work. I'm confident the file and the debug path are correct, but the script in blender throws an error, and says "check console" which basically shows me nothing.

    My next step would be to open the Run.py file and look to see what it's trying to do of course, but I've run out of patience given that this is supposed to be a step by step tutorial, and it's hardly that at this point. Despite the niceties of Eclipse, it's probably easier just to use the syntax highlighting in the blender text editor and write the scripts there, which is an unfortunate conclusion to make.

    I also had to reinstall python initially, because it crashed constantly. After a bit of searching, I determined that I had some python path variables that shouldn't be there, and possibly some registry entries that were causing conflicts which I went in and manually deleted before installing python 3.2 again, which seemed to work.

    Thanks though. I did learn a few things.

  7. Witold Jaworski on

    Thank you for all the replies!

    @Nemesis, @Olaf: I am going to publish the improved version of the book about airplane modelling at the end of the 2012. Its English version will be a commercial book. Half of its content has to be written anew, because I would like to use the new Blender 2.6 features there: BMesh editing and Cycles renderer.
    In fact this is the "second round" of its development: In 2008 I started the version 1 with a huge article about programming Blender scripts with SPE and Winpdb (published on wiki.blender.org). Now I have started the new round with similar publication. Both have the same reason: preparation of the Python tools for this work!

    @Redbeer: I know Windows since version 3.0, and I will never guarantee that any of its applications will work correctly on 100% computers with this system. Your description indicates that the remote debugger client did not work properly on your machine. It's a pity that you did not try to analyze the error message and call stack, displayed in the Blender console. It always helps in finding the cause. Perhaps knowing it, I would be able to advise you a solution. But it is all over, now - you have decided that it makes no sense, and I respect your decision.

  8. This was just the kind of narrative, authoritative introduction to AddOn coding that I needed. I didn't care for the Eclipse part, but that wasn't difficult to skim over. The important part for me was to read about the various idiosyncracies one encounters in the process of searching for bits of API to use, and the structure of the AddOn. I'm not new to scripting AddOns, but this really helped me plug a few holes, considerably improving my confidence and speed of work. Accessibly and intelligently written and presented. My only wish would be to have this expanded, but without the Eclipse part. Thank you, Witold!

  9. @Witold

    "It’s a pity that you did not try to analyze the error message and call stack, displayed in the Blender console."

    It told me there was an error, and to check the console, but no error is/was printed to the console. There was nothing to analyze.
    I may look at your Run.py file and give it another go, but I need a break.

  10. Witold Jaworski on

    @Redbeer,
    all right, if you still want to give it a chance, I will try to assist you. First, notice that in the appendices at the end of this book (page 129) is the commented source of the pydev_debug.py module, that implements the debug() procedure, used in Run.py.
    (There is no any "magic", at least on the my side:). Last time I repeated this installation on July). Does the debugging of "conventional" (i.e. non-Blender) Python scripts in Eclipse work properly on your computer?

  11. "...from the problem to solve (the lack of the Bevel command in Blender 2.5)... "

    What a crucial subject to choose too! I miss the bevel command almost every day...

  12. Can't Download on

    This is all I get when clicking the link:

    Notice: The link above contains a direct address of the PDF file. To save it on your hard disk, click it with right mouse button,
    to open context menu of your web browser. Select Save Target As... command from there. (checked with: IE, Firefox)

    "Programming..." it is an e-book, published freely on Creative Commons license. I am showing there, how to adapt popular Open Source IDE - Eclipse - for developing Blender scripts.
    This is merely an introduction to this subject. It is intended for the readers familiar with Python and Blender 2.5 on the average level, at least. I am describing here the methods, used to learn Blender API and how to find the way to implement desired operation.

    The first edition of this book was finished on July 2011. It counts 134 pages and contains about 300 pictures.
    (It is written around the pictures, like a "comic book").

    The files, attached to this publication:

    pydev-blender.zip (223 KB): autocompletion files for the most Blender API classes, and the script, which generates them;
    mesh-bevel.zip (2 KB): final version of the exemplary add-on. Its development is described in this book.

    This book was written for Blender 2.57, and it should be compatible with its further releases.

    A note from one of the Mac OSX users (Joel, aka FloridaJo):
    If you have any problems finding the external Python interpreter on your computer, here is the picture of its path.
    (Thanks, Joel!)

  13. Witold Jaworski on

    @Can't Download:
    What are you doing? Yes, it is the content of the web page, that will be opened in your browser, when you will give it a chance and *CLICK* the link in the article above.
    There you will find the 3 links: one to the book, and two to its attachements.
    Well, if you are using a web browser that cannot parse the XML with the style sheet (most browsers do), here is the direct link to the book file:

    http://airplanes3d.net/downloads/pydev/pydev-blender-en.pdf

  14. I would like to thank you a great big thank your for this fantastic resource! I saw it a few nights ago on Blender Nation and quickly grabbed a copy. Glad you are receiving a very warm thanks for your time and effort in doing this. On a side note to those reading this who care enough to answer, anyone using NetBeans over Eclipse? Just more comfortable for me as I have been using it for a while, although never tried python in it.

    Thank you, again, Witold.

  15. After spending weekends on this ebook I would like to say my most sincere THANK YOU to Witold. In a short time, thanks to this concise but complete informational ebook I was able to learn about Eclipse and Python programming for Blender.

    Appreciate a lot your effort.

  16. Hello Witold,

    I just finish reading your book and doing in mean time all steps, unable to stop to read before the end.
    I was looking for a better way to get debugging; PyDev in Eclipse talking with Blender is great and so comfortable.
    Thank you so much for this very altruist work.

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Advertisement

×