forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
16
leenkx/blender/lnx/logicnode/browser/LN_alert.py
Normal file
16
leenkx/blender/lnx/logicnode/browser/LN_alert.py
Normal file
@ -0,0 +1,16 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class PrintNode(LnxLogicTreeNode):
|
||||
"""Open a window alert with the give string value (works only for web browsers).
|
||||
|
||||
@input String: message to display.
|
||||
"""
|
||||
bl_idname = 'LNAlertNode'
|
||||
bl_label = 'Alert'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'String')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
21
leenkx/blender/lnx/logicnode/browser/LN_confirm.py
Normal file
21
leenkx/blender/lnx/logicnode/browser/LN_confirm.py
Normal file
@ -0,0 +1,21 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class ConfirmNode(LnxLogicTreeNode):
|
||||
"""Open a window alert with the give string value and returns true or false
|
||||
according to the user answer (works only for web browsers).
|
||||
|
||||
@input String: message to display.
|
||||
|
||||
@output True: return in case user select yes/ok.
|
||||
@output False: return in case user select no/cancel.
|
||||
"""
|
||||
bl_idname = 'LNConfirmNode'
|
||||
bl_label = 'Confirm'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'String')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'True')
|
||||
self.add_output('LnxNodeSocketAction', 'False')
|
@ -0,0 +1,10 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class DetectMobileBrowserNode(LnxLogicTreeNode):
|
||||
"""Determines the mobile browser or not (works only for web browsers)."""
|
||||
bl_idname = 'LNDetectMobileBrowserNode'
|
||||
bl_label = 'Detect Mobile Browser'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_output('LnxBoolSocket', 'Mobile')
|
38
leenkx/blender/lnx/logicnode/browser/LN_loadUrl.py
Normal file
38
leenkx/blender/lnx/logicnode/browser/LN_loadUrl.py
Normal file
@ -0,0 +1,38 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class LoadUrlNode(LnxLogicTreeNode):
|
||||
"""Load the given URL in a new or existing tab (works only for web browsers).
|
||||
|
||||
@input URL: use a complete url or partial for a subpage.
|
||||
@input New: open a new window or redirect existing one.
|
||||
@input Use values: W,H,L,T: open a new window using Width, Height, Left and Top values.
|
||||
@input Width: width for New window.
|
||||
@input Height: height for New window.
|
||||
@input Left: distance from left for New window position.
|
||||
@input Top: distance from top for New window position.
|
||||
|
||||
@output True: for New returns true if the window is opened.
|
||||
@output False: for New returns false if the window is not opened (popup blocked).
|
||||
"""
|
||||
bl_idname = 'LNLoadUrlNode'
|
||||
bl_label = 'Load URL'
|
||||
lnx_version = 2
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'URL')
|
||||
self.add_input('LnxBoolSocket', 'New Window', default_value=True)
|
||||
self.add_input('LnxBoolSocket', 'Use values: W,H,L,T', default_value=False)
|
||||
self.add_input('LnxIntSocket', 'Width', default_value= 500)
|
||||
self.add_input('LnxIntSocket', 'Height', default_value= 500)
|
||||
self.add_input('LnxIntSocket', 'Left')
|
||||
self.add_input('LnxIntSocket', 'Top')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'True')
|
||||
self.add_output('LnxNodeSocketAction', 'False')
|
||||
|
||||
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
|
||||
if self.lnx_version not in (0, 1):
|
||||
raise LookupError()
|
||||
|
||||
return NodeReplacement.Identity(self)
|
22
leenkx/blender/lnx/logicnode/browser/LN_prompt.py
Normal file
22
leenkx/blender/lnx/logicnode/browser/LN_prompt.py
Normal file
@ -0,0 +1,22 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class PromptNode(LnxLogicTreeNode):
|
||||
"""Open a prompt with the give string value an returns either the user value
|
||||
or the default string if specified (works only for web browsers).
|
||||
|
||||
@input String: message to display.
|
||||
@input Default: default string value in case there is no user input.
|
||||
|
||||
@output String: user input value or default value in case is specified.
|
||||
"""
|
||||
bl_idname = 'LNPromptNode'
|
||||
bl_label = 'Prompt'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'String')
|
||||
self.add_input('LnxStringSocket', 'Default')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxStringSocket', 'String')
|
3
leenkx/blender/lnx/logicnode/browser/__init__.py
Normal file
3
leenkx/blender/lnx/logicnode/browser/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
from lnx.logicnode.lnx_nodes import add_node_section
|
||||
|
||||
add_node_section(name='default', category='Browser')
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user