View empty_following_a_bezier_circle_curve.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
last_frame = 90 | |
# set the lenght of the animation | |
bpy.context.scene.frame_end = last_frame | |
# add a Bezier circle curve into the scene | |
bpy.ops.curve.primitive_bezier_circle_add() | |
bezier_circle_obj = bpy.context.active_object |
View update_cube_hight.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
custom_size = 5 | |
# add cube into the scene | |
bpy.ops.mesh.primitive_cube_add(size=custom_size) | |
cube_obj = bpy.context.active_object | |
# move the cube up half way on the Z axis | |
cube_obj.location.z = custom_size / 2 |
View reading_and_writing_json_files.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extend Python's functionality to work with JSON files | |
import json | |
# extend Python's functionality to work with file paths | |
import pathlib | |
# extend Python's functionality to print data in a readable way | |
import pprint | |
# give Python access to Blender's functionality |
View create_a_cube_with_bmesh.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
verts = [ | |
(-1.0, -1.0, -1.0), | |
(-1.0, 1.0, -1.0), | |
(1.0, 1.0, -1.0), | |
(1.0, -1.0, -1.0), | |
(-1.0, -1.0, 1.0), | |
(-1.0, 1.0, 1.0), | |
(1.0, 1.0, 1.0), |
View import_images_as_plains.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extend Python's functionality to work with file paths | |
import pathlib | |
# give Python access to Blender's functionality | |
import bpy | |
# give Python access to Blender's add-on functionality | |
import addon_utils | |
View rolling_cube_part_2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extend Python's math functionality | |
import math | |
# give Python access to Blender's functionality | |
import bpy | |
def create_cube(): | |
"""Add a cube into the scene""" | |
bpy.ops.mesh.primitive_cube_add() | |
return bpy.context.active_object |
View easy_cube_rotation_animation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# give Python access to Blender's functionality | |
import bpy | |
# extend Python's math functionality | |
import math | |
# add a cube into the scene | |
bpy.ops.mesh.primitive_cube_add() | |
# get a reference to the currently active object | |
cube = bpy.context.active_object |
View rolling_cube_part_1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extend Python's math functionality | |
import math | |
# give Python access to Blender's functionality | |
import bpy | |
# create cube | |
bpy.ops.mesh.primitive_cube_add() | |
cube = bpy.context.active_object |
View add_ico_spheres_in_a_circle_add_on.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example of turing the script from this tutorial | |
https://youtu.be/uOQ-CPcaqMo | |
into a simple add-on. | |
This code is based on the addon_add_object.py Python template distributed with BLender under the GNU GPL license. | |
An explanation of this script can be found in this tutorial: https://youtu.be/x3QRp2k013k | |
""" | |
bl_info = { |
View refactor_and_animate.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# give Python access to Blender's functionality | |
import bpy | |
# extend Python's math functionality | |
import math | |
# extend Python functionality to generate random numbers | |
import random | |
NewerOlder