Ira Krakow’s Blender 2.50 Python Part 2 ( Panels)

Read the script for this video, and discuss, at: forum.irakrakow.com In Part 1 of this series on Blender 2.50 Python, we explored the new Blender 2.50 Python User Interface. In Part 2, we will look at the new user interface, consisting of windows and panels. You are already familiar with windows — things like the 3D window, the Outline Window, and the UV / Image Editor Window. These still behave as 2.4x type windows, which you can resize, split, join, and so on. However, the way windows are built is completely different. In Blender 2.5, windows are assembled in units called Panels. You program each panel as a Python class. A window is a group of panels, with each panel in the window registered to it. In this tutorial, we will explore how Blender 2.5 windows are put together by both looking at the scripts that build the windows in the user interface, and actually changing these windows. Then we will create a panel based on Blender’s panel template script, and register it to a window, adding our own panel to a Blender window. In the process, we will see where the python scripts for the windows shipped with Blender are kept and examine how the user interface is created. The goal is to show you how to find the code for the windows, as a starting point for you to change the Python code to add panels to existing windows. The way of building the User Interface has changed so much in 2.50 that just about all Blender Python 2.4x scripts that use windows need to be rewritten

Get the book now