Python Presets Experiments

July 8th, 2004 . 4 comments

Yesterday, looking back through one of my old sketchbooks, I got thinking about an old idea from a while back. With Willian Padovani Germano’s recent work on integrating Python scripts in Blender’s menus, this idea is now a lot easier to realise, so I gave it a go and made a proof-of-concept.

The idea is to create a system of presets in Blender, using Python scripts to load and save the relevant information. From a user’s perspective, one would be able to save presets for things like video/image dimensions (scenes), materials, textures, and eventually colorbands, themes, or any other data that is accesisble via Python that would be useful to re-use. A user could save a preset (which would involve Blender writing out a new Python script to disk), then share it with other users, who would just need to drop that script into a ‘presets’ folder to install it, making it show up automatically in a ‘Presets’ menu.

Scene preset experimental screenshot

(click for a larger screenshot)


Some of this functionality can already be achieved by appending datablocks from another .blend file, however this method has the following disadvantages:

  • It’s not easy to install new presets
  • It’s not easy to include new presets by default in the installation package
  • It’s not possible to append presets for things that don’t have datablocks (like themes)
  • It’s not possible to prest only some of the settings in a datablock. For example if I append a ‘Scene’ datablock, it will also import a whole bunch of other information, when all I might want to preset is the frame size and pixel aspect (perhaps for a proprietary image or video format one might be working with).

There are also additional advantages to using Python for this:

  • Values can be generated programatically, for example using random numbers, or generating values based on relationships to other Blender data
  • Presets could integrate well with other Python scripts, such as a script that applies variations on a preset to a number of other objects. Python script authors would also be able to easily copy existing code to or from presets to other scripts

The code I have working (shown in the screenshot), was relatively simple to create. Ideally, I’d rather have the presets in a proper popup menu (like the image format menu) so you can see what preset is currently selected, and somehow have it change to ‘Custom’ when the values have been manually changed. The scripts I used to make the presets in the screenshot are available here: A3, 300dpi, HDTV 1080/24p. These scripts can be run manually inside current Blender versions, but of course won’t show up in a presets menu.

Perhaps one more thing to go on the 2.35 todo list!

Blender GUI Controls

July 5th, 2004 . 6 comments

Lately, I’ve been looking back at some of the changes made to Blender’s interface last year for version 2.30, and with the luxury of hindsight, wide testing and feedback, trying to analyse what has worked, what hasn’t, and more importantly, what can be improved or replaced with something better. There has been some discussion over in the forums at blender.org about the GUI controls, which prompted a little experimentation over the weekend in Illustrator, combining parts of the Shaded and Rounded themes, with less emphasis on ‘everything looks like a button’ (pictured right).

Soon, I’ll start coding some working prototypes in OpenGL. Before that, though, there’s some work to do for the 2.34 release, such as getting the Help menu launching web browsers correctly across platforms, porting direct number field editing, and after some code review, porting mouse button selection configuration and phase’s mouse wheel support for number fields.

mockup image of some new GUI controls for Blender

Where Am I?

You are currently browsing the Blender category at Matt Ebb.