Tag Archives: Blender 3D

Blender 3D – sin mesh object with python.

This is a simple example of create one object from vertrices and edges using sin function.
First you need to create the mesh with: bpy.data.meshes.new .
The n number is random, you can use any number for vertices and edges.
This number is points for the drawing sin function.
The spaces variable is the range from this points.
Using for statements we can draw the sin function.
The last step is to add all of this into one object named sin.
This object will be link to the scene.
See the source code of this tutorial:

Posted in 3D, All, Blender 3D, Programming, Python. Tagged with , , , , , , , .

Blender 3D – script to show python code under console.

To run this script yo need to select the render to Cycles Render.
Then go to Compositing from Screen layout ( in the top of the screen) and select Use Nodes from Material.
This will make a default material with a Diffuse BSDF .
The next step is to select Scripting from Screen layout.
This will allow you to make a script.
Create a new text and add this source code:

Press keys Alt+P or run the script from Text – Run Script.
When you click on tabs or select something the print function will print the python code into Console output area.
This can be used to see parts of python code from addons or Blender API.
Example with Archimesh addon :
You need to have this addon install and press the books button.
The result of this source code is show into console output and can be used with console shell to add books into your Scene:

Posted in 3D, All, Blender 3D, Programming, Python. Tagged with , , , , , , , .

Blender 3D – the measurements addon .

This addon help us with infos and data about measurements with Blender 3D working and output.
If you have used this addon the you need to delete it from this folders:
\Blender Foundation\Blender\2.78\scripts\addons
\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons

The install is easy , just open menu from: File – User Preferences … – Install from File ….
The tool can be fond into the left area of Blender 3D screen on Display tab ( press T key to see the Panel with Display tab).
One simple example is to see the angle of the cube.
So select the Cube object, press Tab key for edit , select with Shift key and right click mouse three vertices .
With all three vertices press Angle button to see the 90 degrees.
If you want to see area then you need to select four vertices and then press Area button.
You can see the distance to origin with Origin button.
The size of the edge can be see with two vertices selected and the using the Segment button.
To put a label , the select just one vertice then add your text and color on MeasureIt Configuration.
Now you can press the Label button.
For rendering the result image is store for UV Editing and can be selected like image for UV;
The last version is 1.70 and come with new features and changes:

  • Redesign of Mesh Debug, Configuration, and N-panel settings layouts ;
  • Added option to rotate text and measurements by angles specified in degrees ;
  • Added option to horizontally align text to left, center, or right ;
  • Added option to expand or collapse all N-panel settings ;
  • Added options to Mesh Debug to display indexes of scene objects and mesh edges ;
  • Added options to Mesh Debug to display object and vertex global locations ;
  • Fixed bug causing NoneType errors when measurments were drawn off screen ;
  • Fixed bug preventing vert locations from displaying unless vert index option was enabled ;
  • Fixed bug preventing mesh position from updating when using MeasureIt’s Render button ;
  • Fixed ensure_lookup_table bug when geometry with measurements was edited ;
  • Hid most/all adjustment options when they would have no affect ;

The addon can be found here.

Posted in All, Blender 3D. Tagged with , , , , .

Using bpy – changing colors .

This tutorial show you a simple example of python scripting into Blender 3D software.
You need to select the window for scripting and to test with python scripting shell.
First you need to add one object : cube.
The default script and most common python script, start with this :

You need to see the print python function because will use python ver. 3.
Also the cube object and cursor vars will take the all you need to use it.
Now , this myvar variable show you hou to deal with python 3.

The next two python script will make editable or not the object : your cube.

… now the next line will change it into Object Mode ( can also use TAB key).

The goal of the edit mode_toggle function can be when you will use vertices.
The changing color of the cube can be done with this functions:

Now the cube will show you with a new diffuse color.

Posted in All, Blender 3D, Programming, Python. Tagged with , , , , , .

Blender 3D – screencast keys addon.

Fist you need to take the python script from here.
The script need to be into Blender script folder to be used.
Open the Blender 3D application, go to the File – User preferences search the word Screencast and enable the addon by check the checkbox.
To use this addon then go to the 3D View, hit Shift+Alt+C keys.
Another way is to press N key to see the right panel and then use the Start Display button.
See the next image:
Blender 3D addon

Posted in 3D, All, Blender 3D. Tagged with , , , , , , , , , , .