Blender add-on: NodeTree Source
Blender 3D add-on for converting material nodes into python source code and storing it in the library.
Blender 3D add-on for converting material nodes into python source code and storing it in the library.
For objects rotation, we can use the “rotation_euler” property. This property is a list of three items, each of them corresponds to the rotation angle around the X, Y, and Z-axis. The otation_euler[0] contains the rotation angle around the X-axis, rotation_euler[1] – around the Y-axis, and rotation_euler[2] – around the Z-axis. To rotate an object we must set a rotation angle to the appropriate field of the property.
For example, to rotate an active object around the X-axis to the 90 degrees angle we must execute the following command:
1 2 |
import math bpy.context.active_object.rotation_euler[0] = math.radians(90) |
math.radians is used to convert degrees to radians.
The flat/smooth shading mode is regulated through the “use_smooth” property of each polygon of the mesh.
To enable smooth shading we need to set the “use_smooth” property of each mesh polygon to “True”.
For active object:
1 |
bpy.context.object.data.polygons.foreach_set('use_smooth', [True] * len(bpy.context.object.data.polygons)) |
To enable flat shading – set the “use_smooth” property of each polygon to “False”.
1 |
bpy.context.object.data.polygons.foreach_set('use_smooth', [False] * len(bpy.context.object.data.polygons)) |
To make new shading mode visible – force update mesh data:
1 |
bpy.context.object.data.update() |
Blender add-on “EEVEE Materials Override” updated to v. 1.2.0.
An introduction to the “Collection Manager” add-on, greatly improving the collections abilities in Blender. This addon is included in the base add-ons in Blender 2.83.
By Paul Kotelevets (1D_Inc)
The Blender 2.83.1 release is enabled for downloading on the official Blender site.
Tutorial about color spaces used in Blender.
Summary:
To switch to the view from the active camera we can execute the following command:
1 |
bpy.ops.view3d.view_camera() |
This operator works in the toggle mode, so the next executing of the same command returns the view to the previous state.
Switching to the view from camera throug the python APIRead More »