Blender 4.4 - fix broken UI lists #6396

Example error:
```python
RuntimeError: could not create instance of BIM_UL_containers_manager to call callback function 'filter_items'
2025-03-19:16:13:14,001 ERROR   [log.py:69] Uncaught exception
RuntimeError: could not create instance of BIM_UL_containers_manager to call callback function 'draw_item'
```
This commit is contained in:
Andrej730
2025-03-19 16:35:36 +05:00
parent fa3c57b016
commit 3c777a0b85
2 changed files with 8 additions and 8 deletions
+4 -6
View File
@@ -708,18 +708,16 @@ class BIM_UL_cost_items_trait:
class BIM_UL_cost_items(BIM_UL_cost_items_trait, UIList):
def __init__(self):
self.contract_operator = "bim.contract_cost_item"
self.expand_operator = "bim.expand_cost_item"
contract_operator = "bim.contract_cost_item"
expand_operator = "bim.expand_cost_item"
class BIM_UL_cost_item_rates(BIM_UL_cost_items_trait, UIList):
# A schedule of rates UIList is identical to a regular cost items UIList but
# we want a separate UIList instance so that you can browse both lists
# independently in Blender. So we use a trait.
def __init__(self):
self.contract_operator = "bim.contract_cost_item_rate"
self.expand_operator = "bim.expand_cost_item_rate"
contract_operator = "bim.contract_cost_item_rate"
expand_operator = "bim.expand_cost_item_rate"
def draw_quantity_column(self, layout, cost_item):
self.draw_uom_column(layout, cost_item)
+4 -2
View File
@@ -264,7 +264,8 @@ class BIM_UL_containers_manager(UIList):
"IfcRoadPart": "MOD_FLUID",
}
def __init__(self):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.use_filter_show = True
def draw_item(
@@ -338,7 +339,8 @@ class BIM_UL_containers_manager(UIList):
class BIM_UL_elements(UIList):
def __init__(self):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.use_filter_show = True
def draw_toggle(self, row: bpy.types.UILayout, is_expanded: bool, index: int):