import bpy
from mathutils import *
import math
def apply_matrix(mat, objs):
for i in range(len(objs)):
obj = objs[i]
print (obj.matrix_world)
print(mat)
obj.matrix_world = mat*obj.matrix_world
mat = Euler([0,0,30*math.pi/180], 'XYZ').to_matrix().to_4x4()
apply_matrix(mat, [ o for o in bpy.context.scene.objects if o.select])
|
Blender python API quick-start
Syntax highlighting by Pygments.