﻿<?xml version='1.0' encoding='utf-8' ?>
<?xml-stylesheet type="text/xsl" href="header_e.xsl" ?>
<body PageTitle="A book about programming" PageHeader="Tutorials" PageKeywords="Blender3D,Python,book" Created="2011-07-16" Updated="2018-07-01" FName="pydev-009">

<div class="left500" style="max-width:350px;margin:auto;">
	<a href="downloads/pydev/pydev-blender-en.pdf" style="background:transparent;">
		<IMG class="image500" style="max-width:300px;margin:0;padding:0;" src="images/pydev/title_e.png"  />
	</a>
</div>

<div class="expose"><p>Download the book: <a href="downloads/pydev/pydev-blender-en.pdf">pydev-blender-en.pdf</a> (version 1.0, size: 7 MB).</p>
 <p>
 <spanl><b>Notice:</b> The link above contains a direct address of the PDF file. To save it on your hard disk, click it with <b>right</b> mouse button,
 to open context menu of your web browser. Select <b>Save Target As...</b> command from there. (checked with: IE, Firefox)</spanl>
 </p>
 </div>

<div>
<p>
<b>"Programming..."</b> it is an e-book, published freely on Creative Commons license. I am showing there, how to adapt popular Open Source IDE - Eclipse - for developing Blender scripts.
This is merely an introduction to this subject. It is intended for the readers familiar with Python and Blender 2.5 on the average level, at least. I am describing here the <u>methods</u>, used to learn Blender API and how to find the way to implement desired operation. 
</p>
<p>
The first edition of this book was finished on July 2011. It counts 134 pages and contains about 300 pictures.
(It is written around the pictures, like a "comic book").
</p>
</div>

<divf/>
<divf>
<p>
The files, attached to this publication:
</p>
<ul>
<li><a href="downloads/pydev/pydev-blender.zip">pydev-blender.zip</a> (423 KB): autocompletion files for the most Blender API classes, and the script, which generates them;</li>
<li><a href="downloads/pydev/mesh-bevel.zip">mesh-bevel.zip</a> (3 KB): final version of the exemplary add-on. Its development is described in this book.</li>
</ul>
</divf>
<div>
<p>
This book is compatible with Blender 2.57 and its next versions. The presented information is still valid (when I am writing it, the current Blender version is 2.63).
The example described here - a script that implements the "Bevel" command  - in Blender 2.63 became slightly "academic", because this Blender 
version already contains the standard "Bevel" command. While reading this booklet, take a look at the updates / comments below.
</p>
</div>
<div class="subheader">Comments and updates:</div>
<div>
<li>
Page 39, Figue 3.2.2: If you are using a different operating system than Windows, do not place the <b>pydev_debug.py</b> file in the root folder of Blender.
Unpack it to any directory that appears in your <i>sys.path</i> list, instead. (To read its contents, open the Blender <i>Python Console</i> and evaluate 
the <b>sys.path </b> expression there).
</li>
<li>
Page 52: since Blender 2.66 you have to enable in the Outliner the <b>Store Edge Bevel Weight</b> flag before setting the <b>Bevel Weight</b> values.<br/>
(Note, that there is also similar flag for the vertex bevel weights: <b>Store Vertex Bevel Weight</b>).
</li>
<li>
Page 55, Figure 3.3.18: since Blender 2.66 you have to place following statement before the loop:<br/>
<p><code>mesh.use_customdata_edge_bevel = True</code></p>
It corresponds to setting the "Store Vertex Bevel Weight" flag in the Outliner. (If you wish to implement vertex beveling, enable also another flag: <code>use_customdata_veretx_bevel</code>).
</li>
<li>Page 58, Figure 3.2.2: in the newer PyDev versions the <em>*.debug_&lt;PyDev version&gt;</em> folder does not exists. 
You have to use as the PYDEV_PATH value a path to the folder containing its <b>pydevd</b> module. 
Identify it using the file search tools available in your system (look for the folder that contains the <b>pydevd.py</b> file. 
It will be one of the PyDev folders).
</li>
<li>Page 75, Figure 4.1.2: Because the standard Bevel command finally appeared in Blender 2.63, use a different name for the operator implemented
(attribute bl_idname = "mesh.mbevel" instead of "mesh.bevel").
</li>
<li>
For the Mac users: if you have problem finding the external Python interpreter on your computer, <a href="images/pydev/forum/osx-py3.2.jpg">here is the picture of its path</a>.
</li>
<li>
<b>Do not</b> apply one of the "tricks" described on the <a href="http://www.blender.org/documentation/blender_python_api_2_63_release/info_tips_and_tricks.html">Blender API tips and tricks</a> page:
do not place the standalone Python (i.e. downoladed from <a href="http://python.org">python.org</a>) in place (folders) of the internal Python from Blender. (When you replace it, the PyDev debugger will not work properly). Always install the external Python interpreter into a different folder.
</li>
<li>
In Windows 7 and newer you have to alter user rights to your Blender directory. Give the built-in <b>Users</b> group read/write access to "Blender" directory.(By default, they have read-only access to all subdirectries of the "Program Files" directory).
</li>
<li>
I updated the <strong>pydev-bledner.zip</strong> file. The script that creates the PyDev predefinition files (*.pypredef) for Blender modules is updated. (These files are used by the code autocompletion feature. In the newest PyDev, *.pypredef files are used as the other Python scripts. To make them work properly, I had to create in the python_api/pypredef folder apropriate subdirectories for the bpy, mathutils, bmesh modules. I also fixed the bug that occured when user tried to generate the *.pypredef files for Blender 2.79b).
</li>
</div>
</body>
