Teachers could switch between different buildings only once a day, at one of the lessons (for example, only during 5th lesson, or lunch break)
Add two advanced relationships:
During 1-5 periods ( lessons) building change is not allowed (set to max. 1 building per day), and then during 6-8 lessons – again not allowed. Switching to another building is possible only during the 5th period.
This also can be done indirectly.
Let’s say, one class has lessons in one building, another class – in other building.
Then, if the teacher has morning lessons, periods 1 – 4 for 5th grade classes (one building), at this time he may be prevented from having lessons for 6th grade classes, which are in other building: