3
$\begingroup$

Is it possible to tell which screen (3D view, Node editor, etc.) the cursor is in with python?

Can I also get properties specific to that view, (even when there is more than one open) e.g. determine which (if any) 3D view is in camera view?

$\endgroup$
6
$\begingroup$

It's all accessible through bpy.context. The active area is accessible through context.area (of type Area), while data specific to the active area's current display type through context.space_data (of type Space).

Once the active space is ascertained as a 3D View, we can access its view properties through context.region_data or context.space_data.region_3d (of type RegionView3D) e.g. to check its view perspective.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.