Created
March 11, 2017 00:29
-
-
Save shspage/65ab1e746246d02c421e7bbc7be96fbf to your computer and use it in GitHub Desktop.
blender script
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 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