forked from LeenkxTeam/LNXSDK
P2P Export - Nodes - Patch
This commit is contained in:
@ -1358,11 +1358,150 @@ class LNX_PT_ProjectModulesPanel(bpy.types.Panel):
|
||||
layout.prop(wrd, 'lnx_navigation_engine')
|
||||
layout.prop(wrd, 'lnx_ui')
|
||||
layout.prop(wrd, 'lnx_network')
|
||||
layout.prop(wrd, 'lnx_torrent')
|
||||
|
||||
layout.prop_search(wrd, 'lnx_khafile', bpy.data, 'texts')
|
||||
layout.prop(wrd, 'lnx_project_root')
|
||||
layout.prop(wrd, 'lnx_external_blends_path')
|
||||
|
||||
|
||||
class LNX_UL_TorrentTrackerList(bpy.types.UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
||||
layout.prop(item, "name", text="", emboss=False, icon='NETWORK_DRIVE')
|
||||
|
||||
class LnxTorrentTrackerListNewItem(bpy.types.Operator):
|
||||
bl_idname = "lnx_torrent_tracker_list.new_item"
|
||||
bl_label = "Add a new tracker"
|
||||
|
||||
def execute(self, context):
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
wrd.lnx_torrent_trackers.add()
|
||||
wrd.lnx_torrent_trackers_index = len(wrd.lnx_torrent_trackers) - 1
|
||||
assets.invalidate_compiler_cache(wrd, context)
|
||||
return{'FINISHED'}
|
||||
|
||||
class LnxTorrentTrackerListDeleteItem(bpy.types.Operator):
|
||||
bl_idname = "lnx_torrent_tracker_list.delete_item"
|
||||
bl_label = "Deletes a tracker"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
return len(wrd.lnx_torrent_trackers) > 0
|
||||
|
||||
def execute(self, context):
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
index = wrd.lnx_torrent_trackers_index
|
||||
|
||||
wrd.lnx_torrent_trackers.remove(index)
|
||||
wrd.lnx_torrent_trackers_index = min(max(0, index - 1), len(wrd.lnx_torrent_trackers) - 1)
|
||||
assets.invalidate_compiler_cache(wrd, context)
|
||||
return{'FINISHED'}
|
||||
|
||||
class LnxTorrentTrackerListReset(bpy.types.Operator):
|
||||
bl_idname = "lnx_torrent_tracker_list.reset_items"
|
||||
bl_label = "Reset To Default Trackers"
|
||||
bl_description = "Remove all trackers and add back the default ones"
|
||||
|
||||
def execute(self, context):
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
wrd.lnx_torrent_trackers.clear()
|
||||
for url in props.LNX_TORRENT_DEFAULT_TRACKERS:
|
||||
wrd.lnx_torrent_trackers.add().name = url
|
||||
wrd.lnx_torrent_trackers_index = 0
|
||||
assets.invalidate_compiler_cache(wrd, context)
|
||||
return{'FINISHED'}
|
||||
|
||||
class LNX_UL_TorrentIceServerList(bpy.types.UIList):
|
||||
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
|
||||
layout.prop(item, "name", text="", emboss=False, icon='URL')
|
||||
|
||||
class LnxTorrentIceServerListNewItem(bpy.types.Operator):
|
||||
bl_idname = "lnx_torrent_ice_server_list.new_item"
|
||||
bl_label = "Add a new ICE server"
|
||||
|
||||
def execute(self, context):
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
wrd.lnx_torrent_ice_servers.add()
|
||||
wrd.lnx_torrent_ice_servers_index = len(wrd.lnx_torrent_ice_servers) - 1
|
||||
assets.invalidate_compiler_cache(wrd, context)
|
||||
return{'FINISHED'}
|
||||
|
||||
class LnxTorrentIceServerListDeleteItem(bpy.types.Operator):
|
||||
bl_idname = "lnx_torrent_ice_server_list.delete_item"
|
||||
bl_label = "Deletes an ICE server"
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
return len(wrd.lnx_torrent_ice_servers) > 0
|
||||
|
||||
def execute(self, context):
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
index = wrd.lnx_torrent_ice_servers_index
|
||||
|
||||
wrd.lnx_torrent_ice_servers.remove(index)
|
||||
wrd.lnx_torrent_ice_servers_index = min(max(0, index - 1), len(wrd.lnx_torrent_ice_servers) - 1)
|
||||
assets.invalidate_compiler_cache(wrd, context)
|
||||
return{'FINISHED'}
|
||||
|
||||
class LnxTorrentIceServerListReset(bpy.types.Operator):
|
||||
bl_idname = "lnx_torrent_ice_server_list.reset_items"
|
||||
bl_label = "Reset To Default ICE Servers"
|
||||
bl_description = "Remove all ICE servers and add back the default ones"
|
||||
|
||||
def execute(self, context):
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
wrd.lnx_torrent_ice_servers.clear()
|
||||
for url in props.LNX_TORRENT_DEFAULT_ICE_SERVERS:
|
||||
wrd.lnx_torrent_ice_servers.add().name = url
|
||||
wrd.lnx_torrent_ice_servers_index = 0
|
||||
assets.invalidate_compiler_cache(wrd, context)
|
||||
return{'FINISHED'}
|
||||
|
||||
class LNX_PT_LeenkxNetworkPanel(bpy.types.Panel):
|
||||
bl_label = "Leenkx Network"
|
||||
bl_space_type = "PROPERTIES"
|
||||
bl_region_type = "WINDOW"
|
||||
bl_context = "render"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.use_property_split = True
|
||||
layout.use_property_decorate = False
|
||||
wrd = bpy.data.worlds['Lnx']
|
||||
|
||||
col = layout.column()
|
||||
col.enabled = wrd.lnx_torrent != 'Disabled'
|
||||
|
||||
col.prop(wrd, "lnx_torrent_download_dir")
|
||||
col.prop(wrd, "lnx_torrent_peer_timeout")
|
||||
col.prop(wrd, "lnx_torrent_heartbeat")
|
||||
|
||||
col.label(text="Trackers")
|
||||
rows = 2
|
||||
if len(wrd.lnx_torrent_trackers) > 1:
|
||||
rows = 4
|
||||
row = col.row()
|
||||
row.template_list("LNX_UL_TorrentTrackerList", "The_List", wrd, "lnx_torrent_trackers", wrd, "lnx_torrent_trackers_index", rows=rows)
|
||||
btns = row.column(align=True)
|
||||
btns.operator("lnx_torrent_tracker_list.new_item", icon='ADD', text="")
|
||||
btns.operator("lnx_torrent_tracker_list.delete_item", icon='REMOVE', text="")
|
||||
|
||||
col.operator("lnx_torrent_tracker_list.reset_items", icon='FILE_REFRESH')
|
||||
|
||||
col.label(text="ICE Servers")
|
||||
rows = 2
|
||||
if len(wrd.lnx_torrent_ice_servers) > 1:
|
||||
rows = 4
|
||||
row = col.row()
|
||||
row.template_list("LNX_UL_TorrentIceServerList", "The_List", wrd, "lnx_torrent_ice_servers", wrd, "lnx_torrent_ice_servers_index", rows=rows)
|
||||
btns = row.column(align=True)
|
||||
btns.operator("lnx_torrent_ice_server_list.new_item", icon='ADD', text="")
|
||||
btns.operator("lnx_torrent_ice_server_list.delete_item", icon='REMOVE', text="")
|
||||
|
||||
col.operator("lnx_torrent_ice_server_list.reset_items", icon='FILE_REFRESH')
|
||||
|
||||
class LnxVirtualInputPanel(bpy.types.Panel):
|
||||
bl_label = "Leenkx Virtual Input"
|
||||
bl_space_type = "PROPERTIES"
|
||||
@ -3107,6 +3246,15 @@ __REG_CLASSES = (
|
||||
LNX_PT_ProjectFlagsDebugConsolePanel,
|
||||
LNX_PT_ProjectWindowPanel,
|
||||
LNX_PT_ProjectModulesPanel,
|
||||
LNX_UL_TorrentTrackerList,
|
||||
LnxTorrentTrackerListNewItem,
|
||||
LnxTorrentTrackerListDeleteItem,
|
||||
LnxTorrentTrackerListReset,
|
||||
LNX_UL_TorrentIceServerList,
|
||||
LnxTorrentIceServerListNewItem,
|
||||
LnxTorrentIceServerListDeleteItem,
|
||||
LnxTorrentIceServerListReset,
|
||||
LNX_PT_LeenkxNetworkPanel,
|
||||
LNX_PT_RenderPathPanel,
|
||||
LNX_PT_RenderPathRendererPanel,
|
||||
LNX_PT_RenderPathShadowsPanel,
|
||||
|
||||
Reference in New Issue
Block a user