PyAPI: require a unique_id for bl_ui.generic_ui_list

An empty unique_id would generate a warning when drawing.
This commit is contained in:
Campbell Barton
2023-06-20 11:48:41 +10:00
parent 75ac92ed85
commit 1d4ce828e5
2 changed files with 3 additions and 2 deletions

View File

@@ -29,7 +29,7 @@ def draw_ui_list(
context,
class_name="UI_UL_list",
*,
unique_id="",
unique_id,
list_path,
active_index_path,
insertion_operators=True,
@@ -46,7 +46,7 @@ def draw_ui_list(
:type context: :class:`Context`
:arg class_name: Name of the UIList class to draw. The default is the UIList class that ships with Blender.
:type class_name: str
:arg unique_id: Optional identifier, in case wanting to draw multiple unique copies of a list.
:arg unique_id: Unique identifier to differentiate this from other UI lists.
:type unique_id: str
:arg list_path: Data path of the list relative to context, eg. "object.vertex_groups".
:type list_path: str

View File

@@ -20,6 +20,7 @@ class MyPanel(bpy.types.Panel):
context,
list_path="scene.my_list",
active_index_path="scene.my_list_active_index",
unique_id="my_list_id",
)