Download presentation
Presentation is loading. Please wait.
1
Blender API: Part 1: Overview
Roger Wickes
2
Blender and the Foundation
Blender is the (only) free and open source 3D creation suite, since 2002 Supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing and motion tracking, even video editing and game creation. Advanced users employ Blender’s API for Python scripting to customize the application and write specialized tools Foundation in Netherlands with mission “to build a free and open source complete 3D creation pipeline for artists and small teams.” Supported by a Cloud, wiki, Books, video tuts, certified trainers, open movies, fan websites, irc, annual conferences, user groups…
3
Blender API Uses As a rendering engine As a physics engine
Since it is FOSS, ideal for Cloud rendering of 100x+ in parallel Data Visualization Object visualization (drug interaction, sub-atomic physics, stellar dynamics) Real-world simulation visualization (traffic, queues) As a physics engine As a game engine To extend/modify Blender itself
4
Ways to run Blender Python
Blender: start gui, or headless command line Python: register module or extend class Hello world: inside Blender import bpy print(“distorting cube”) cube = bpy.data.objects["Cube"] verts = cube.data.vertices verts[0].co.x += 1.0
5
dir(bpy) ‘app’ – the blender application itself; version
'context’ – what is currently active, selected 'data’ – datablocks (classes) in the file 'ops’ – operators that perform functions 'path’ – file locations, path translations 'props’ – properties/attributes for extending blender objects 'types’ – data structures for every blender type (class) 'utils’ – utilities for conversion, loading modules
6
Handy Links https://www.blender.org/api/blender_python_api_2_76_2/
Wiki Blender Artists (Python forum) Cookbook
7
Tips Code and debug inside Blender for instant feedback
Use Code colors (setting in the Tools (left-side) pull out – press “t” with your cursor in the text editor window Try dir(bpy.context) – dir all over in the console Google is your friend Hover over a UI element to see the API call being made
8
Thank you! rogerwickes@yahoo.com
Topics covered Blender history, Open Movies, movie workflow & pipeline Blender UI, window types, scenes, screen layouts/desktops Python uses, Object wrappers, dictionary by name Bpy API tree, 10 program examples Object attributes: name, location, scale, rotation_euler Object types: mesh, material, action, camera, lamp, scene, sequencer strip Code examples: context, data, ops, Context: .object, .scene, .scene.sequence_editor Data: .objects, .vertices, .materials, .type, .actions, Ops: .mesh,.object, .object.add, object.modifier, Path: .abspath
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.