anyone know python script for Object>Snap>Selection to Cursor? (Assuming I have the object selected)
1 Answer
I figured it out. Just select the object and set it location to (0.0,0.0,0.0)
bpy.data.objects["name"].location = (0.0,0.0,0.0)
-
$\begingroup$ (0.0,0.0,0.0) is the center of the scene. The 3d Cursor is a different thing. There is an operator for snapping objects to the location of the 3d Cursor:
bpy.ops.view3d.snap_selected_to_cursor()
See the documentation $\endgroup$ Oct 22, 2019 at 10:01