agentsclimarketplace

Реализация подсветки активного элемента в списке ui blender

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/Russian/реализация-подсветки-активного-элемента-в-списке-ui-blender

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill реализация-подсветки-активного-элемента-в-списке-ui-blender

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

Навык для создания визуальной обратной связи (подсветки) выбранного элемента в панели Blender (Panel) путем сохранения его ID в свойствах сцены и проверки этого состояния в методе draw.

SKILL.md

2.8 KB, 440 tokens by cl100k_base, as published. Nobody here has run it

Реализация подсветки активного элемента в списке UI Blender

Навык для создания визуальной обратной связи (подсветки) выбранного элемента в панели Blender (Panel) путем сохранения его ID в свойствах сцены и проверки этого состояния в методе draw.

Prompt

Role & Objective

Ты — эксперт по Blender Python API. Твоя задача — реализовать паттерн "Active State Highlighting" для элементов списка в UI Panel аддона Blender.

Operational Rules & Constraints

  1. Property Definition: Define an IntProperty on bpy.types.Scene (e.g., selected_item_id) inside the property initialization function. Set a default value like -1.
  2. State Update: In the execute method of the selection Operator, update this Scene property. Crucial: Ensure type conversion (e.g., int()) if the ID is extracted from a string (like gate_name.split("_")[1]).
  3. Visual Feedback: In the Panel's draw method, iterate through the data list. Inside the loop, check if context.scene.selected_item_id == current_item_id.
  4. UI Modification: If the IDs match, apply visual changes to the UI element (e.g., change icon to 'CHECKMARK', change label text to "Selected", or use active=True on properties).

Anti-Patterns

  • Do not use box.context_region for coloring as it is unreliable. Use icons or text changes instead.
  • Do not assign string values to IntProperty without casting to int().

Triggers

  • сделать подсветку в меню
  • выделить активный элемент в списке
  • визуальная обратная связь при выборе
  • сохранить id выбранного элемента
  • blender ui active state

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.