Unable to use custom icon as bl_icon for Custom Node Tree #85213
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#85213
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows 10
Graphics card: Nvidia RTX 2080 ti
Blender Version
Broken: 2.83.10
Worked: Not sure if ever worked
Short description of error
When setting the icon for a custom node tree you can only set it to the blender icons. It seems like the node tree is loaded or checked before it is registered as the variable
custom_icons
always is called before it can be assigned as an image preview.Exact steps for others to reproduce the error
Based on the attached .blend file just try to install and enable the addon. Depending on what is commented out the error will either say
'NoneType' object is not subscriptable
ifcustom_icons
is set toNone
initiallyor
KeyError: 'logo'
ifcustom_icons
is set tobpy.utils.previews.new()
initiallyIconTest.zip
Added subscriber: @Zeastin
Added subscriber: @rjg
Changed status from 'Needs Triage' to: 'Archived'
For
bl_icon
you have to assign a valid enum as listed in the Python API docs .If you assign
None
to a variable and then try to access it like and array that results in this errorIf there is no entry with the key
logo
then this is the error you will see. Initially the collection doesn't contain any entry.If you need help learning or using Blender, please post a question on one of our [community websites ]], for instance https:*blender.stackexchange.com/ , https:*blenderartists.org/ or the [ https:*blender.chat/channel/support | #support channel on Blender chat . The bug tracker is only for bug reports.
@rjg Thank you for your response!
Apologies, but this would seem like unexpected behavior since almost everywhere else you can add an icon you can also add a custom icon even if it is an icon_value.
And the reason I added it as a bug was due to the seeming brain dead obvious errors in that no matter what I initially assigned to
custom_icons
it is never given anything before the Node Tree tries to access it. In the addon I included in my message you might have noticed thatcustom_icon
should be filled before it is referenced by bl_icon. I was not seeking help in learning. Thank you for your time@Zeastin the errors you are getting are entirely unrelated to whether
bl_icon
allows to assign a custom icon. Even if it would be supported the script wouldn't work. In both variations the variable doesn't contain the data you're expecting at the time it is accessed, hence the error message that one time it isNone
and thus you can't access it with an index, and the other time because the collection doesn't contain an entry with the keylogo
. If it is unclear to you why that is the case, then please create a question on Blender's Stack Exchange , post a link to it here and I will try to answer it.