P2P Export - Nodes - Patch

This commit is contained in:
2026-10-06 02:10:08 -07:00
parent 9fee67d231
commit 4ab646015d
49 changed files with 2478 additions and 1164 deletions

View File

@ -248,6 +248,7 @@ def export_data_impl(fp, sdk_path):
export_navigation = bpy.data.worlds['Lnx'].lnx_navigation != 'Disabled'
export_ui = bpy.data.worlds['Lnx'].lnx_ui != 'Disabled'
export_network = bpy.data.worlds['Lnx'].lnx_network != 'Disabled'
export_torrent = bpy.data.worlds['Lnx'].lnx_torrent != 'Disabled'
assets.reset()
mat_state.material_cache.clear()
@ -264,6 +265,7 @@ def export_data_impl(fp, sdk_path):
navigation_found = False
ui_found = False
network_found = False
torrent_found = False
LeenkxExporter.compress_enabled = wrd.lnx_asset_compression
LeenkxExporter.optimize_enabled = state.is_publish and wrd.lnx_optimize_data
if not os.path.exists(build_dir + '/compiled/Assets'):
@ -326,6 +328,8 @@ def export_data_impl(fp, sdk_path):
ui_found = True
if LeenkxExporter.export_network:
network_found = True
if LeenkxExporter.export_torrent:
torrent_found = True
assets.add(asset_path)
if physics_found is False: # Disable physics if no rigid body is exported
@ -340,6 +344,9 @@ def export_data_impl(fp, sdk_path):
if network_found == False:
export_network = False
if torrent_found == False:
export_torrent = False
# Ugly workaround: some logic nodes require Zui code even if no UI is used,
# for now enable UI export unless explicitly disabled.
export_ui = True
@ -349,6 +356,9 @@ def export_data_impl(fp, sdk_path):
if wrd.lnx_network == 'Enabled':
export_network = True
if wrd.lnx_torrent == 'Enabled':
export_torrent = True
modules = []
if wrd.lnx_audio == 'Enabled':
modules.append('audio')
@ -360,6 +370,8 @@ def export_data_impl(fp, sdk_path):
modules.append('ui')
if export_network:
modules.append('network')
if export_torrent:
modules.append('torrent')
defs = lnx.utils.def_strings_to_array(wrd.world_defs)
cdefs = lnx.utils.def_strings_to_array(wrd.compo_defs)
@ -451,7 +463,7 @@ def export_data_impl(fp, sdk_path):
wrd.lnx_project_version = lnx.utils.change_version_project(wrd.lnx_project_version)
# Write khafile.js
write_data.write_khafilejs(state.is_play, export_physics, export_navigation, export_ui, export_network, state.is_publish, LeenkxExporter.import_traits)
write_data.write_khafilejs(state.is_play, export_physics, export_navigation, export_ui, export_network, export_torrent, state.is_publish, LeenkxExporter.import_traits)
# Write Main.hx - depends on write_khafilejs for writing number of assets
scene_name = lnx.utils.get_project_scene_name()