API Part 1 Overview Roger Wickes rogerwickesyahoocom Blender and the Foundation Blender is the only free and open source 3D creation suite since 2002 S upports the entirety of the 3D pipelinemodeling rigging animation simulation rendering compositing and motion tracki ID: 528558
Download Presentation The PPT/PDF document "Blender" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Blender API:Part 1: Overview
Roger Wickesrogerwickes@yahoo.comSlide2
Blender and the FoundationBlender 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…Slide3
Blender API UsesAs a rendering engineSince it is FOSS, ideal for Cloud rendering of 100x+ in parallelData VisualizationObject visualization (drug interaction, sub-atomic physics, stellar dynamics)
Real-world simulation visualization (traffic, queues)As a physics engineAs a game engineTo extend/modify Blender itselfSlide4
Ways to run BlenderPythonBlender: start gui, or headless command linePython: register module or extend class
Hello world: inside Blenderi
mport
bpy
p
rint(“distorting
cube”)
cube =
bpy.data.objects["Cube"]
v
erts
=
cube.data.vertices
verts[0].co.x += 1.0Slide5
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 modulesSlide6
Handy Linkshttps://www.blender.org/api/blender_python_api_2_76_2/Wiki
http://wiki.blender.org/index.php/Blender Artists (Python forum)
Cookbook
http://wiki.blender.org/index.php/Dev:Py/Scripts/CookbookSlide7
TipsCode and debug inside Blender for instant feedbackUse Code colors (setting in the Tools (left-side) pull out – press “t” with your cursor in the text editor windowTry dir
(bpy.context) – dir all over in the consoleGoogle is your friend
Hover over a UI element to see the API call being madeSlide8
Thank you!rogerwickes@yahoo.comTopics coveredBlender history, Open Movies, movie workflow & pipeline
Blender UI, window types, scenes, screen layouts/desktopsPython uses, Object wrappers, dictionary by nameBpy API tree, 10 program examplesObject 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