Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # decompose world_matrix's components
- orig_loc, orig_rot, orig_scale = obj.matrix_world.decompose()
- #create the translation vector
- translation = mathutils.Vector((2,1,-1))
- new_loc = orig_loc + translation
- orig_loc_mat = Matrix.Translation(new_loc)
- orig_rot_mat = orig_rot.to_matrix().to_4x4()
- orig_scale_mat = Matrix.Scale(orig_scale[0],4,(sqrt(2),0,0)) *
- Matrix.Scale(orig_scale[1],4,(0,1,0)) *
- Matrix.Scale(orig_scale[2],4(0,0,sqrt(2)))
- obj.matrix_world = orig_loc_mat * rot_mat * orig_rot_mat *
- orig_scale_mat
Add Comment
Please, Sign In to add comment