Make `color_tag` writable for Custom Nodes
Im writing a addon for blender, and created lots of custom shader nodes based on
ShaderNodeCustomGroup
.
Now I wanted to change the title colors for clarity, like it’s possible for node-groups with color-tag.
But if i try this:
class MyNode(bpy.types.ShaderNodeCustomGroup):
bl_idname = f"MyNode"
bl_label = "BNG Image Texture"
bl_icon = 'TEXTURE'
def init(self, context):
self.color_tag = "SHADER"
I get:
AttributeError: bpy_struct: attribute "color_tag" from "MyNode" is read-only
So, I’m stuck with the default
INPUT
value of
color_tag
, and it’s really hurting readability.
It would be great if that could be changed ^^
1 Comment
It would make more sense to have a different color tag for each node type, rather that for each node individually, but either way would still work. If you want to know more of what I mean, check for 'Different Python Classes for Custom Node Color Tag', in the Scripting category. For now, the standard way of using color identification on custom nodes is to change the node body color. This is enabled using bpy.types.Node.use_custom_color, and the color is changed using bpy.types.Node.color, which takes values like this: (1.0, 0.5, 0)