Fix to prevent pyrna_enum_to_py warnings using BIM Tool

Prevents couple `pyrna_enum_to_py` warnings that occured using BIM Tool

```
WARN (bpy.rna): C:\Users\blender\git\blender-v340\blender.git\source\blender\python\intern\bpy_rna.c:1341 pyrna_enum_to_py: current value '0' matches no enum in 'BIMModelProperties', '', 'ifc_class_browser'
WARN (bpy.rna): C:\Users\blender\git\blender-v340\blender.git\source\blender\python\intern\bpy_rna.c:1341 pyrna_enum_to_py: current value '0' matches no enum in 'BIMModelProperties', '', 'relating_type_id'
WARN (bpy.rna): C:\Users\blender\git\blender-v340\blender.git\source\blender\python\intern\bpy_rna.c:1341 pyrna_enum_to_py: current value '0' matches no enum in 'BIMModelProperties', '', 'ifc_class'
```
This commit is contained in:
Andrej730
2023-02-16 17:34:18 +05:00
parent 16cbab2de7
commit 937fa21cce
2 changed files with 5 additions and 6 deletions
@@ -90,7 +90,7 @@ class AuthoringData:
@classmethod
def type_thumbnail(cls):
if not cls.props.relating_type_id:
if not cls.data["relating_types_ids"]:
return 0
element = tool.Ifc.get().by_id(int(cls.props.relating_type_id))
return cls.type_thumbnails.get(element.id(), None) or 0
@@ -221,7 +221,8 @@ class AuthoringData:
@classmethod
def relating_types_browser(cls):
return cls.relating_types(ifc_class=cls.props.ifc_class_browser)
if cls.data["ifc_classes"]:
return cls.relating_types(ifc_class=cls.props.ifc_class_browser)
@classmethod
def new_constr_class_info(cls, ifc_class):
@@ -20,7 +20,7 @@ import bpy
import blenderbim.tool as tool
from bpy.types import Panel, Operator, Menu
from blenderbim.bim.module.model.data import AuthoringData, ArrayData, StairData, SverchokData, WindowData, DoorData
from blenderbim.bim.module.model.prop import store_cursor_position
from blenderbim.bim.module.model.prop import store_cursor_position, get_ifc_class
from blenderbim.bim.module.model.stair import update_stair_modifier
from blenderbim.bim.module.model.window import update_window_modifier_bmesh
from blenderbim.bim.module.model.door import update_door_modifier_bmesh
@@ -40,11 +40,9 @@ class LaunchTypeManager(bpy.types.Operator):
def invoke(self, context, event):
props = context.scene.BIMModelProperties
props.type_page = 1
if props.ifc_class:
if get_ifc_class(None, context):
props.type_class = props.ifc_class
bpy.ops.bim.load_type_thumbnails(ifc_class=props.ifc_class, offset=0, limit=9)
if not AuthoringData.is_loaded:
AuthoringData.load()
return context.window_manager.invoke_popup(self, width=550)
def draw(self, context):