Skip to content

Instantly share code, notes, and snippets.

@shspage
Created March 11, 2017 00:29
Show Gist options
  • Select an option

  • Save shspage/65ab1e746246d02c421e7bbc7be96fbf to your computer and use it in GitHub Desktop.

Select an option

Save shspage/65ab1e746246d02c421e7bbc7be96fbf to your computer and use it in GitHub Desktop.
blender script
import bpy
import math
import mathutils
# 影の作例に使ったOBJ用のblenderスクリプト。
# 立方体が選択されてる状態で実行。
t = math.pi * 2 / 10
omat = bpy.context.object.matrix_world
for i in range(10):
bpy.ops.object.duplicate()
obj = bpy.context.object
obj.location = (0,0,0)
matt = mathutils.Matrix.Translation((6,0,0))
matr = mathutils.Matrix.Rotation(t * i, 4, "Z")
mat = matr * matt
obj.matrix_world = omat * mat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment