# Blender 2.81 - Copy cursor rotation to an object

I see in Blender 2.81 that cursor has rotation informations. I would like to find a way to use cursor's Orientation and apply it to an object. Is there an easy way to do that ?

Thanks !

• Hello :). You can manually copy the XYZ values, or use it as a driver for your object. Then, by rotating your cursor, the driven object will also rotate. – Jachym Michal Dec 10 '19 at 11:48
• I'm not aware of a simple option or shortcut in the UI, this is possible in Python though (and therefore an add-on could be written which provide a button). Otherwise the approach described by Jachym would work as well. – Robert Gützkow Dec 10 '19 at 11:49

Snap to cursor with code

Quick little script to copy either or both of cursor location, rotation to selected objects.

import bpy
from mathutils import Matrix

use_rotation = True # use cursor rot
use_location = True #  "    "    loc

context = bpy.context

cursor = context.scene.cursor

tc, qc, sc = cursor.matrix.decompose()

for ob in context.selected_objects:
to, qo, so = ob.matrix_world.decompose()

R = qc.to_matrix().to_4x4() if use_rotation else qo.to_matrix().to_4x4()

T = Matrix.Translation(tc) if use_location else Matrix.Translation(to)

S = Matrix.Diagonal(so).to_4x4()

ob.matrix_world = T @ R @ S

• Thank you; this is great! I can't believe this is not a button in the N-Panel>View>3D Cursor, or an option when doing Shift+S, or at least the ability to right click the rotation XYZ and "Copy All to Selected". – Coby Randal Apr 19 at 23:34