get_viewport_context to also return space

This commit is contained in:
Andrej730
2023-09-20 11:01:54 +05:00
parent 9f1bfe2868
commit 9e7d04f337
+2 -1
View File
@@ -168,7 +168,8 @@ class Blender:
"""
area = next(area for area in bpy.context.screen.areas if area.type == "VIEW_3D")
region = next(region for region in area.regions if region.type == "WINDOW")
context_override = {"area": area, "region": region}
space = next(space for space in area.spaces if space.type == "VIEW_3D")
context_override = {"area": area, "region": region, "space_data": space}
return context_override
@classmethod