Blender 5.0 - fix bpy_restrict_state error

It's probably will be very popular bug, when someone would try to migrate to Blender 5.0 using old Bonsai.

Example traceback:

```
  File "Blender\5.0\extensions\.local\lib\python3.11\site-packages\bonsai\bim\prop.py", line 34, in <module>
    import bonsai.bim.schema
  File "Blender\5.0\extensions\.local\lib\python3.11\site-packages\bonsai\bim\schema.py", line 23, in <module>
    import bpy_restrict_state
ModuleNotFoundError: No module named 'bpy_restrict_state'
```
This commit is contained in:
Andrej730
2025-10-31 18:42:22 +05:00
parent b97c7d39ad
commit 9c93b12084
+5 -1
View File
@@ -20,7 +20,11 @@ import ifcopenshell
import ifcopenshell.util.pset
import bonsai.tool as tool
import bpy
import bpy_restrict_state
if bpy.app.version >= (5, 0, 0):
import _bpy_restrict_state as bpy_restrict_state
else:
import bpy_restrict_state
class IfcSchema: