diff options
Diffstat (limited to 'release/scripts/templates_py/operator_node.py')
-rw-r--r-- | release/scripts/templates_py/operator_node.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/release/scripts/templates_py/operator_node.py b/release/scripts/templates_py/operator_node.py index 764e50d1697..b5ca491a0fe 100644 --- a/release/scripts/templates_py/operator_node.py +++ b/release/scripts/templates_py/operator_node.py @@ -46,13 +46,18 @@ class NodeOperator(bpy.types.Operator): main(self, context) return {'FINISHED'} +def menu_func(self, context): + self.layout.operator(NodeOperator.bl_idname, text=NodeOperator.bl_label) +# Register and add to the "Node" menu (required to also use F3 search "Simple Node Operator" for quick access) def register(): bpy.utils.register_class(NodeOperator) + bpy.types.NODE_MT_node.append(menu_func) def unregister(): bpy.utils.unregister_class(NodeOperator) + bpy.types.NODE_MT_node.remove(menu_func) if __name__ == "__main__": |