I made a simple python script that mimics the zbrush split-screen allowing to synchronize the location/rotation/zoom of two view3ds (focused on different objects). While trying to turn it into a proper plugin I got stuck with not being able to specifically identify the areas.
The closest I was able to get is Screen
which has several areas
of interest. Now, for every view3d area I want to store two custom properties: is it a leader view, a follower view or a non-managed view, and the object that this view focuses on.
Here are the ideas I had:
- use custom props. A no-go as Area doesn’t subclass ID and can’t have those
- use python props on Area. Pretty useless as you can’t expose those to the UI so you can’t edit them in a user-friendly way
- store the context in a list on the closest ID (
Screen
). That could theoretically work but I found no way to make sure the user’s changing of areas could be properly tracked to update my collection (other than to make a custom python prop on the area and verify those on every update).
Are there any better strategies that I’m missing?
TL;DR: I need to store a bool property and a pointer property per-Area and expose those to the UI.