mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 02:47:48 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user