Skip to content

Commit b794af7

Browse files
dmitratclaude
andcommitted
feat(addon): kind icons tell projects and groups apart in the Target list - v1.0.11
Operator report: with campaigns and groups sharing one flat dropdown the kinds were indistinguishable. Enum colors are not a thing Blender can do, but per-item icons are - and they render both in the open menu and on the collapsed control. Projects carry RENDER_ANIMATION, groups carry COMMUNITY; the placeholder stays icon-less. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 9caab9e commit b794af7

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

OutWit.Render.BlenderAddon/outwit_render_bridge/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
bl_info = {
22
"name": "OmnibusCloud Render Bridge",
33
"author": "OutWit",
4-
"version": (1, 0, 10),
4+
"version": (1, 0, 11),
55
"blender": (4, 0, 0),
66
"location": "View3D > Sidebar > OmnibusCloud",
77
"description": "Thin Blender addon for the local OmnibusCloud render bridge",

OutWit.Render.BlenderAddon/outwit_render_bridge/blender_manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
schema_version = "1.0.0"
22
id = "omnibuscloud_render_bridge"
3-
version = "1.0.10"
3+
version = "1.0.11"
44
name = "OmnibusCloud Render Bridge"
55
tagline = "Thin Blender addon for the local OmnibusCloud render bridge"
66
maintainer = "OutWit"

OutWit.Render.BlenderAddon/outwit_render_bridge/bridge_state.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
# Blender keeps only weak references to the strings returned by a dynamic EnumProperty
2323
# items callback; if we build them inline they get garbage-collected and the UI shows
2424
# corrupted entries (or crashes). Hold a module-level reference to the last built list.
25-
_GROUP_ENUM_ITEMS_CACHE: list[tuple[str, str, str]] = []
25+
_GROUP_ENUM_ITEMS_CACHE: list[tuple] = []
26+
27+
# Kind icons make projects and groups tell apart in the flat dropdown (colors are not a thing
28+
# Blender enums can do; icons render both in the open menu and on the collapsed control).
29+
PROJECT_TARGET_ICON = "RENDER_ANIMATION"
30+
GROUP_TARGET_ICON = "COMMUNITY"
2631

2732

2833
def _parse_scope_json(raw: str) -> list:
@@ -34,31 +39,35 @@ def _parse_scope_json(raw: str) -> list:
3439

3540
def selected_target_items(self, context):
3641
"""Builds the unified Target dropdown: the user's PROJECTS (campaigns) first, then the
37-
authorized GROUPS — ids carry a ``p:``/``g:`` prefix (see bridge_status.split_target_id).
42+
authorized GROUPS — ids carry a ``p:``/``g:`` prefix (see bridge_status.split_target_id),
43+
and each kind carries its own icon so the flat list stays readable.
3844
3945
'All clients / all nodes' is NOT an entry here — it is a separate checkbox (run_on_all_nodes),
4046
so Target always means "a specific project or group". Reads what the bridge reported for the
4147
signed-in user (``projects_json`` / ``groups_json``). A placeholder keeps the enum non-empty
4248
when there are no targets (the control is hidden/disabled in that case).
4349
"""
44-
items: list[tuple[str, str, str]] = []
50+
items: list[tuple] = []
4551

4652
for project in _parse_scope_json(self.projects_json):
4753
project_id = str(project.get("id", "")).strip()
4854
if not project_id:
4955
continue
5056
name = str(project.get("name", "")).strip() or project_id
51-
items.append((project_target_id(project_id), name, f"Render into project '{name}'"))
57+
items.append((project_target_id(project_id), name, f"Render into project '{name}'",
58+
PROJECT_TARGET_ICON, len(items)))
5259

5360
for group in _parse_scope_json(self.groups_json):
5461
group_id = str(group.get("id", "")).strip()
5562
if not group_id:
5663
continue
5764
name = str(group.get("name", "")).strip() or group_id
58-
items.append((group_target_id(group_id), name, f"Render on group '{name}'"))
65+
items.append((group_target_id(group_id), name, f"Render on group '{name}'",
66+
GROUP_TARGET_ICON, len(items)))
5967

6068
if not items:
61-
items.append((NO_GROUP_ID, "No targets", "You have no projects or render groups to launch into"))
69+
items.append((NO_GROUP_ID, "No targets",
70+
"You have no projects or render groups to launch into", "NONE", 0))
6271

6372
_GROUP_ENUM_ITEMS_CACHE.clear()
6473
_GROUP_ENUM_ITEMS_CACHE.extend(items)

0 commit comments

Comments
 (0)