During addon registration ``bpy.context`` and ``bpy.data`` are restricted and you can't access their properties.
()
| 82 | |
| 83 | |
| 84 | def is_registering() -> bool: |
| 85 | """ |
| 86 | During addon registration ``bpy.context`` and ``bpy.data`` are restricted |
| 87 | and you can't access their properties. |
| 88 | """ |
| 89 | import bpy |
| 90 | |
| 91 | if TYPE_CHECKING or bpy.app.version >= (5, 0, 0): |
| 92 | import _bpy_restrict_state as bpy_restrict_state |
| 93 | else: |
| 94 | import bpy_restrict_state |
| 95 | |
| 96 | return isinstance(bpy.context, bpy_restrict_state._RestrictContext) |
| 97 | |
| 98 | |
| 99 | def initialize_bbim_semver(): |