0% found this document useful (0 votes)
8 views18 pages

DrTADBlenderPython

Uploaded by

vanderleiibra08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views18 pages

DrTADBlenderPython

Uploaded by

vanderleiibra08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/331163653

Blender & Python. Creating 3D primitives with writing codes

Presentation · February 2019


DOI: 10.13140/RG.2.2.36224.48647

CITATIONS READS
0 6,449

1 author:

Tihomir Dovramadjiev
Technical University of Varna
580 PUBLICATIONS 241 CITATIONS

SEE PROFILE

All content following this page was uploaded by Tihomir Dovramadjiev on 17 February 2019.

The user has requested enhancement of the downloaded file.


Blender & Python. Creating 3D
primitives with writing codes

Assoc. Prof. Dr. Eng. Tihomir Dovramadjiev


Technical University of Varna
MTF, Department Industrial Design
[email protected]
About Blender software

● Blender is the free and open source 3D creation suite. It supports the entirety of the 3D
pipeline—modeling, rigging, animation, simulation, rendering, compositing and motion
tracking, even video editing and game creation.https://www.blender.org/
● Blender software. 2.79b Version. About, License & Development.
https://www.researchgate.net/publication/328677236_Blender_software_279b_Version_
About_License_Development

● Modern accessible application of the system Blender in 3D design practice.

https://www.researchgate.net/publication/312033613_Modern_accessible_application_of
_the_system_Blender_in_3D_design_practice

2019 DrTAD 2
Scripting & Extending Blender »
Introduction

Introduction
● Python is an interpreted, interactive, object-oriented programming language.
It incorporates modules, exceptions, dynamic typing, very high-level dy-
namic data types, and classes. Python combines remarkable power with
very clear syntax.

● Python scripts are a powerful and versatile way to extend Blender functional-
ity. Most areas of Blender can be scripted, including animation, render-
ing, import and export, object creation and the scripting of repetitive
tasks.
● To interact with Blender, scripts can make use of the tightly integrated API.

● https://docs.blender.org/manual/en/latest/advanced/scripting/introduction.html
CC-BY-SA 4.0 Int. License

2019 DrTAD 3
Scripting & Extending Blender »
Introduction
● General Information
● Links that are useful while writing scripts:

● Python.org – General information about Python.


● Blender Python API – Official API documentation. Use this for referencing while writ-
ing scripts.
● API Introduction – A short introduction to get you started with the API. Contains ex-
amples.
● Links that deal with distributing your scripts:

● Sharing scripts – Information on how to share your scripts and get them included in
the official Blender distribution.
● Creating Add-ons – Add-ons are used to encapsulate and distribute scripts.
● Add-ons project – Project to maintain a central repository of extensions to Blender.

● https://docs.blender.org/manual/en/latest/advanced/scripting/introduction.html
CC-BY-SA 4.0 Int. License

2019 DrTAD 4
Switch to Scripting Screen

2019 DrTAD 5
Scripting / Python Console

Blender 2.79. Python Interactive Console 3.5.3 (default May 20 2017)

2019 DrTAD 6
Adding a Cube primitive

bpy.ops.mesh.primitive_cube_add(radius=1, view_align=False,
enter_editmode=False, location=(0, 0, 0), layers=(True, False, False,
False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False))
Source: Martin Christen (2016). 3D Computer Graphics with Python. „3D Graphics the Pythonic Way“. Institut Vermessung und Geoinformation. Swiss Python

Summit. Switzerland https://www.python-summit.ch/files/4-slides-martin-christen-sps16.pdf

2019 DrTAD 7
Appearing of the Cube primitive

2019 DrTAD 8
Adding a New 3D model

Deleting the Cube primitive

2019 DrTAD 9
Adding a Cylinder primitive / R=1;
Location X:0, Y:0, Z:0

bpy.ops.mesh.primitive_cylinder_add(radius=1, view_align=False,
enter_editmode=False, location=(0, 0, 0), layers=(True, False, False,
False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False))

2019 DrTAD 10
Appearing of the Cylinder primitive

2019 DrTAD 11
Adding a new Cylinder primitive /
R=4; Location X:8, Y:0, Z:0

bpy.ops.mesh.primitive_cylinder_add(radius=4, view_align=False,
enter_editmode=False, location=(8, 0, 0), layers=(True, False, False,
False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False))

2019 DrTAD 12
Appearing of the Cylinder.001
primitive

2019 DrTAD 13
Adding a new Cylinder primitive /
R=8; Location X:24, Y:0, Z:0

bpy.ops.mesh.primitive_cylinder_add(radius=8, view_align=False,
enter_editmode=False, location=(24, 0, 0), layers=(True, False, False,
]False, False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False))

2019 DrTAD 14
Appearing of the Cylinder.002
primitive

2019 DrTAD 15
Result

2019 DrTAD 16
References
● Blender Software
https://www.blender.org/
● Tihomir Dovramadjiev PhD. Modern accessible application of the system Blender in 3D design practice.
https://www.researchgate.net/publication/312033613_Modern_accessible_application_of_the_system_Blender_in_3D_design_practice
Blender software. 2.79b Version. About, License & Development. DOI: 10.13140/RG.2.2.36167.75687
https://www.researchgate.net/publication/328677236_Blender_software_279b_Version_About_License_Development
● Blender User Manual.Release 2.78. Blender Community. Mar 08, 2017
Scripting & Extending Blender
https://docs.blender.org/manual/en/latest/advanced/scripting/index.html
● Introduction
https://docs.blender.org/manual/en/latest/advanced/scripting/introduction.html
● Scripting & Security
https://docs.blender.org/manual/en/latest/advanced/scripting/security.html
● Add-ons
● https://docs.blender.org/manual/en/latest/addons/index.html
● Add-on Tutorial
https://docs.blender.org/manual/en/latest/advanced/scripting/addon_tutorial.html
CC-BY-SA 4.0 Int. License
● https://www.slideshare.net/TihomirDovramadjievP/rosen-vasilev-hristo-skulev-and-tihomir-dovramadjiev-optimization-of-design-opportunities-and-transfer-of-information-between-
data-3d-graphics-program-blender-and-solidworks-cad-system
● https://www.youtube.com/watch?v=K0yb4sZ7B4g
● https://www.youtube.com/watch?v=F-cgCXg7Z3o
● https://www.youtube.com/watch?v=ssHiWpVuxTk
● Martin Christen (2016). 3D Computer Graphics with Python. „3D Graphics the Pythonic Way“. Institut Vermessung und Geoinformation. Swiss Python Summit.
Switzerland https://www.python-summit.ch/files/4-slides-martin-christen-sps16.pdf
● Patrik Malm. Scientific Visualization. Lecture 7: Other Visualization software. Centre for Image Analysis. Swedish University of Agricultural Sciences. Uppsala University
● Witold Jaworski. Programming Add-Ons for Blender 2.5 - version 1.01. ISBN: 978-83-931754-2-0.
● Apace OpenOffice
http://www.openoffice.org/download/

2019 DrTAD 17
View publication stats

You might also like