I’m trying to make my custom function:
import bpy
def custom_function():
active = bpy.context.active_object
# to set cursor location to active object
bpy.ops.view3d.snap_cursor_to_selected()
custom_fuction()
It's a really simple one, but even that gives me an error:
ret = _op_call(self.idname_py(), None, kw)
Error:
RuntimeError: Operator bpy.ops.view3d.snap_cursor_to_selected.poll() failed, context is incorrect
I quite don’t get it. Why doesn’t it work?
impor bpt
". Is it like that in the original? $\endgroup$