55 lines
1.2 KiB
Python
55 lines
1.2 KiB
Python
"""
|
|
Node Kit UI elements and menus.
|
|
|
|
:author: Autour de Minuit
|
|
:maintainers: Florentin LUCE
|
|
:date: 2024
|
|
"""
|
|
|
|
import bpy
|
|
|
|
|
|
class NODEKIT_MT_node_kit(bpy.types.Menu):
|
|
bl_label = "Node kit"
|
|
|
|
def draw(self, context):
|
|
layout = self.layout
|
|
|
|
layout.operator("node_kit.copy_nodes", icon="COPYDOWN")
|
|
layout.operator("node_kit.paste_nodes", icon="PASTEDOWN")
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("node_kit.copy_node_tree", icon="NODETREE")
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("node_kit.remap_node_group_duplicates",icon="NODE_INSERT_OFF")
|
|
layout.operator("node_kit.update_nodes", icon="IMPORT")
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("node_kit.pack_nodes", icon="PACKAGE")
|
|
layout.operator("node_kit.unpack_nodes", icon="UGLYPACKAGE")
|
|
|
|
|
|
classes = (NODEKIT_MT_node_kit,)
|
|
|
|
|
|
def draw_menu(self, context):
|
|
self.layout.menu("NODEKIT_MT_node_kit")
|
|
|
|
|
|
def register():
|
|
for c in classes:
|
|
bpy.utils.register_class(c)
|
|
|
|
bpy.types.NODE_MT_editor_menus.append(draw_menu)
|
|
|
|
|
|
def unregister():
|
|
bpy.types.NODE_MT_editor_menus.remove(draw_menu)
|
|
|
|
for c in reversed(classes):
|
|
bpy.utils.unregister_class(c)
|