This file contains hidden or 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 | |
import bmesh | |
# Create a Suzanne (monkey head). | |
bm = bmesh.new() | |
bmesh.ops.create_monkey(bm) | |
mesh_data = bpy.data.meshes.new("Suzanne") | |
bm.to_mesh(mesh_data) | |
bm.free() |
This file contains hidden or 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 | |
import bmesh | |
from mathutils import noise, Vector | |
from math import cos, pi, tau | |
# Create a Suzanne (monkey head). | |
bm = bmesh.new() | |
bmesh.ops.create_monkey(bm) | |
mesh_data = bpy.data.meshes.new("Suzanne") | |
bm.to_mesh(mesh_data) |
This file contains hidden or 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 | |
import bmesh | |
# Create a cube. | |
bm = bmesh.new() | |
bmesh.ops.create_cube(bm, size=1.0) | |
mesh_data = bpy.data.meshes.new("Cube") | |
mesh_data.use_auto_smooth = True | |
bm.to_mesh(mesh_data) | |
bm.free() |
This file contains hidden or 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 | |
import bmesh | |
orbit = 2.0 | |
x_expr = "{0:.2f} * cos(tau * ({1} - {2}) / ({3} - {2} + 1))" | |
y_expr = "{0:.2f} * sin(tau * ({1} - {2}) / ({3} - {2} + 1))" | |
bm = bmesh.new() | |
bmesh.ops.create_cube(bm, size=1.0) | |
mesh_data = bpy.data.meshes.new("Cube") |
This file contains hidden or 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 | |
import bmesh | |
from math import cos, sin, pi, tau | |
from mathutils import Color, Euler, Quaternion, Vector | |
rotation_modes = [ | |
'QUATERNION', | |
'AXIS_ANGLE', | |
'XYZ', 'XZY', 'YXZ', |
This file contains hidden or 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 | |
import bmesh | |
import colorsys | |
frame_rate = 30 | |
sz_cube = 1.0 | |
pts = [ | |
(-8.0, -8.0, 0.0), | |
(5.0, -5.0, 0.0), | |
(8.0, 8.0, 0.0), |
This file contains hidden or 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
for mesh_obj in mesh_objs: | |
anim_data = mesh_obj.animation_data | |
action = anim_data.action | |
fcurves = action.fcurves | |
for fcurve in fcurves: | |
fcurve.extrapolation = 'LINEAR' | |
key_frames = fcurve.keyframe_points | |
for key_frame in key_frames: |
This file contains hidden or 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
frame_rate = 30 | |
key_frames = 15 | |
kf_to_prc = 1.0 / (key_frames - 1) | |
scene = bpy.context.scene | |
frame_start = scene.frame_start | |
frame_end = scene.frame_end | |
scene.render.fps = frame_rate | |
lin_range_3 = range(0, count_sq * key_frames, 1) |
This file contains hidden or 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 | |
import bmesh | |
import colorsys | |
from math import sin, sqrt, pi, tau | |
# Number of cubes. | |
count = 16 | |
# Size of grid. | |
extents = 8.0 |
This file contains hidden or 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 | |
from math import cos, sin, sqrt, pi, tau | |
import bmesh | |
import colorsys | |
x_center = 0.0 | |
y_center = 0.0 | |
z_center = 0.0 | |
scale = 8.0 |