forked from LeenkxTeam/LNXSDK
P2P Export - Nodes - Patch
This commit is contained in:
40
leenkx/blender/lnx/logicnode/custom/LN_torrent_event.py
Normal file
40
leenkx/blender/lnx/logicnode/custom/LN_torrent_event.py
Normal file
@ -0,0 +1,40 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class OnTorrentEventNode(LnxLogicTreeNode):
|
||||
"""On Torrent Event"""
|
||||
bl_idname = 'LNOnTorrentEventNode'
|
||||
bl_label = 'On Torrent Event'
|
||||
bl_description = ('Fires when the selected torrent event happens ')
|
||||
lnx_category = 'Leenkx'
|
||||
lnx_version = 1
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(OnTorrentEventNode, self).__init__(*args, **kwargs)
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
property0: HaxeEnumProperty('property0',
|
||||
items=[('ready', 'Ready', 'Metainfo is known; fires immediately if already ready'),
|
||||
('piece', 'Piece', 'A piece finished downloading; Value is the piece index'),
|
||||
('wire', 'Wire', 'A peer connected; Value is the WireProtocol'),
|
||||
('metadata', 'Metadata', 'ut_metadata fetch completed; Value is the MetaInfo'),
|
||||
('done', 'Done', 'All pieces are downloaded'),
|
||||
('error', 'Error', 'Torrent failed; Value is the error string')],
|
||||
name='Event', default='done')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxDynamicSocket', 'Torrent')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Torrent')
|
||||
self.add_output('LnxDynamicSocket', 'Value')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('Leenkx', icon='ORIENTATION_CURSOR')
|
||||
OnTorrentEventNode.on_register()
|
||||
Reference in New Issue
Block a user