Page MenuHome

Specify Icon for NodeItem
AbandonedPublic

Authored by Christopher Gearhart (bblanimation) on Mon, Nov 18, 5:04 PM.

Details

Summary

Simple addition of the 'icon' parameter to the NodeItem class in the 'nodeitems_utils.py' file.

This allows addons with custom node trees to easily define an icon for their node in the 'Add Node' menu.

Diff Detail

Repository
rB Blender

Event Timeline

dont want to hijack, but reminds me of D1578: fix Custom Python Nodes dont draw their 'bl_icon'

Ah, you're right, they address the same issue. I believe the two can (and potentially should) coexist, as this approach allows the developer to override the node's 'bl_icon' in a specific menu, similarly to the 'label' parameter overriding the node's 'bl_label'.

My personal opinion is that this NodeCategory / NodeItem thing is a bad abstraction. I used it in the beginning, but ended up not using it in every project, because it is way too limiting.

In any case, I think this should be a keyword only argument. In fact, all parameters other than nodetype should be keyword only, because they are optional.

Closing this in favor of the preferred implementation: D1578