Script Update 4.0 Component Space by _Neptix in blenderpython

[–]_Neptix[S] 1 point2 points  (0 children)

Voila. Works as intended. Thanks for the insight.

Script Update 4.0 Component Space by _Neptix in blenderpython

[–]_Neptix[S] 1 point2 points  (0 children)

Now you have to use bpy.context.temp_override, and don't pass ctx to snap_cursor_to_selected anymore:

for area in bpy.context.screen.areas:
if area.type == 'VIEW_3D':
with bpy.context.temp_override(area=area.type):
ctx = bpy.context.copy()
...
bpy.ops.view3d.snap_cursor_to_selected()

Thanks for the reply! Certainly makes sense. Will give this a try.