Update leenkx/blender/lnx/write_data.py

This commit is contained in:
Onek8 2025-03-19 16:24:04 +00:00
parent f3ab801928
commit 0bd0c57a00

View File

@ -579,8 +579,19 @@ def write_indexhtml(w, h, is_publish):
<canvas style="object-fit: contain; min-width: 100%; max-width: 100%; max-height: 100vh; min-height: 100vh; display: block;" id='khanvas' tabindex='-1'""" + str(popupmenu_in_browser) + """></canvas> <canvas style="object-fit: contain; min-width: 100%; max-width: 100%; max-height: 100vh; min-height: 100vh; display: block;" id='khanvas' tabindex='-1'""" + str(popupmenu_in_browser) + """></canvas>
""") """)
else: else:
f.write(""" if wrd.lnx_winmode != 'Headless':
f.write("""
<p align="center"><canvas align="center" style="outline: none;" id='khanvas' width='""" + str(w) + """' height='""" + str(h) + """' tabindex='-1'""" + str(popupmenu_in_browser) + """></canvas></p> <p align="center"><canvas align="center" style="outline: none;" id='khanvas' width='""" + str(w) + """' height='""" + str(h) + """' tabindex='-1'""" + str(popupmenu_in_browser) + """></canvas></p>
""")
else:
f.write("""
<canvas align="center" style="display: none;" id='khanvas' width='""" + str(w) + """' height='""" + str(h) + """' tabindex='-1'""" + str(popupmenu_in_browser) + """></canvas>
<script>
// Quick solution for headless mode only for HTML target
window.onload = function() {
document.getElementById('khanvas').remove();
}
</script>
""") """)
f.write(""" f.write("""
<script src='kha.js'></script> <script src='kha.js'></script>