forked from LeenkxTeam/LNXSDK
Update Files
This commit is contained in:
29
leenkx/blender/lnx/logicnode/custom/LN_add_torrent.py
Normal file
29
leenkx/blender/lnx/logicnode/custom/LN_add_torrent.py
Normal file
@ -0,0 +1,29 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class AddTorrentNode(LnxLogicTreeNode):
|
||||
"""Add Torrent"""
|
||||
bl_idname = 'LNAddTorrentNode'
|
||||
bl_label = 'Add Torrent'
|
||||
bl_description = 'Add a torrent file from the network'
|
||||
lnx_category = 'Leenkx'
|
||||
lnx_version = 1
|
||||
|
||||
def __init__(self):
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxStringSocket', 'Torrent')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Title')
|
||||
self.add_output('LnxDynamicSocket', 'Files')
|
||||
self.add_output('LnxNodeSocketAction', 'Done')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('Leenkx', icon='ORIENTATION_CURSOR')
|
||||
AddTorrentNode.on_register()
|
31
leenkx/blender/lnx/logicnode/custom/LN_audio_dsp_filter.py
Normal file
31
leenkx/blender/lnx/logicnode/custom/LN_audio_dsp_filter.py
Normal file
@ -0,0 +1,31 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class AudioDSPFilterNode(LnxLogicTreeNode):
|
||||
"""DSP Filter"""
|
||||
bl_idname = 'LNAudioDSPFilterNode'
|
||||
bl_label = 'DSP Filter'
|
||||
bl_description = 'DSP Audio Filter for lowpass/bandpass/highpass '
|
||||
lnx_category = '3D_Audio'
|
||||
lnx_version = 1
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('LowPass', 'LowPass', 'Add a DSP LowPass Filter to the audio'),
|
||||
('BandPass', 'BandPass', 'Add a DSP BandPass Filter to the audio'),
|
||||
('HighPass', 'HighPass', 'Add a DSP HighPass Filter to the audio')],
|
||||
name='', default='LowPass')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'Channel', default_value='master')
|
||||
self.add_input('LnxIntSocket', 'Frequency')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
def register():
|
||||
add_category('3D_Audio', icon='SOUND')
|
||||
AudioDSPFilterNode.on_register()
|
@ -0,0 +1,23 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class AudioDSPHaasEffectNode(LnxLogicTreeNode):
|
||||
"""DSP Haas Effect"""
|
||||
bl_idname = 'LNAudioDSPHaasEffectNode'
|
||||
bl_label = 'DSP Haas Effect'
|
||||
bl_description = 'DSP Audio Haas Effect'
|
||||
lnx_category = '3D_Audio'
|
||||
lnx_version = 1
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'Channel', default_value='master')
|
||||
self.add_input('LnxFloatSocket', 'Delay')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('3D_Audio', icon='SOUND')
|
||||
AudioDSPHaasEffectNode.on_register()
|
39
leenkx/blender/lnx/logicnode/custom/LN_audio_hrtf_panner.py
Normal file
39
leenkx/blender/lnx/logicnode/custom/LN_audio_hrtf_panner.py
Normal file
@ -0,0 +1,39 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class AudioHRTFPannerNode(LnxLogicTreeNode):
|
||||
"""HRTF Panner"""
|
||||
bl_idname = 'LNAudioHRTFPannerNode'
|
||||
bl_label = 'HRTF Panner'
|
||||
bl_description = 'Create 3D audio HRTF Panner'
|
||||
lnx_category = '3D_Audio'
|
||||
lnx_version = 1
|
||||
|
||||
def update_input(self, context):
|
||||
while len(self.inputs) > 5:
|
||||
self.inputs.remove(self.inputs[-1])
|
||||
if self.property0 == 'Custom':
|
||||
self.add_input('LnxStringSocket', 'File Name', default_value=0)
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('Default', 'Default', 'Default .mhr file for HRTF 3D Panner'),
|
||||
('Custom', 'Custom', 'Custom .mhr file for HRTF 3D Panner')],
|
||||
name='', default='Default', update=update_input)
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Audio')
|
||||
self.add_input('LnxNodeSocketObject', 'Cam. Listener')
|
||||
self.add_input('LnxVectorSocket', 'Location')
|
||||
self.add_input('LnxStringSocket', 'Channel', default_value="master")
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Audio')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
def register():
|
||||
add_category('3D_Audio', icon='SOUND')
|
||||
AudioHRTFPannerNode.on_register()
|
43
leenkx/blender/lnx/logicnode/custom/LN_audio_load.py
Normal file
43
leenkx/blender/lnx/logicnode/custom/LN_audio_load.py
Normal file
@ -0,0 +1,43 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class AudioLoadNode(LnxLogicTreeNode):
|
||||
"""Load Audio"""
|
||||
bl_idname = 'LNAudioLoadNode'
|
||||
bl_label = 'Load Audio'
|
||||
bl_description = 'Load audio'
|
||||
lnx_category = '3D_Audio'
|
||||
lnx_version = 1
|
||||
|
||||
def update_input(self, context):
|
||||
while len(self.inputs) > 1:
|
||||
self.inputs.remove(self.inputs[-1])
|
||||
if self.property1 == 'Audio File':
|
||||
self.add_input('LnxStringSocket', 'File Name')
|
||||
|
||||
#property0: HaxePointerProperty('property0', name='', type=bpy.types.Sound)
|
||||
|
||||
property1: HaxeEnumProperty(
|
||||
'property1',
|
||||
items = [#('Sound', 'Sound', 'Sound'),
|
||||
('Audio File', 'Audio File', 'The name of the audio file to load')],
|
||||
name='', default='Audio File'
|
||||
#, update=update_input
|
||||
)
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxStringSocket', 'Channel', default_value='master')
|
||||
self.add_input('LnxStringSocket', 'File Name')
|
||||
self.add_input('LnxBoolSocket', 'Repeat')
|
||||
self.add_output('LnxDynamicSocket', 'Audio')
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property1')
|
||||
#col = layout.column(align=True)
|
||||
#if self.property1 == 'Sound':
|
||||
#col.prop_search(self, 'property0', bpy.data, 'sounds', icon='NONE', text='')
|
||||
|
||||
def register():
|
||||
add_category('3D_Audio', icon='SOUND')
|
||||
AudioLoadNode.on_register()
|
22
leenkx/blender/lnx/logicnode/custom/LN_audio_pause.py
Normal file
22
leenkx/blender/lnx/logicnode/custom/LN_audio_pause.py
Normal file
@ -0,0 +1,22 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class AudioPauseNode(LnxLogicTreeNode):
|
||||
"""Pause Audio"""
|
||||
bl_idname = 'LNAudioPauseNode'
|
||||
bl_label = 'Pause Audio'
|
||||
bl_description = 'Trigger the pause function on audio'
|
||||
lnx_category = '3D_Audio'
|
||||
lnx_version = 1
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Audio')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Audio')
|
||||
|
||||
def register():
|
||||
add_category('3D_Audio', icon='SOUND')
|
||||
AudioPauseNode.on_register()
|
23
leenkx/blender/lnx/logicnode/custom/LN_audio_play.py
Normal file
23
leenkx/blender/lnx/logicnode/custom/LN_audio_play.py
Normal file
@ -0,0 +1,23 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class AudioPlayNode(LnxLogicTreeNode):
|
||||
"""Play Audio"""
|
||||
bl_idname = 'LNAudioPlayNode'
|
||||
bl_label = 'Play Audio'
|
||||
bl_description = 'Trigger the play function on audio'
|
||||
lnx_category = '3D_Audio'
|
||||
lnx_version = 1
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Audio')
|
||||
self.add_input('LnxBoolSocket', 'Re-trigger')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Audio')
|
||||
|
||||
def register():
|
||||
add_category('3D_Audio', icon='SOUND')
|
||||
AudioPlayNode.on_register()
|
@ -0,0 +1,38 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class AudioStereoPannerNode(LnxLogicTreeNode):
|
||||
"""Stereo Panner"""
|
||||
bl_idname = 'LNAudioStereoPannerNode'
|
||||
bl_label = 'Stereo Panner'
|
||||
bl_description = 'Create 2D audio Stereo Panner'
|
||||
lnx_category = '3D_Audio'
|
||||
lnx_version = 1
|
||||
|
||||
def update_input(self, context):
|
||||
while len(self.inputs) > 2:
|
||||
self.inputs.remove(self.inputs[-1])
|
||||
if self.property0 == 'Degrees':
|
||||
self.add_input('LnxIntSocket', 'Degrees', default_value=0)
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('Center', 'Center', 'Center'),
|
||||
('Left', 'Left', 'Left'),
|
||||
('Right', 'Right', 'Right'),
|
||||
('Degrees', 'Degrees', 'Degrees')],
|
||||
name='', default='Center', update=update_input)
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Audio')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Audio')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
def register():
|
||||
add_category('3D_Audio', icon='SOUND')
|
||||
AudioStereoPannerNode.on_register()
|
23
leenkx/blender/lnx/logicnode/custom/LN_audio_stop.py
Normal file
23
leenkx/blender/lnx/logicnode/custom/LN_audio_stop.py
Normal file
@ -0,0 +1,23 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class AudioStopNode(LnxLogicTreeNode):
|
||||
"""Stop Audio"""
|
||||
bl_idname = 'LNAudioStopNode'
|
||||
bl_label = 'Stop Audio'
|
||||
bl_description = 'Trigger the stop function on audio'
|
||||
lnx_category = '3D_Audio'
|
||||
lnx_version = 1
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Audio')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Audio')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('3D_Audio', icon='SOUND')
|
||||
AudioStopNode.on_register()
|
54
leenkx/blender/lnx/logicnode/custom/LN_call_wasm.py
Normal file
54
leenkx/blender/lnx/logicnode/custom/LN_call_wasm.py
Normal file
@ -0,0 +1,54 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class CallWASMNode(LnxLogicTreeNode):
|
||||
"""Call WASM"""
|
||||
bl_idname = 'LNCallWASMNode'
|
||||
bl_label = 'Call WASM'
|
||||
bl_description = 'Call WASM'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
min_inputs = 3
|
||||
|
||||
property1: HaxeBoolProperty(
|
||||
'property1',
|
||||
name="Secure",
|
||||
description="Assignment",
|
||||
default=False,
|
||||
)
|
||||
|
||||
def __init__(self):
|
||||
super(CallWASMNode, self).__init__()
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'WASM')
|
||||
self.add_input('LnxStringSocket', 'Call')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Result')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
#layout.prop(self, 'property1')
|
||||
row = layout.row(align=True)
|
||||
op = row.operator('lnx.node_add_input', text='Add Arg', icon='PLUS', emboss=True)
|
||||
op.node_index = str(id(self))
|
||||
op.socket_type = 'LnxDynamicSocket'
|
||||
op.name_format = "Arg {0}"
|
||||
op.index_name_offset = -2
|
||||
column = row.column(align=True)
|
||||
op = column.operator('lnx.node_remove_input', text='', icon='X', emboss=True)
|
||||
op.node_index = str(id(self))
|
||||
if len(self.inputs) == self.min_inputs:
|
||||
column.enabled = 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)
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
CallWASMNode.on_register()
|
450
leenkx/blender/lnx/logicnode/custom/LN_create_element.py
Normal file
450
leenkx/blender/lnx/logicnode/custom/LN_create_element.py
Normal file
@ -0,0 +1,450 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class CreateElementNode(LnxLogicTreeNode):
|
||||
"""Create Element"""
|
||||
bl_idname = 'LNCreateElementNode'
|
||||
bl_label = 'Create Element'
|
||||
bl_description = 'Create Element'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
data_map = {}
|
||||
@staticmethod
|
||||
def get_enum_id_value(obj, prop_name, value):
|
||||
return obj.bl_rna.properties[prop_name].enum_items[value].identifier
|
||||
|
||||
@staticmethod
|
||||
def get_count_in(type_name):
|
||||
return {
|
||||
'a': 0,
|
||||
'abbr': 1,
|
||||
'address': 2,
|
||||
'area': 3,
|
||||
'article': 4,
|
||||
'aside': 5,
|
||||
'audio': 6,
|
||||
'bold': 7,
|
||||
'base': 8,
|
||||
'bdi': 9,
|
||||
'bdo': 10,
|
||||
'blockquote': 11,
|
||||
'body': 12,
|
||||
'br': 13,
|
||||
'button': 14,
|
||||
'canvas': 15,
|
||||
'caption': 16,
|
||||
'cite': 17,
|
||||
'code': 18,
|
||||
'col': 19,
|
||||
'colgroup': 20,
|
||||
'data': 21,
|
||||
'datalist': 22,
|
||||
'dd': 23,
|
||||
'del': 24,
|
||||
'details': 25,
|
||||
'dfn': 26,
|
||||
'dialog': 27,
|
||||
'div': 28,
|
||||
'dl': 29,
|
||||
'dt': 30,
|
||||
'em': 31,
|
||||
'embed': 32,
|
||||
'fieldset': 33,
|
||||
'figcaption': 34,
|
||||
'figure': 35,
|
||||
'footer': 36,
|
||||
'form': 37,
|
||||
'h1': 38,
|
||||
'h2': 39,
|
||||
'h3': 40,
|
||||
'h4': 41,
|
||||
'h5': 42,
|
||||
'h6': 43,
|
||||
'head': 44,
|
||||
'header': 45,
|
||||
'hgroup': 46,
|
||||
'hr': 47,
|
||||
'html': 48,
|
||||
'i': 49,
|
||||
'iframe': 50,
|
||||
'img': 51,
|
||||
'input': 52,
|
||||
'ins': 53,
|
||||
'kdb': 54,
|
||||
'label': 55,
|
||||
'legend': 56,
|
||||
'li': 57,
|
||||
'link': 58,
|
||||
'main': 59,
|
||||
'map': 60,
|
||||
'mark': 61,
|
||||
'menu': 62,
|
||||
'meta': 63,
|
||||
'meter': 64,
|
||||
'nav': 65,
|
||||
'noscript': 66,
|
||||
'object': 67,
|
||||
'ol': 68,
|
||||
'optgroup': 69,
|
||||
'option': 70,
|
||||
'output': 71,
|
||||
'p': 72,
|
||||
'picture': 73,
|
||||
'pre': 74,
|
||||
'progress': 75,
|
||||
'q': 76,
|
||||
's': 77,
|
||||
'samp': 78,
|
||||
'script': 79,
|
||||
'section': 80,
|
||||
'select': 81,
|
||||
'slot': 82,
|
||||
'small': 83,
|
||||
'source': 84,
|
||||
'span': 85,
|
||||
'strong': 86,
|
||||
'style': 87,
|
||||
'sub': 88,
|
||||
'summary': 89,
|
||||
'sup': 90,
|
||||
'table': 91,
|
||||
'tbody': 92,
|
||||
'td': 93,
|
||||
'template': 94,
|
||||
'textarea': 95,
|
||||
'tfoot': 96,
|
||||
'th': 97,
|
||||
'thead': 98,
|
||||
'time': 99,
|
||||
'title': 100,
|
||||
'tr': 101,
|
||||
'track': 102,
|
||||
'u': 103,
|
||||
'ul': 104,
|
||||
'var': 105,
|
||||
'video': 106,
|
||||
'wbr': 107,
|
||||
'custom': 108
|
||||
}.get(type_name, 72)
|
||||
|
||||
def get_enum(self):
|
||||
return self.get('property0', 72)
|
||||
|
||||
def set_enum(self, value):
|
||||
select_current = self.get_enum_id_value(self, 'property0', value)
|
||||
select_prev = self.property0
|
||||
|
||||
if select_prev != select_current:
|
||||
for i in range(len(self.inputs)):
|
||||
if type(self.inputs[i]) is str:
|
||||
if len(self.inputs[i].default_value_raw) > 0:
|
||||
self.data_map[self.inputs[i].name] = self.inputs[i].default_value_raw
|
||||
else:
|
||||
self.data_map[self.inputs[i].name] = ""
|
||||
else:
|
||||
self.data_map[self.inputs[i].name] = self.inputs[i].default_value_raw
|
||||
|
||||
for i in self.inputs:
|
||||
self.inputs.remove(i)
|
||||
|
||||
index = self.get_count_in(select_current)
|
||||
|
||||
if (index != 44 and index != 48 and index != 63 and index != 100):
|
||||
if (index != 87):
|
||||
self.add_input('LnxStringSocket', 'Content')
|
||||
self.add_input('LnxStringSocket', 'ID')
|
||||
self.add_input('LnxStringSocket', 'Class')
|
||||
self.add_input('LnxStringSocket', 'Style')
|
||||
|
||||
match index:
|
||||
case 0:
|
||||
self.add_input('LnxStringSocket', 'Href', default_value='#')
|
||||
case 3:
|
||||
self.add_input('LnxStringSocket', 'Alt')
|
||||
self.add_input('LnxStringSocket', 'Coords')
|
||||
self.add_input('LnxStringSocket', 'Href')
|
||||
case 6:
|
||||
self.add_input('LnxStringSocket', 'Src')
|
||||
case 11:
|
||||
self.add_input('LnxStringSocket', 'Cite', default_value='URL')
|
||||
case 14:
|
||||
self.add_input('LnxStringSocket', 'Type', default_value='Submit')
|
||||
case 15:
|
||||
self.add_input('LnxStringSocket', 'Height', default_value='150px')
|
||||
self.add_input('LnxStringSocket', 'Width', default_value='300px')
|
||||
case 19 | 20:
|
||||
self.add_input('LnxStringSocket', 'Span')
|
||||
case 21:
|
||||
self.add_input('LnxStringSocket', 'Value')
|
||||
case 24 | 53:
|
||||
self.add_input('LnxStringSocket', 'Cite', default_value='URL')
|
||||
self.add_input('LnxStringSocket', 'Datetime', default_value='YYYY-MM-DDThh:mm:ssTZD')
|
||||
case 26:
|
||||
self.add_input('LnxStringSocket', 'Title')
|
||||
case 32:
|
||||
self.add_input('LnxStringSocket', 'Src', default_value='URL')
|
||||
self.add_input('LnxStringSocket', 'Type')
|
||||
self.add_input('LnxStringSocket', 'Height')
|
||||
self.add_input('LnxStringSocket', 'Width')
|
||||
case 33:
|
||||
self.add_input('LnxStringSocket', 'Form')
|
||||
self.add_input('LnxStringSocket', 'Name')
|
||||
case 37:
|
||||
self.add_input('LnxStringSocket', 'Action', default_value='URL')
|
||||
self.add_input('LnxStringSocket', 'Method', default_value='get')
|
||||
case 44:
|
||||
self.add_input('LnxStringSocket', 'Profile', default_value='URI')
|
||||
case 48:
|
||||
self.add_input('LnxBoolSocket', 'xmlns' , default_value=False )
|
||||
case 50:
|
||||
self.add_input('LnxStringSocket', 'Src', default_value='URL')
|
||||
self.add_input('LnxStringSocket', 'Height' , default_value="150px" )
|
||||
self.add_input('LnxStringSocket', 'Width', default_value='300px')
|
||||
case 51:
|
||||
self.add_input('LnxStringSocket', 'Src')
|
||||
self.add_input('LnxStringSocket', 'Height' , default_value='150px')
|
||||
self.add_input('LnxStringSocket', 'Width', default_value='150px')
|
||||
case 52:
|
||||
self.add_input('LnxStringSocket', 'Type', default_value='text')
|
||||
self.add_input('LnxStringSocket', 'Value')
|
||||
case 55:
|
||||
self.add_input('LnxStringSocket', 'For', default_value='element_id')
|
||||
self.add_input('LnxStringSocket', 'Form', default_value='form_id')
|
||||
case 57:
|
||||
self.add_input('LnxStringSocket', 'Value')
|
||||
case 58:
|
||||
self.add_input('LnxStringSocket', 'Href', default_value='#')
|
||||
self.add_input('LnxStringSocket', 'Hreflang', default_value='en')
|
||||
self.add_input('LnxStringSocket', 'Title')
|
||||
case 58:
|
||||
self.add_input('LnxStringSocket', 'Name', default_value='mapname')
|
||||
case 63:
|
||||
self.add_input('LnxStringSocket', 'Charset', default_value='character_set')
|
||||
self.add_input('LnxStringSocket', 'Content', default_value='text')
|
||||
case 64:
|
||||
self.add_input('LnxStringSocket', 'form', default_value='form_id')
|
||||
self.add_input('LnxStringSocket', 'high')
|
||||
self.add_input('LnxStringSocket', 'low')
|
||||
self.add_input('LnxStringSocket', 'max')
|
||||
self.add_input('LnxStringSocket', 'min')
|
||||
self.add_input('LnxStringSocket', 'optimum')
|
||||
self.add_input('LnxStringSocket', 'value')
|
||||
case 67:
|
||||
self.add_input('LnxStringSocket', 'data', default_value='URL')
|
||||
self.add_input('LnxStringSocket', 'form', default_value='form_id')
|
||||
self.add_input('LnxStringSocket', 'height', default_value='pixels')
|
||||
self.add_input('LnxStringSocket', 'name', default_value='name')
|
||||
self.add_input('LnxStringSocket', 'type', default_value='media_type')
|
||||
self.add_input('LnxStringSocket', 'usemap', default_value='#mapname')
|
||||
self.add_input('LnxStringSocket', 'width', default_value='pixels')
|
||||
case 68:
|
||||
self.add_input('LnxStringSocket', 'start', default_value='number')
|
||||
case 69:
|
||||
self.add_input('LnxStringSocket', 'label', default_value='text')
|
||||
case 70:
|
||||
self.add_input('LnxStringSocket', 'label', default_value='text')
|
||||
self.add_input('LnxStringSocket', 'value', default_value='value')
|
||||
case 71:
|
||||
self.add_input('LnxStringSocket', 'for', default_value='element_id')
|
||||
self.add_input('LnxStringSocket', 'form', default_value='form_id')
|
||||
self.add_input('LnxStringSocket', 'name', default_value='name')
|
||||
case 75:
|
||||
self.add_input('LnxStringSocket', 'max', default_value='number')
|
||||
self.add_input('LnxStringSocket', 'value', default_value='number')
|
||||
case 76:
|
||||
self.add_input('LnxStringSocket', 'cite', default_value='URL')
|
||||
case 78:
|
||||
self.add_input('LnxStringSocket', 'cite', default_value='URL')
|
||||
case 79:
|
||||
self.add_input('LnxStringSocket', 'integrity' , default_value='filehash')
|
||||
self.add_input('LnxStringSocket', 'Src')
|
||||
self.add_input('LnxStringSocket', 'type', default_value='scripttype')
|
||||
case 81:
|
||||
self.add_input('LnxStringSocket', 'form' , default_value='form_id')
|
||||
self.add_input('LnxStringSocket', 'name' , default_value='text')
|
||||
self.add_input('LnxStringSocket', 'type', default_value='scripttype')
|
||||
self.add_input('LnxStringSocket', 'size', default_value='number')
|
||||
case 84:
|
||||
self.add_input('LnxStringSocket', 'size')
|
||||
self.add_input('LnxStringSocket', 'src' , default_value='URL')
|
||||
self.add_input('LnxStringSocket', 'srcset', default_value='URL')
|
||||
case 87:
|
||||
self.add_input('LnxStringSocket', 'type', default_value='media_type')
|
||||
case 93:
|
||||
self.add_input('LnxStringSocket', 'colspan' , default_value='number')
|
||||
self.add_input('LnxStringSocket', 'headers' , default_value='header_id')
|
||||
self.add_input('LnxStringSocket', 'rowspan', default_value='number')
|
||||
case 95:
|
||||
self.add_input('LnxStringSocket', 'cols' , default_value='number')
|
||||
self.add_input('LnxStringSocket', 'dirname' , default_value='name.dir')
|
||||
self.add_input('LnxStringSocket', 'rowspan', default_value='number')
|
||||
self.add_input('LnxStringSocket', 'form', default_value='form_id')
|
||||
self.add_input('LnxStringSocket', 'maxlength', default_value='number')
|
||||
self.add_input('LnxStringSocket', 'name' , default_value='text')
|
||||
self.add_input('LnxStringSocket', 'placeholder' , default_value='text')
|
||||
self.add_input('LnxStringSocket', 'rows' , default_value='number')
|
||||
case 97:
|
||||
self.add_input('LnxStringSocket', 'abbr' , default_value='text')
|
||||
self.add_input('LnxStringSocket', 'colspan' , default_value='number')
|
||||
self.add_input('LnxStringSocket', 'headers', default_value='header_id')
|
||||
self.add_input('LnxStringSocket', 'rowspan', default_value='number')
|
||||
case 99:
|
||||
self.add_input('LnxStringSocket', 'Datetime', default_value='YYYY-MM-DDThh:mm:ssTZD')
|
||||
case 102:
|
||||
self.add_input('LnxStringSocket', 'Src', default_value='URL')
|
||||
self.add_input('LnxStringSocket', 'srclang', default_value='en')
|
||||
self.add_input('LnxStringSocket', 'label', default_value='text')
|
||||
case 106:
|
||||
self.add_input('LnxStringSocket', 'Src', default_value='URL')
|
||||
self.add_input('LnxStringSocket', 'width', default_value='pixels')
|
||||
self.add_input('LnxStringSocket', 'height', default_value='pixels')
|
||||
self.add_input('LnxStringSocket', 'poster', default_value='URL')
|
||||
|
||||
for i in range(len(self.inputs)):
|
||||
if self.inputs[i].name in self.data_map:
|
||||
self.inputs[i].default_value_raw = self.data_map[self.inputs[i].name]
|
||||
|
||||
self['property0'] = value
|
||||
self.data_map = {}
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('a', 'A', '<a>: The Anchor element'),
|
||||
('abbr', 'Abbr', '<abbr>: The Abbreviation element'),
|
||||
('address', 'Address', '<address>: The Contact Address element'),
|
||||
('area', 'Area', '<area>: The Image Map Area element'),
|
||||
('article', 'Article', '<article>: The Article Contents element'),
|
||||
('aside', 'Aside', '<aside>: The Aside element'),
|
||||
('audio', 'Audio', '<audio>: The Embed Audio element'),
|
||||
('bold', 'Bold', '<b>: The Bring Bold Attention To element'),
|
||||
('base', 'Base', '<base>: The Document Base URL element'),
|
||||
('bdi', 'Bdi', '<bdi>: The Bidirectional Isolate element'),
|
||||
('bdo', 'Bdo', '<bdo>: The Bidirectional Text Override element'),
|
||||
('blockquote', 'Blockquote', '<blockquote>: The Block Quotation element'),
|
||||
('body', 'Body', '<body>: The Document Body element'),
|
||||
('br', 'Br', '<br>: The Line Break element'),
|
||||
('button', 'Button', '<button>: The Button element'),
|
||||
('canvas', 'Canvas', '<canvas>: The Graphics Canvas element'),
|
||||
('caption', 'Caption', '<caption>: The Table Caption element'),
|
||||
('cite', 'Cite', '<cite>: The Citation element'),
|
||||
('code', 'Code', '<code>: The Inline Code element'),
|
||||
('col', 'Col', '<col>: The Table Column element'),
|
||||
('colgroup', 'Colgroup', '<colgroup>: The Table Column Group element'),
|
||||
('data', 'Data', '<data>: The Data element'),
|
||||
('datalist', 'Datalist', '<datalist>: The HTML Data List element'),
|
||||
('dd', 'Dd', '<dd>: The Description Details element'),
|
||||
('del', 'Del', '<del>: The Deleted Text element'),
|
||||
('details', 'Details', '<details>: The Details disclosure element'),
|
||||
('dfn', 'Dfn', '<dfn>: The Definition element'),
|
||||
('dialog', 'Dialog', '<dialog>: The Dialog element'),
|
||||
('div', 'Div', '<div>: The Content Division / Divider element'),
|
||||
('dl', 'Dl', '<dl>: The Description List element'),
|
||||
('dt', 'Dt', '<dt>: The Description Term element'),
|
||||
('em', 'Em', '<em>: The Emphasis element'),
|
||||
('embed', 'Embed', '<embed>: The Embed External Content element'),
|
||||
('fieldset', 'Fieldset', '<fieldset>: The Field Set element'),
|
||||
('figcaption', 'Figcaption', '<figcaption>: The Figure Caption element'),
|
||||
('figure', 'Figure', '<figure>: The Figure with Optional Caption element'),
|
||||
('footer', 'Footer', '<footer>: The Footer Element'),
|
||||
('form', 'Form', '<form>: The Form element'),
|
||||
('h1', 'H1', '<h1>: The Size 1 Heading'),
|
||||
('h2', 'H2', '<h2>: The Size 2 Heading'),
|
||||
('h3', 'H3', '<h3>: The Size 3 Heading'),
|
||||
('h4', 'H4', '<h4>: The Size 4 Heading'),
|
||||
('h5', 'H5', '<h5>: The Size 5 Heading'),
|
||||
('h6', 'H6', '<h6>: The Size 6 Heading'),
|
||||
('head', 'Head', '<head>: The Document Metadata (Head) element'),
|
||||
('header', 'Header', '<header>: The Header element'),
|
||||
('hgroup', 'Hgroup', '<hgroup>: The Header element'),
|
||||
('hr', 'Hr', '<hr>: The Thematic Break (Horizontal Rule) element'),
|
||||
('html', 'Html', '<html>: The HTML Document / Root element'),
|
||||
('i', 'I', '<i>: The Idiomatic Text element'),
|
||||
('iframe', 'Iframe', '<iframe>: The Inline Frame element'),#51
|
||||
('img', 'Img', '<img>: The Image Embed element'),
|
||||
('input', 'Input', '<input>: The Input (Form Input) element'),
|
||||
('ins', 'Ins', '<ins>: The Inserted Text Element'),
|
||||
('kbd', 'Kbd', '<kbd>: The Keyboard Input element'),
|
||||
('label', 'Label', '<label>: The Label element'),
|
||||
('legend', 'Legend', '<legend>: The Field Set Legend element'),
|
||||
('li', 'Li', '<li>: The List Item element'),
|
||||
('link', 'Link', '<link>: The External Resource Link element'),#59
|
||||
('main', 'Main', '<main>: The Main Body element'),
|
||||
('map', 'Map', '<map>: The Image Map element'),
|
||||
('mark', 'Mark', '<mark>: The Mark Text element'),
|
||||
('menu', 'Menu', '<menu>: The Menu element'),
|
||||
('meta', 'Meta', '<meta>: The metadata element'),
|
||||
('meter', 'Meter', '<meter>: The HTML Meter element'),
|
||||
('nav', 'Nav', '<nav>: The Navigation Section element'),
|
||||
('noscript', 'Noscript', '<noscript>: The Noscript element'),
|
||||
('object', 'Object', '<object>: The External Object element'),
|
||||
('ol', 'Ol', '<ol>: The Ordered List element'),
|
||||
('optgroup', 'Optgroup', '<optgroup>: The Option Group element'),
|
||||
('option', 'Option', '<option>: The HTML Option element'),
|
||||
('output', 'Output', '<output>: The Output element'),
|
||||
('p', 'P', '<p>: The Paragraph element'),
|
||||
('picture', 'Picture', '<picture>: The Picture element'),
|
||||
('pre', 'Pre', '<pre>: The Preformatted Text element'),
|
||||
('progress', 'Progress', '<progress>: The Progress Indicator element'),
|
||||
('q', 'Q', '<q>: The Inline Quotation element'),
|
||||
('s', 'S', '<s>: The Strikethrough element'),
|
||||
('sample', 'Sample', '<samp>: The Sample Output element'),
|
||||
('script', 'Script', '<script>: The Script element'), #68
|
||||
('section', 'Section', '<section>: The Generic Section element'),
|
||||
('select', 'Select', '<select>: The HTML Select element'),
|
||||
('slot', 'Slot', '<slot>: The Web Component Slot element'),
|
||||
('small', 'Small', '<small>: The Small Side Comment element'),
|
||||
('source', 'Source', '<source>: The Media or Image Source element'),
|
||||
('span', 'Span', '<span>: The Content Span element'),
|
||||
('strong', 'Strong', '<strong>: The Strong Importance element'),
|
||||
('style', 'Style', '<style>: The Style Information element'),
|
||||
('sub', 'Sub', '<sub>: The Subscript element'),
|
||||
('summary', 'Summary', '<summary>: The Disclosure Summary element'),
|
||||
('sup', 'Sup', '<sup>: The Superscript element'),
|
||||
('table', 'Table', '<table>: The Table element'),
|
||||
('tbody', 'Tbody', '<tbody>: The Table Body element'),
|
||||
('td', 'Td', '<td>: The Table Data Cell element'),
|
||||
('template', 'Template', '<template>: The Content Template element'),
|
||||
('textarea', 'Textarea', '<textarea>: The Textarea element'),
|
||||
('tfoot', 'Tfoot', '<tfoot>: The Table Foot element'),
|
||||
('th', 'Th', '<th>: The Table Header element'),
|
||||
('thead', 'Thead', '<thead>: The Table Head element'),
|
||||
('time', 'Time', '<time>: The (Date) Time element'),
|
||||
('title', 'Title', '<title>: The Document Title element'),
|
||||
('tr', 'Tr', '<tr>: The Table Row element'),
|
||||
('track', 'Track', '<track>: The Embed Text Track element'),
|
||||
('u', 'U', '<u>: The Unarticulated Annotation (Underline) element'),
|
||||
('ul', 'Ul', '<ul>: The Unordered List element'),
|
||||
('var', 'Var', '<var>: The Variable element'),
|
||||
('video', 'Video', '<video>: The Video Embed element'),
|
||||
('wbr', 'Wbr', '<wbr>: The Line Break Opportunity element'),
|
||||
('custom', 'Custom', '<*/Custom*/>: The Output element')],
|
||||
name='',
|
||||
default='p',
|
||||
set=set_enum,
|
||||
get=get_enum)
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxStringSocket', 'Content')
|
||||
self.add_input('LnxStringSocket', 'ID')
|
||||
self.add_input('LnxStringSocket', 'Class')
|
||||
self.add_input('LnxStringSocket', 'Style')
|
||||
|
||||
|
||||
self.add_output('LnxDynamicSocket', 'Element')
|
||||
self.add_output('LnxStringSocket', 'HTML')
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
|
||||
def draw_label(self) -> str:
|
||||
context = self.inputs[0].get_default_value()
|
||||
if len(context) > 0:
|
||||
return f'<{self.property0}> {context} </{self.property0}>'
|
||||
return f'Create <{self.property0}>'
|
||||
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
CreateElementNode.on_register()
|
25
leenkx/blender/lnx/logicnode/custom/LN_create_leenkx.py
Normal file
25
leenkx/blender/lnx/logicnode/custom/LN_create_leenkx.py
Normal file
@ -0,0 +1,25 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class CreateLeenkxNode(LnxLogicTreeNode):
|
||||
"""Create Leenkx"""
|
||||
bl_idname = 'LNCreateLeenkxNode'
|
||||
bl_label = 'Create Leenkx'
|
||||
bl_description = 'Create Leenkx'
|
||||
lnx_category = 'Leenkx'
|
||||
lnx_version = 1
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'Url', default_value="8001")
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Connection')
|
||||
self.add_output('LnxDynamicSocket', 'ID')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('Leenkx', icon='ORIENTATION_CURSOR')
|
||||
CreateLeenkxNode.on_register()
|
||||
|
||||
|
451
leenkx/blender/lnx/logicnode/custom/LN_create_style.py
Normal file
451
leenkx/blender/lnx/logicnode/custom/LN_create_style.py
Normal file
@ -0,0 +1,451 @@
|
||||
import array
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class CreateStyleNode(LnxLogicTreeNode):
|
||||
"""Create Style"""
|
||||
bl_idname = 'LNCreateStyleNode'
|
||||
bl_label = 'Create Style'
|
||||
bl_description = 'Create Style'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
min_inputs = 1
|
||||
|
||||
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_enum_id_value(obj, prop_name, value):
|
||||
return obj.bl_rna.properties[prop_name].enum_items[value].identifier
|
||||
|
||||
@staticmethod
|
||||
def get_count_in(type_name):
|
||||
return {
|
||||
'align-content': 0,
|
||||
'align-items': 1,
|
||||
'align-self': 2,
|
||||
'animation-delay': 3,
|
||||
'animation-direction': 4,
|
||||
'animation-duration': 5,
|
||||
'animation-fill-mode': 6,
|
||||
'animation-iteration-count': 7,
|
||||
'animation-name': 8,
|
||||
'animation-play-state': 9,
|
||||
'animation-timing-function': 10,
|
||||
'backface-visibility': 11,
|
||||
'background': 12,
|
||||
'background-attachment': 13,
|
||||
'background-clip': 14,
|
||||
'background-color': 15,
|
||||
'background-image': 16,
|
||||
'background-origin': 17,
|
||||
'background-position': 18,
|
||||
'background-repeat': 19,
|
||||
'background-size': 20,
|
||||
'border': 21,
|
||||
'border-bottom': 22,
|
||||
'border-bottom-color': 23,
|
||||
'border-bottom-left-radius': 24,
|
||||
'border-bottom-right-radius': 25,
|
||||
'border-bottom-style': 26,
|
||||
'border-bottom-width': 27,
|
||||
'border-collapse': 28,
|
||||
'border-color': 29,
|
||||
'border-image': 30,
|
||||
'border-image-outset': 31,
|
||||
'border-image-repeat': 32,
|
||||
'border-image-slice': 33,
|
||||
'border-image-source': 34,
|
||||
'border-image-width': 35,
|
||||
'border-left': 36,
|
||||
'border-left-color': 37,
|
||||
'border-left-style': 38,
|
||||
'border-left-width': 39,
|
||||
'border-radius': 40,
|
||||
'border-right': 41,
|
||||
'border-right-color': 42,
|
||||
'border-right-style': 43,
|
||||
'border-right-width': 44,
|
||||
'border-spacing': 45,
|
||||
'border-style': 46,
|
||||
'border-top': 47,
|
||||
'border-top-color': 48,
|
||||
'border-top-left-radius': 49,
|
||||
'border-top-right-radius': 50,
|
||||
'border-top-style': 51,
|
||||
'border-top-width': 52,
|
||||
'border-width': 53,
|
||||
'bottom': 54,
|
||||
'box-shadow': 55,
|
||||
'box-sizing': 56,
|
||||
'caption-side': 57,
|
||||
'clear': 58,
|
||||
'clip': 59,
|
||||
'color': 60,
|
||||
'column-count': 61,
|
||||
'column-fill': 62,
|
||||
'column-gap': 63,
|
||||
'column-rule': 64,
|
||||
'column-rule-color': 65,
|
||||
'column-rule-style': 66,
|
||||
'column-rule-width': 67,
|
||||
'column-span': 68,
|
||||
'column-width': 69,
|
||||
'columns': 70,
|
||||
'content': 71,
|
||||
'counter-increment': 72,
|
||||
'counter-reset': 73,
|
||||
'cursor': 74,
|
||||
'direction': 75,
|
||||
'display': 76,
|
||||
'empty-cells': 77,
|
||||
'flex': 78,
|
||||
'flex-basis': 79,
|
||||
'flex-direction': 80,
|
||||
'flex-flow': 81,
|
||||
'flex-grow': 82,
|
||||
'flex-shrink': 83,
|
||||
'flex-wrap': 84,
|
||||
'float': 85,
|
||||
'font': 86,
|
||||
'font-family': 87,
|
||||
'font-size': 88,
|
||||
'font-size-adjust': 89,
|
||||
'font-stretch': 90,
|
||||
'font-style': 91,
|
||||
'font-variant': 92,
|
||||
'font-weight': 93,
|
||||
'height': 94,
|
||||
'justify-content': 95,
|
||||
'left': 96,
|
||||
'letter-spacing': 97,
|
||||
'line-height': 98,
|
||||
'list-style': 99,
|
||||
'list-style-image': 100,
|
||||
'list-style-position': 101,
|
||||
'list-style-type': 102,
|
||||
'margin': 103,
|
||||
'margin-bottom': 104,
|
||||
'margin-left': 105,
|
||||
'margin-right': 106,
|
||||
'margin-top': 107,
|
||||
'max-height': 108,
|
||||
'max-width': 109,
|
||||
'min-height': 110,
|
||||
'min-width': 111,
|
||||
'opacity': 112,
|
||||
'order': 113,
|
||||
'outline': 114,
|
||||
'outline-color': 115,
|
||||
'outline-offset': 116,
|
||||
'outline-style': 117,
|
||||
'outline-width': 118,
|
||||
'overflow': 119,
|
||||
'overflow-x': 120,
|
||||
'overflow-y': 121,
|
||||
'padding': 122,
|
||||
'padding-bottom': 123,
|
||||
'padding-left': 124,
|
||||
'padding-right': 125,
|
||||
'padding-top': 126,
|
||||
'page-break-after': 127,
|
||||
'page-break-before': 128,
|
||||
'page-break-inside': 129,
|
||||
'perspective': 130,
|
||||
'perspective-origin': 131,
|
||||
'position': 132,
|
||||
'quotes': 133,
|
||||
'resize': 134,
|
||||
'right': 135,
|
||||
'tab-size': 136,
|
||||
'table-layout': 137,
|
||||
'text-align': 138,
|
||||
'text-align-last': 139,
|
||||
'text-decoration': 140,
|
||||
'text-decoration-color': 141,
|
||||
'text-decoration-line': 142,
|
||||
'text-decoration-style': 143,
|
||||
'text-indent': 144,
|
||||
'text-justify': 145,
|
||||
'text-overflow': 146,
|
||||
'text-shadow': 147,
|
||||
'text-transform': 148,
|
||||
'top': 149,
|
||||
'transform': 150,
|
||||
'transform-origin': 151,
|
||||
'transform-style': 152,
|
||||
'transition': 153,
|
||||
'transition-delay': 154,
|
||||
'transition-duration': 155,
|
||||
'transition-property': 156,
|
||||
'transition-timing-function': 157,
|
||||
'vertical-align': 158,
|
||||
'visibility': 159,
|
||||
'white-space': 160,
|
||||
'width': 161,
|
||||
'word-break': 162,
|
||||
'word-spacing': 163,
|
||||
'word-wrap': 164,
|
||||
'z-index': 165
|
||||
}.get(type_name, 60)
|
||||
|
||||
def get_enum(self):
|
||||
ind = 0
|
||||
properties = ''
|
||||
for i in self.inputs:
|
||||
if ind != 0:
|
||||
properties += self.inputs[ind].name + ':'
|
||||
ind += 1
|
||||
|
||||
self['property1'] = properties
|
||||
|
||||
return self.get('property0', 60)
|
||||
|
||||
def set_enum(self, value):
|
||||
select_current = self.get_enum_id_value(self, 'property0', value)
|
||||
select_prev = self.property0
|
||||
|
||||
if select_prev != select_current:
|
||||
self.add_input('LnxStringSocket', select_current)
|
||||
|
||||
self['property0'] = value
|
||||
|
||||
ind = 0
|
||||
properties = ''
|
||||
for i in self.inputs:
|
||||
if ind != 0:
|
||||
properties += self.inputs[ind].name + ':'
|
||||
ind += 1
|
||||
|
||||
self['property1'] = properties
|
||||
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('align-content', 'align-content', 'Align Content'),
|
||||
('align-items', 'align-items', 'Align Items'),
|
||||
('align-self', 'align-self', 'Align Self'),
|
||||
('animation-delay', 'animation-delay', 'Animation Delay'),
|
||||
('animation-direction', 'animation-direction', 'Animation Direction'),
|
||||
('animation-duration', 'animation-duration', 'Animation Duration'),
|
||||
('animation-fill-mode', 'animation-fill-mode', 'Animation Fill Mode'),
|
||||
('animation-iteration-count', 'animation-iteration-count', 'Animation Iteration Count'),
|
||||
('animation-name', 'animation-name', 'Animation Name'),
|
||||
('animation-play-state', 'animation-play-state', 'Animation Play State'),
|
||||
('animation-timing-function', 'animation-timing-function', 'Animation Timing Function'),
|
||||
('backface-visibility', 'backface-visibility', 'Backface Visibility'),
|
||||
('background', 'background', 'Background'),
|
||||
('background-attachment', 'background-attachment', 'Background Attachment'),
|
||||
('background-clip', 'background-clip', 'Background Clip'),
|
||||
('background-color', 'background-color', 'Background Color'),
|
||||
('background-image', 'background-image', 'Background Image'),
|
||||
('background-origin', 'background-origin', 'Background Origin'),
|
||||
('background-position', 'background-position', 'Background Position'),
|
||||
('background-repeat', 'background-repeat', 'Background Repeat'),
|
||||
('background-size', 'background-size', 'Background Size'),
|
||||
('border', 'border', 'Border'),
|
||||
('border-bottom', 'border-bottom', 'Border Bottom'),
|
||||
('border-bottom-color', 'border-bottom-color', 'Border Bottom Color'),
|
||||
('border-bottom-left-radius', 'border-bottom-left-radius', 'Border Bottom Left Radius'),
|
||||
('border-bottom-right-radius', 'border-bottom-right-radius', 'Border Bottom Right Radius'),
|
||||
('border-bottom-style', 'border-bottom-style', 'Border Bottom Style'),
|
||||
('border-bottom-width', 'border-bottom-width', 'Border Bottom Width'),
|
||||
('border-collapse', 'border-collapse', 'Border Collapse'),
|
||||
('border-color', 'border-color', 'Border Color'),
|
||||
('border-image', 'border-image', 'Border Image'),
|
||||
('border-image-outset', 'border-image-outset', 'Border Image Outset'),
|
||||
('border-image-repeat', 'border-image-repeat', 'Border Image Repeat'),
|
||||
('border-image-slice', 'border-image-slice', 'Border Image Slice'),
|
||||
('border-image-source', 'border-image-source', 'Border Image Source'),
|
||||
('border-image-width', 'border-image-width', 'Border Image Width'),
|
||||
('border-left', 'border-left', 'Border Left'),
|
||||
('border-left-color', 'border-left-color', 'Border Left Color'),
|
||||
('border-left-style', 'border-left-style', 'Border Left Style'),
|
||||
('border-left-width', 'border-left-width', 'Border Left Width'),
|
||||
('border-radius', 'border-radius', 'Border Radius'),
|
||||
('border-right', 'border-right', 'Border Right'),
|
||||
('border-right-color', 'border-right-color', 'Border Right Color'),
|
||||
('border-right-style', 'border-right-style', 'Border Right Style'),
|
||||
('border-right-width', 'border-right-width', 'Border Right Width'),
|
||||
('border-spacing', 'border-spacing', 'Border Spacing'),
|
||||
('border-style', 'border-style', 'Border Style'),
|
||||
('border-top', 'border-top', 'Border Top'),
|
||||
('border-top-color', 'border-top-color', 'Border Top Color'),
|
||||
('border-top-left-radius', 'border-top-left-radius', 'Border Top Left Radius'),
|
||||
('border-top-right-radius', 'border-top-right-radius', 'Border Top Right Radius'),
|
||||
('border-top-style', 'border-top-style', 'Border Top Style'),
|
||||
('border-top-width', 'border-top-width', 'Border Top Width'),
|
||||
('border-width', 'border-width', 'Border Width'),
|
||||
('bottom', 'bottom', 'Bottom'),
|
||||
('box-shadow', 'box-shadow', 'Box Shadow'),
|
||||
('box-sizing', 'box-sizing', 'Box Sizing'),
|
||||
('caption-side', 'caption-side', 'Caption Side'),
|
||||
('clear', 'clear', 'Clear'),
|
||||
('clip', 'clip', 'Clip'),
|
||||
('color', 'color', 'Color'),
|
||||
('column-count', 'column-count', 'Column Count'),
|
||||
('column-fill', 'column-fill', 'Column Fill'),
|
||||
('column-gap', 'column-gap', 'Column Gap'),
|
||||
('column-rule', 'column-rule', 'Column Rule'),
|
||||
('column-rule-color', 'column-rule-color', 'Column Rule Color'),
|
||||
('column-rule-style', 'column-rule-style', 'Column Rule Style'),
|
||||
('column-rule-width', 'column-rule-width', 'Column Rule Width'),
|
||||
('column-span', 'column-span', 'Column Span'),
|
||||
('column-width', 'column-width', 'Column Width'),
|
||||
('columns', 'columns', 'Columns'),
|
||||
('content', 'content', 'Content'),
|
||||
('counter-increment', 'counter-increment', 'Counter Increment'),
|
||||
('counter-reset', 'counter-reset', 'Counter Reset'),
|
||||
('cursor', 'cursor', 'Cursor'),
|
||||
('direction', 'direction', 'Direction'),
|
||||
('display', 'display', 'Display'),
|
||||
('empty-cells', 'empty-cells', 'Empty Cells'),
|
||||
('flex', 'flex', 'Flex'),
|
||||
('flex-basis', 'flex-basis', 'Flex Basis'),
|
||||
('flex-direction', 'flex-direction', 'Flex Direction'),
|
||||
('flex-flow', 'flex-flow', 'Flex Flow'),
|
||||
('flex-grow', 'flex-grow', 'Flex Grow'),
|
||||
('flex-shrink', 'flex-shrink', 'Flex Shrink'),
|
||||
('flex-wrap', 'flex-wrap', 'Flex Wrap'),
|
||||
('float', 'float', 'Float'),
|
||||
('font', 'font', 'Font'),
|
||||
('font-family', 'font-family', 'Font Family'),
|
||||
('font-size', 'font-size', 'Font Size'),
|
||||
('font-size-adjust', 'font-size-adjust', 'Font Size Adjust'),
|
||||
('font-stretch', 'font-stretch', 'Font Stretch'),
|
||||
('font-style', 'font-style', 'Font Style'),
|
||||
('font-variant', 'font-variant', 'Font Variant'),
|
||||
('font-weight', 'font-weight', 'Font Weight'),
|
||||
('height', 'height', 'Height'),
|
||||
('justify-content', 'justify-content', 'Justify Content'),
|
||||
('left', 'left', 'Left'),
|
||||
('letter-spacing', 'letter-spacing', 'Letter Spacing'),
|
||||
('line-height', 'line-height', 'Line Height'),
|
||||
('list-style', 'list-style', 'List Style'),
|
||||
('list-style-image', 'list-style-image', 'List Style Image'),
|
||||
('list-style-position', 'list-style-position', 'List Style Position'),
|
||||
('list-style-type', 'list-style-type', 'List Style Type'),
|
||||
('margin', 'margin', 'Margin'),
|
||||
('margin-bottom', 'margin-bottom', 'Margin Bottom'),
|
||||
('margin-left', 'margin-left', 'Margin Left'),
|
||||
('margin-right', 'margin-right', 'Margin Right'),
|
||||
('margin-top', 'margin-top', 'Margin Top'),
|
||||
('max-height', 'max-height', 'Max Height'),
|
||||
('max-width', 'max-width', 'Max Width'),
|
||||
('min-height', 'min-height', 'Min Height'),
|
||||
('min-width', 'min-width', 'Min Width'),
|
||||
('opacity', 'opacity', 'Opacity'),
|
||||
('order', 'order', 'Order'),
|
||||
('outline', 'outline', 'Outline'),
|
||||
('outline-color', 'outline-color', 'Outline Color'),
|
||||
('outline-offset', 'outline-offset', 'Outline Offset'),
|
||||
('outline-style', 'outline-style', 'Outline Style'),
|
||||
('outline-width', 'outline-width', 'Outline Sidth'),
|
||||
('overflow', 'overflow', 'Overflow'),
|
||||
('overflow-x', 'overflow-x', 'Overflow X'),
|
||||
('overflow-y', 'overflow-y', 'Overflow Y'),
|
||||
('padding', 'padding', 'Padding'),
|
||||
('padding-bottom', 'padding-bottom', 'Padding Bottom'),
|
||||
('padding-left', 'padding-left', 'Padding Left'),
|
||||
('padding-right', 'padding-right', 'Padding Right'),
|
||||
('padding-top', 'padding-top', 'Padding Top'),
|
||||
('page-break-after', 'page-break-after', 'Page Break After'),
|
||||
('page-break-before', 'page-break-before', 'Page Break Before'),
|
||||
('page-break-inside', 'page-break-inside', 'Page Break Inside'),
|
||||
('perspective', 'perspective', 'Perspective'),
|
||||
('perspective-origin', 'perspective-origin', 'Perspective Origin'),
|
||||
('position', 'position', 'Position'),
|
||||
('quotes', 'quotes', 'Quotes'),
|
||||
('resize', 'resize', 'Resize'),
|
||||
('right', 'right', 'Right'),
|
||||
('tab-size', 'tab-size', 'Tab Size'),
|
||||
('table-layout', 'table-layout', 'Table Layout'),
|
||||
('text-align', 'text-align', 'Text Align'),
|
||||
('text-align-last', 'text-align-last', 'Text Align Last'),
|
||||
('text-decoration', 'text-decoration', 'Text Decoration'),
|
||||
('text-decoration-color', 'text-decoration-color', 'Text Decoration Color'),
|
||||
('text-decoration-line', 'text-decoration-line', 'Text Decoration Line'),
|
||||
('text-decoration-style', 'text-decoration-style', 'Text Decoration Style'),
|
||||
('text-indent', 'text-indent', 'Text Indent'),
|
||||
('text-justify', 'text-justify', 'Text Justify'),
|
||||
('text-overflow', 'text-overflow', 'Text Overflow'),
|
||||
('text-shadow', 'text-shadow', 'Text Shadow'),
|
||||
('text-transform', 'text-transform', 'Text Transform'),
|
||||
('top', 'top', 'Top'),
|
||||
('transform', 'transform', 'Transform'),
|
||||
('transform-origin', 'transform-origin', 'Transform Origin'),
|
||||
('transform-style', 'transform-style', 'Transform Style'),
|
||||
('transition', 'transition', 'Transition'),
|
||||
('transition-delay', 'transition-delay', 'Transition Delay'),
|
||||
('transition-duration', 'transition-duration', 'Transition Duration'),
|
||||
('transition-property', 'transition-property', 'Transition Property'),
|
||||
('transition-timing-function', 'transition-timing-function', 'Transition Timing Function'),
|
||||
('vertical-align', 'vertical-align', 'Vertical Align'),
|
||||
('visibility', 'visibility', 'Visibility'),
|
||||
('white-space', 'white-space', 'White Space'),
|
||||
('width', 'width', 'Width'),
|
||||
('word-break', 'word-break', 'Word Break'),
|
||||
('word-spacing', 'word-spacing', 'Word Spacing'),
|
||||
('word-wrap', 'word-wrap', 'Word Wrap'),
|
||||
('z-index', 'z-index', 'Z Index')],
|
||||
name='',
|
||||
default='color',
|
||||
#update=set_properties,
|
||||
set=set_enum,
|
||||
get=get_enum)
|
||||
|
||||
property1: HaxeStringProperty(
|
||||
'property1',
|
||||
name='',
|
||||
default='')
|
||||
|
||||
property2: HaxeBoolProperty(
|
||||
'property2',
|
||||
name='Append CSS',
|
||||
default=False)
|
||||
|
||||
|
||||
|
||||
def __init__(self):
|
||||
super(CreateStyleNode, self).__init__()
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxStringSocket', 'Class Name')
|
||||
|
||||
self.add_output('LnxStringSocket', 'Class')
|
||||
self.add_output('LnxStringSocket', 'Inline Style')
|
||||
self.add_output('LnxStringSocket', 'CSS')
|
||||
ind = 0
|
||||
properties = ''
|
||||
|
||||
for i in self.inputs:
|
||||
if ind != 0:
|
||||
properties += self.inputs[ind].name + ':'
|
||||
ind += 1
|
||||
self['property1'] = properties
|
||||
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
row = layout.row(align=True)
|
||||
column = row.column(align=True)
|
||||
op = column.operator('lnx.node_remove_input', text='Remove', icon='X', emboss=True)
|
||||
op.node_index = str(id(self))
|
||||
if len(self.inputs) == self.min_inputs:
|
||||
column.enabled = False
|
||||
layout.prop(self, 'property2')
|
||||
|
||||
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
|
||||
if self.lnx_version not in (0, 1):
|
||||
raise LookupError()
|
||||
|
||||
return NodeReplacement.Identity(self)
|
||||
|
||||
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
CreateStyleNode.on_register()
|
28
leenkx/blender/lnx/logicnode/custom/LN_create_torrent.py
Normal file
28
leenkx/blender/lnx/logicnode/custom/LN_create_torrent.py
Normal file
@ -0,0 +1,28 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class CreateTorrentNode(LnxLogicTreeNode):
|
||||
"""Create Torrent"""
|
||||
bl_idname = 'LNCreateTorrentNode'
|
||||
bl_label = 'Create Torrent'
|
||||
bl_description = 'Create a torrent file from the network'
|
||||
lnx_category = 'Leenkx'
|
||||
lnx_version = 1
|
||||
|
||||
def __init__(self):
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Torrent')
|
||||
self.add_output('LnxNodeSocketAction', 'Done')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('Leenkx', icon='ORIENTATION_CURSOR')
|
||||
CreateTorrentNode.on_register()
|
40
leenkx/blender/lnx/logicnode/custom/LN_database_connect.py
Normal file
40
leenkx/blender/lnx/logicnode/custom/LN_database_connect.py
Normal file
@ -0,0 +1,40 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class DatabaseConnectNode(LnxLogicTreeNode):
|
||||
"""Database Connect"""
|
||||
bl_idname = 'LNDatabaseConnectNode'
|
||||
bl_label = 'Database Connect'
|
||||
bl_description = 'DatabaseConnect'
|
||||
lnx_category = 'Database'
|
||||
lnx_version = 1
|
||||
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('mysql', 'MySQL', 'Connect to a MySQL Database'),
|
||||
('sqlite', 'SQLite', 'Connect to a SQLite Database'),
|
||||
('redis', 'Redis', 'Connect to a Redis Database')],
|
||||
name='',
|
||||
default='mysql')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'User')
|
||||
self.add_input('LnxStringSocket', 'Password')
|
||||
self.add_input('LnxStringSocket', 'Socket')
|
||||
self.add_input('LnxStringSocket', 'Host')
|
||||
self.add_input('LnxIntSocket', 'Port')
|
||||
self.add_input('LnxStringSocket', 'Database')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Connection')
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('Database', icon='MESH_CYLINDER')
|
||||
DatabaseConnectNode.on_register()
|
29
leenkx/blender/lnx/logicnode/custom/LN_draw_video.py
Normal file
29
leenkx/blender/lnx/logicnode/custom/LN_draw_video.py
Normal file
@ -0,0 +1,29 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class DrawVideoNode(LnxLogicTreeNode):
|
||||
bl_idname = 'LNDrawVideoNode'
|
||||
bl_label = 'Draw Video'
|
||||
bl_description = '(JS ONLY Temp) Draws video from a canvas element'
|
||||
lnx_category = 'Draw'
|
||||
lnx_section = 'draw'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'Draw')
|
||||
self.add_input('LnxStringSocket', 'Video File')
|
||||
self.add_input('LnxColorSocket', 'Color', default_value=[1.0, 1.0, 1.0, 1.0])
|
||||
self.add_input('LnxIntSocket', '0/1/2 = Left/Center/Right', default_value=0)
|
||||
self.add_input('LnxIntSocket', '0/1/2 = Top/Middle/Bottom', default_value=0)
|
||||
self.add_input('LnxFloatSocket', 'X')
|
||||
self.add_input('LnxFloatSocket', 'Y')
|
||||
self.add_input('LnxFloatSocket', 'Width')
|
||||
self.add_input('LnxFloatSocket', 'Height')
|
||||
self.add_input('LnxFloatSocket', 'Angle')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('Draw', icon='GREASEPENCIL')
|
||||
DrawVideoNode.on_register()
|
31
leenkx/blender/lnx/logicnode/custom/LN_get_blob_url.py
Normal file
31
leenkx/blender/lnx/logicnode/custom/LN_get_blob_url.py
Normal file
@ -0,0 +1,31 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class GetBlobUrlNode(LnxLogicTreeNode):
|
||||
"""Get Blob Url"""
|
||||
bl_idname = 'LNGetBlobUrlNode'
|
||||
bl_label = 'Get Blob Url'
|
||||
bl_description = 'Get Blob Url'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('file', 'File', 'Get Blob URL From File'),
|
||||
('object', 'Object', 'Get Blob URL From Object'),
|
||||
('video', 'Video', 'Get Blob URL From Video'),
|
||||
('canvas', 'Canvas', 'Get Blob URL From Canvas')],
|
||||
name='', default='file')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
|
||||
self.add_output('LnxStringSocket', 'Url')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
GetBlobUrlNode.on_register()
|
21
leenkx/blender/lnx/logicnode/custom/LN_get_element.py
Normal file
21
leenkx/blender/lnx/logicnode/custom/LN_get_element.py
Normal file
@ -0,0 +1,21 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class GetElementNode(LnxLogicTreeNode):
|
||||
"""Get Element"""
|
||||
bl_idname = 'LNGetElementNode'
|
||||
bl_label = 'Get Element'
|
||||
bl_description = 'Get Element'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'Selector')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Element')
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
GetElementNode.on_register()
|
@ -0,0 +1,21 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class GetElementPropertyNode(LnxLogicTreeNode):
|
||||
"""Get Element Property"""
|
||||
bl_idname = 'LNGetElementPropertyNode'
|
||||
bl_label = 'Get Element Property'
|
||||
bl_description = 'Get Element Property'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxDynamicSocket', 'Element')
|
||||
self.add_input('LnxStringSocket', 'Property')
|
||||
|
||||
self.add_output('LnxDynamicSocket', 'Value')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
GetElementPropertyNode.on_register()
|
@ -0,0 +1,21 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class GetJSObjectPropertyNode(LnxLogicTreeNode):
|
||||
"""Get JS Object Property"""
|
||||
bl_idname = 'LNGetJSObjectPropertyNode'
|
||||
bl_label = 'Get JS Object Property'
|
||||
bl_description = 'Get JS Object Property'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxDynamicSocket', 'JS Object')
|
||||
self.add_input('LnxStringSocket', 'Property')
|
||||
|
||||
self.add_output('LnxDynamicSocket', 'Value')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
GetJSObjectPropertyNode.on_register()
|
17
leenkx/blender/lnx/logicnode/custom/LN_html_dom_object.py
Normal file
17
leenkx/blender/lnx/logicnode/custom/LN_html_dom_object.py
Normal file
@ -0,0 +1,17 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class HtmlDOMObjectNode(LnxLogicTreeNode):
|
||||
"""Get Element"""
|
||||
bl_idname = 'LNHtmlDOMObjectNode'
|
||||
bl_label = 'Html DOM Object'
|
||||
bl_description = 'Html DOM Object'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_output('LnxDynamicSocket', 'Element')
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
HtmlDOMObjectNode.on_register()
|
28
leenkx/blender/lnx/logicnode/custom/LN_html_text_block.py
Normal file
28
leenkx/blender/lnx/logicnode/custom/LN_html_text_block.py
Normal file
@ -0,0 +1,28 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class HtmlTextBlockNode(LnxLogicTreeNode):
|
||||
"""HTML Text Block"""
|
||||
bl_idname = 'LNHtmlTextBlockNode'
|
||||
bl_label = 'HTML Text Block'
|
||||
bl_description = 'Select and unescape local JS/CSS/HTML text block directly from blender'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
@property
|
||||
def property0(self):
|
||||
return bpy.data.texts[self.property0_].as_string().replace('\r', '').replace('\n', '').replace('"','\\"') if self.property0_ in bpy.data.texts else ""
|
||||
|
||||
|
||||
property0_: HaxeStringProperty('property0', name='Text', default='')
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_output('LnxStringSocket', 'JS/CSS/HTML')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop_search(self, 'property0_', bpy.data, 'texts', icon='NONE', text='')
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
HtmlTextBlockNode.on_register()
|
94
leenkx/blender/lnx/logicnode/custom/LN_js_event_target.py
Normal file
94
leenkx/blender/lnx/logicnode/custom/LN_js_event_target.py
Normal file
@ -0,0 +1,94 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class JSEventTargetNode(LnxLogicTreeNode):
|
||||
"""JS Event Target"""
|
||||
bl_idname = 'LNJSEventTargetNode'
|
||||
bl_label = 'JS Event Target'
|
||||
bl_description = 'Event Target is an interface implemented by objects that can receive events and may have listeners for them.'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
@staticmethod
|
||||
def get_enum_id_value(obj, prop_name, value):
|
||||
return obj.bl_rna.properties[prop_name].enum_items[value].identifier
|
||||
|
||||
@staticmethod
|
||||
def get_count_in(type_name):
|
||||
return {
|
||||
'addEventListener': 0,
|
||||
'removeEventListener': 1,
|
||||
'dispatchEvent': 2,
|
||||
}.get(type_name, 0)
|
||||
|
||||
def get_enum(self):
|
||||
return self.get('property0', 0)
|
||||
|
||||
def set_enum(self, value):
|
||||
# Checking the selection of each type
|
||||
select_current = self.get_enum_id_value(self, 'property0', value)
|
||||
select_prev = self.property0
|
||||
|
||||
#Check if type changed
|
||||
if select_prev != select_current:
|
||||
|
||||
for i in self.inputs:
|
||||
self.inputs.remove(i)
|
||||
|
||||
# Arguements for type Client
|
||||
index = self.get_count_in(select_current)
|
||||
|
||||
match index:
|
||||
case 2:
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'JS Object')
|
||||
self.add_input('LnxDynamicSocket', 'Event')
|
||||
case _:
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'JS Object')
|
||||
self.add_input('LnxStringSocket', 'Type')
|
||||
self.add_input('LnxDynamicSocket', 'Listener')
|
||||
self.add_input('LnxDynamicSocket', 'Options')
|
||||
self.add_input('LnxBoolSocket', 'unTrusted')
|
||||
|
||||
self['property0'] = value
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('addEventListener', 'addEventListener', 'Add an event listener to the object'),
|
||||
('removeEventListener', 'removeEventListener', 'Remove an event listener to the object'),
|
||||
('dispatchEvent', 'dispatchEvent', 'Dispatch an event to the object listener')],
|
||||
name='',
|
||||
default='addEventListener',
|
||||
set=set_enum,
|
||||
get=get_enum)
|
||||
|
||||
property1: HaxeEnumProperty(
|
||||
'property1',
|
||||
items = [('inline', 'Inline Function', 'Inline function to evaluate on event'),
|
||||
('callable', 'Callable Function', 'Callable function to trigger on event'),
|
||||
('event', 'Event Listener', 'Bind event to existing event listener'),
|
||||
('output', 'Bind output', 'Trigger node output on JS event')],
|
||||
name='',
|
||||
default='inline')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'JS Object')
|
||||
self.add_input('LnxStringSocket', 'Type')
|
||||
self.add_input('LnxDynamicSocket', 'Listener')
|
||||
self.add_input('LnxDynamicSocket', 'Options')
|
||||
self.add_input('LnxBoolSocket', 'WantsUnTrusted')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
if str(self.property0) == 'addEventListener':
|
||||
layout.prop(self, 'property1')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
JSEventTargetNode.on_register()
|
@ -0,0 +1,74 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class LeenkxCloseConnectionNode(LnxLogicTreeNode):
|
||||
"""Close connection on the network"""
|
||||
bl_idname = 'LNLeenkxCloseConnectionNode'
|
||||
bl_label = 'Close Leenkx Connection'
|
||||
lnx_version = 1
|
||||
lnx_category = 'Leenkx'
|
||||
ind = 2
|
||||
|
||||
@staticmethod
|
||||
def get_enum_id_value(obj, prop_name, value):
|
||||
return obj.bl_rna.properties[prop_name].enum_items[value].identifier
|
||||
|
||||
@staticmethod
|
||||
def get_count_in(type_name):
|
||||
return {
|
||||
'client': 0,
|
||||
'peer': 1
|
||||
}.get(type_name, 0)
|
||||
|
||||
def get_enum(self):
|
||||
return self.get('property0', 0)
|
||||
|
||||
def set_enum(self, value):
|
||||
# Checking the selection of each type
|
||||
select_current = self.get_enum_id_value(self, 'property0', value)
|
||||
select_prev = self.property0
|
||||
|
||||
#Check if type changed
|
||||
if select_prev != select_current:
|
||||
|
||||
for i in self.inputs:
|
||||
self.inputs.remove(i)
|
||||
|
||||
# Arguements for type Host
|
||||
if (self.get_count_in(select_current) == 0):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxStringSocket', 'Url')
|
||||
|
||||
# Arguements for type Client
|
||||
if (self.get_count_in(select_current) == 1):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxStringSocket', 'ID')
|
||||
|
||||
self['property0'] = value
|
||||
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property1',
|
||||
items = [('client', 'Leenkx Client', 'Close the Leenkx Client connection on the network'),
|
||||
('peer', 'Single Peer', 'Close a Peer connection on network')],
|
||||
name='', default='client',
|
||||
set=set_enum,
|
||||
get=get_enum)
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxStringSocket', 'Url')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
def register():
|
||||
add_category('Leenkx', icon='ORIENTATION_CURSOR')
|
||||
LeenkxCloseConnectionNode.on_register()
|
110
leenkx/blender/lnx/logicnode/custom/LN_leenkx_event.py
Normal file
110
leenkx/blender/lnx/logicnode/custom/LN_leenkx_event.py
Normal file
@ -0,0 +1,110 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class LeenkxEventNode(LnxLogicTreeNode):
|
||||
"""Leenkx Event"""
|
||||
bl_idname = 'LNLeenkxEventNode'
|
||||
bl_label = 'Leenkx Event'
|
||||
bl_description = 'Trigger an event from the network passing both data and ID'
|
||||
lnx_category = 'Leenkx'
|
||||
lnx_version = 1
|
||||
|
||||
@staticmethod
|
||||
def get_enum_id_value(obj, prop_name, value):
|
||||
return obj.bl_rna.properties[prop_name].enum_items[value].identifier
|
||||
|
||||
@staticmethod
|
||||
def get_count_in(type_name):
|
||||
return {
|
||||
'client': 0,
|
||||
'host': 1,
|
||||
'securehost': 2
|
||||
}.get(type_name, 0)
|
||||
|
||||
def get_enum(self):
|
||||
return self.get('property0', 0)
|
||||
|
||||
def set_enum(self, value):
|
||||
# Checking the selection of each type
|
||||
select_current = self.get_enum_id_value(self, 'property0', value)
|
||||
select_prev = self.property0
|
||||
|
||||
#Check if type changed
|
||||
if select_prev != select_current:
|
||||
|
||||
for i in self.inputs:
|
||||
self.inputs.remove(i)
|
||||
|
||||
# Arguements for type Client
|
||||
if (self.get_count_in(select_current) == 0):
|
||||
self.add_input('LnxStringSocket', 'Url', default_value="8001")
|
||||
|
||||
|
||||
# Arguements for type Host
|
||||
if (self.get_count_in(select_current) == 1):
|
||||
self.add_input('LnxStringSocket', 'Domain', default_value="127.0.0.1")
|
||||
self.add_input('LnxIntSocket', 'Port', default_value=8001)
|
||||
|
||||
|
||||
# Arguements for type Secure Host
|
||||
if (self.get_count_in(select_current) == 2):
|
||||
self.add_input('LnxStringSocket', 'Domain', default_value="127.0.0.1")
|
||||
self.add_input('LnxIntSocket', 'Port', default_value=8001)
|
||||
|
||||
|
||||
self['property0'] = value
|
||||
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('client', 'Client', 'Network client Event listener'),
|
||||
('host', 'Host', 'Network host Event listener'),
|
||||
('securehost', 'Secure Host', 'Network secure host Event listener')],
|
||||
name='',
|
||||
default='client',
|
||||
set=set_enum,
|
||||
get=get_enum)
|
||||
|
||||
|
||||
property1: HaxeEnumProperty(
|
||||
'property1',
|
||||
items = [('onopen', 'OnOpen', 'Listens to onOpen event'),
|
||||
('onmessage', 'OnMessage', 'Listens to onMessage event'),
|
||||
('onerror', 'OnError', 'Listens to onError event'),
|
||||
('onclose', 'OnClose', 'Listens to onClose event'),
|
||||
('onseen', 'OnSeen', 'Listens to onClose event'),
|
||||
('onserver', 'OnServer', 'Listens to onClose event'),
|
||||
('onconnections', 'OnConnections', 'Listens to onClose event'),
|
||||
('onping', 'OnPing', 'Listens to onClose event'),
|
||||
('onleft', 'OnLeft', 'Listens to onClose event'),
|
||||
('ontimeout', 'OnTimeout', 'Listens to onClose event'),
|
||||
('onrpc', 'OnRpc', 'Listens to onClose event'),
|
||||
('onrpcresponse', 'OnRpcResponse', 'Listens to onClose event'),
|
||||
('onwireleft', 'OnWireLeft', 'Listens to onClose event'),
|
||||
('onwireseen', 'OnWireSeen', 'Listens to onClose event'),
|
||||
('ontorrent', 'OnTorrent', 'Listens to onClose event'),
|
||||
('ontracker', 'OnTracker', 'Listens to onClose event'),
|
||||
('onannounce', 'OnAnnounce', 'Listens to onClose event')],
|
||||
name='',
|
||||
default='onopen')
|
||||
|
||||
def __init__(self):
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
#self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'Url', default_value="ws://127.0.0.1:8001")
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'ID')
|
||||
self.add_output('LnxDynamicSocket', 'Data')
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
layout.prop(self, 'property1')
|
||||
|
||||
def register():
|
||||
add_category('Leenkx', icon='ORIENTATION_CURSOR')
|
||||
LeenkxEventNode.on_register()
|
@ -0,0 +1,39 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class LeenkxMessageParserNode(LnxLogicTreeNode):
|
||||
"""Leenkx Message Parser"""
|
||||
bl_idname = 'LNLeenkxMessageParserNode'
|
||||
bl_label = 'Leenkx Message Parser'
|
||||
bl_description = 'Parses messages incoming from the Leenkx network'
|
||||
lnx_category = 'Leenkx'
|
||||
lnx_version = 1
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('string', 'String', 'Event for a string over the network'),
|
||||
('vector', 'Vector', 'Event for a vector over the network'),
|
||||
('float', 'Float', 'Event for a float over the network'),
|
||||
('integer', 'Integer', 'Event for an integer over the network'),
|
||||
('boolean', 'Boolean', 'Event for a boolean over the network'),
|
||||
('transform', 'Transform', 'Event for a transform over the network'),
|
||||
('rotation', 'Rotation', 'Event for a rotation over the network')],
|
||||
name='', default='string')
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'API')
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'API')
|
||||
self.add_output('LnxDynamicSocket', 'Data')
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
def register():
|
||||
add_category('Leenkx', icon='ORIENTATION_CURSOR')
|
||||
LeenkxMessageParserNode.on_register()
|
116
leenkx/blender/lnx/logicnode/custom/LN_leenkx_send_message.py
Normal file
116
leenkx/blender/lnx/logicnode/custom/LN_leenkx_send_message.py
Normal file
@ -0,0 +1,116 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class LeenkxSendMessageNode(LnxLogicTreeNode):
|
||||
"""Leenkx Send Message"""
|
||||
bl_idname = 'LNLeenkxSendMessageNode'
|
||||
bl_label = 'Leenkx Send Message'
|
||||
bl_description = 'Send messages to the Leenkx network'
|
||||
lnx_category = 'Leenkx'
|
||||
lnx_version = 1
|
||||
|
||||
@staticmethod
|
||||
def get_enum_id_value(obj, prop_name, value):
|
||||
return obj.bl_rna.properties[prop_name].enum_items[value].identifier
|
||||
|
||||
@staticmethod
|
||||
def get_count_in(type_name):
|
||||
return {
|
||||
'client': 0,
|
||||
'host': 1,
|
||||
'securehost': 2
|
||||
}.get(type_name, 0)
|
||||
|
||||
def get_enum(self):
|
||||
return self.get('property0', 0)
|
||||
|
||||
def set_enum(self, value):
|
||||
# Checking the selection of each type
|
||||
select_current = self.get_enum_id_value(self, 'property0', value)
|
||||
select_prev = self.property0
|
||||
|
||||
#Check if type changed
|
||||
if select_prev != select_current:
|
||||
|
||||
for i in self.inputs:
|
||||
self.inputs.remove(i)
|
||||
|
||||
# Arguements for type Client
|
||||
if (self.get_count_in(select_current) == 0):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxStringSocket', 'API')
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
self.add_input('LnxStringSocket', 'ID')
|
||||
self.add_input('LnxBoolSocket', 'Send All')
|
||||
|
||||
# Arguements for type Host
|
||||
if (self.get_count_in(select_current) == 1):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxStringSocket', 'API')
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
self.add_input('LnxStringSocket', 'ID')
|
||||
self.add_input('LnxBoolSocket', 'Send All')
|
||||
|
||||
|
||||
# Arguements for type Secure Host
|
||||
if (self.get_count_in(select_current) == 2):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxStringSocket', 'API')
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
self.add_input('LnxStringSocket', 'ID')
|
||||
self.add_input('LnxBoolSocket', 'Send All')
|
||||
|
||||
|
||||
self['property0'] = value
|
||||
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('client', 'Client', 'Network client Event listener'),
|
||||
('host', 'Host', 'Network host Event listener'),
|
||||
('securehost', 'Secure Host', 'Network secure host Event listener')],
|
||||
name='',
|
||||
default='client',
|
||||
set=set_enum,
|
||||
get=get_enum)
|
||||
|
||||
|
||||
property1: HaxeEnumProperty(
|
||||
'property1',
|
||||
items = [('string', 'String', 'Send a string over the network to one or all of the clients'),
|
||||
('vector', 'Vector', 'Send a vector over the network to one or all of the clients'),
|
||||
('float', 'Float', 'Send a float over the network to one or all of the clients'),
|
||||
('integer', 'Integer', 'Send an integer over the network to one or all of the clients'),
|
||||
('boolean', 'Boolean', 'Send a boolean over the network to one or all of the clients'),
|
||||
('transform', 'Transform', 'Send a transform over the network to one or all of the clients'),
|
||||
('rotation', 'Rotation', 'Send a rotation over the network to one or all of the clients')],
|
||||
name='',
|
||||
default='string')
|
||||
|
||||
|
||||
def __init__(self):
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxStringSocket', 'API')
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
self.add_input('LnxStringSocket', 'ID')
|
||||
self.add_input('LnxBoolSocket', 'Send All')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
layout.prop(self, 'property1')
|
||||
|
||||
def register():
|
||||
add_category('Leenkx', icon='ORIENTATION_CURSOR')
|
||||
LeenkxSendMessageNode.on_register()
|
32
leenkx/blender/lnx/logicnode/custom/LN_load_wasm.py
Normal file
32
leenkx/blender/lnx/logicnode/custom/LN_load_wasm.py
Normal file
@ -0,0 +1,32 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class LoadWASMNode(LnxLogicTreeNode):
|
||||
"""Load WASM"""
|
||||
bl_idname = 'LNLoadWASMNode'
|
||||
bl_label = 'Load WASM'
|
||||
bl_description = 'Load WASM'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
property1: HaxeBoolProperty(
|
||||
'property1',
|
||||
name="Secure",
|
||||
description="Secure host connection",
|
||||
default=False,
|
||||
)
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'Path')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxNodeSocketAction', 'Loaded')
|
||||
self.add_output('LnxDynamicSocket', 'WASM')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property1')
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
LoadWASMNode.on_register()
|
112
leenkx/blender/lnx/logicnode/custom/LN_render_element.py
Normal file
112
leenkx/blender/lnx/logicnode/custom/LN_render_element.py
Normal file
@ -0,0 +1,112 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class RenderElementNode(LnxLogicTreeNode):
|
||||
"""Render Element"""
|
||||
bl_idname = 'LNRenderElementNode'
|
||||
bl_label = 'Render Element'
|
||||
bl_description = 'Render Element'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
@staticmethod
|
||||
def get_enum_id_value(obj, prop_name, value):
|
||||
return obj.bl_rna.properties[prop_name].enum_items[value].identifier
|
||||
|
||||
@staticmethod
|
||||
def get_count_in(type_name):
|
||||
return {
|
||||
'append': 0,
|
||||
'appendChild': 1,
|
||||
'appendTorrent': 2,
|
||||
'prepend': 3,
|
||||
'prependChild': 4,
|
||||
'innerHTML': 5,
|
||||
'innerText': 6,
|
||||
'insertAdjacentHTML': 7,
|
||||
}.get(type_name, 0)
|
||||
|
||||
def get_enum(self):
|
||||
return self.get('property0', 0)
|
||||
|
||||
def set_enum(self, value):
|
||||
# Checking the selection of each type
|
||||
select_current = self.get_enum_id_value(self, 'property0', value)
|
||||
select_prev = self.property0
|
||||
|
||||
#Check if type changed
|
||||
if select_prev != select_current:
|
||||
|
||||
for i in self.inputs:
|
||||
self.inputs.remove(i)
|
||||
|
||||
# Arguements for type Client
|
||||
index = self.get_count_in(select_current)
|
||||
|
||||
match index:
|
||||
case 2:
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Torrent')
|
||||
self.add_input('LnxStringSocket', 'Selector')
|
||||
case 5:
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Element')
|
||||
self.add_input('LnxStringSocket', 'HTML')
|
||||
case 6:
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Element')
|
||||
self.add_input('LnxStringSocket', 'Text')
|
||||
case 7:
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'HTML')
|
||||
self.add_input('LnxStringSocket', 'Selector')
|
||||
case _:
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Element')
|
||||
self.add_input('LnxStringSocket', 'Selector')
|
||||
|
||||
self['property0'] = value
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('append', 'Append', 'Append Element to Another'),
|
||||
('appendChild', 'AppendChild', 'AppendChild Element to Another'),
|
||||
('appendTorrent', 'AppendTorrent', 'Append Torrent file to an Element'),
|
||||
('prepend', 'Prepend', 'Prepend Element to Another'),
|
||||
('prependChild', 'PrependChild', 'PrependChild Element to Another'),
|
||||
('innerHTML', 'InnerHTML', 'Insert Element as InnerHTML'),
|
||||
('innerText', 'InnerText', 'Insert Element as InnerText'),
|
||||
('insertAdjacentHTML', 'AdjacentHTML', 'Insert Element as Adjacent HTML')],
|
||||
name='',
|
||||
default='append',
|
||||
set=set_enum,
|
||||
get=get_enum)
|
||||
|
||||
property1: HaxeEnumProperty(
|
||||
'property1',
|
||||
items = [('beforebegin', 'Before Begin', '"Position beforebegin"'),
|
||||
('afterbegin', 'After Begin', '"Position afterbegin"'),
|
||||
('beforeend', 'Before End', '"Position beforeend"'),
|
||||
('afterend', 'After End', '"Position afterend"')],
|
||||
name='',
|
||||
default='beforebegin')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Element')
|
||||
self.add_input('LnxStringSocket', 'Selector')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
if str(self.property0) == 'innerText' or str(self.property0) == 'innerHTML':
|
||||
return
|
||||
else:
|
||||
layout.prop(self, 'property1')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
RenderElementNode.on_register()
|
21
leenkx/blender/lnx/logicnode/custom/LN_run_javascript.py
Normal file
21
leenkx/blender/lnx/logicnode/custom/LN_run_javascript.py
Normal file
@ -0,0 +1,21 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class RunJavascriptNode(LnxLogicTreeNode):
|
||||
"""Run Javascript"""
|
||||
bl_idname = 'LNRunJavascriptNode'
|
||||
bl_label = 'Run Javascript'
|
||||
bl_description = 'Run Javascript '
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'Javascript')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
RunJavascriptNode.on_register()
|
29
leenkx/blender/lnx/logicnode/custom/LN_seed_torrent.py
Normal file
29
leenkx/blender/lnx/logicnode/custom/LN_seed_torrent.py
Normal file
@ -0,0 +1,29 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class SeedTorrentNode(LnxLogicTreeNode):
|
||||
"""Seed Torrent"""
|
||||
bl_idname = 'LNSeedTorrentNode'
|
||||
bl_label = 'Seed Torrent'
|
||||
bl_description = 'Seed a torrent file from the network'
|
||||
lnx_category = 'Leenkx'
|
||||
lnx_version = 1
|
||||
|
||||
def __init__(self):
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxDynamicSocket', 'Opts [Map]')
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Torrent')
|
||||
self.add_output('LnxNodeSocketAction', 'Done')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('Leenkx', icon='ORIENTATION_CURSOR')
|
||||
SeedTorrentNode.on_register()
|
77
leenkx/blender/lnx/logicnode/custom/LN_set_element_data.py
Normal file
77
leenkx/blender/lnx/logicnode/custom/LN_set_element_data.py
Normal file
@ -0,0 +1,77 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class SetElementDataNode(LnxLogicTreeNode):
|
||||
"""Set Element Data"""
|
||||
bl_idname = 'LNSetElementDataNode'
|
||||
bl_label = 'Set Element Data'
|
||||
bl_description = 'Set Element Data'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
|
||||
@staticmethod
|
||||
def get_enum_id_value(obj, prop_name, value):
|
||||
return obj.bl_rna.properties[prop_name].enum_items[value].identifier
|
||||
|
||||
@staticmethod
|
||||
def get_count_in(type_name):
|
||||
return {
|
||||
'attribute': 0,
|
||||
'property': 1
|
||||
}.get(type_name, 0)
|
||||
|
||||
def get_enum(self):
|
||||
return self.get('property0', 0)
|
||||
|
||||
def set_enum(self, value):
|
||||
select_current = self.get_enum_id_value(self, 'property0', value)
|
||||
select_prev = self.property0
|
||||
|
||||
if select_prev != select_current:
|
||||
for i in self.inputs:
|
||||
self.inputs.remove(i)
|
||||
|
||||
if (self.get_count_in(select_current) == 0):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Element')
|
||||
self.add_input('LnxStringSocket', 'Attribute')
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
|
||||
if (self.get_count_in(select_current) == 1):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Element')
|
||||
self.add_input('LnxStringSocket', 'Property')
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
|
||||
self['property0'] = value
|
||||
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('attribute', 'Attribute', 'Set Element Attribute'),
|
||||
('property', 'Property', 'Set Element Property')],
|
||||
name='',
|
||||
default='attribute',
|
||||
set=set_enum,
|
||||
get=get_enum)
|
||||
|
||||
|
||||
def __init__(self):
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
|
||||
def init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Element')
|
||||
self.add_input('LnxStringSocket', 'Attribute')
|
||||
self.add_input('LnxDynamicSocket', 'Data')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
SetElementDataNode.on_register()
|
22
leenkx/blender/lnx/logicnode/custom/LN_target_type.py
Normal file
22
leenkx/blender/lnx/logicnode/custom/LN_target_type.py
Normal file
@ -0,0 +1,22 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class TargetTypeNode(LnxLogicTreeNode):
|
||||
"""Check Target Type"""
|
||||
bl_idname = 'LNTargetTypeNode'
|
||||
bl_label = 'Target Type'
|
||||
bl_description = 'Target Type'
|
||||
lnx_category = 'Custom'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'C')
|
||||
self.add_output('LnxNodeSocketAction', 'JS')
|
||||
self.add_output('LnxNodeSocketAction', 'KROM')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('Custom', icon='PLUGIN')
|
||||
TargetTypeNode.on_register()
|
28
leenkx/blender/lnx/logicnode/custom/LN_text_block.py
Normal file
28
leenkx/blender/lnx/logicnode/custom/LN_text_block.py
Normal file
@ -0,0 +1,28 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
import json
|
||||
|
||||
class TextBlockNode(LnxLogicTreeNode):
|
||||
"""Text Block"""
|
||||
bl_idname = 'LNTextBlockNode'
|
||||
bl_label = 'Text Block'
|
||||
bl_description = 'Select a local text block directly from blender'
|
||||
lnx_category = 'HTML'
|
||||
lnx_version = 1
|
||||
|
||||
@property
|
||||
def property0(self):
|
||||
return bpy.data.texts[self.property0_].as_string().replace('\r', '').replace('\n', '').replace('"','\\"') if self.property0_ in bpy.data.texts else ""
|
||||
|
||||
|
||||
property0_: HaxeStringProperty('property0', name='Text', default='')
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_output('LnxStringSocket', 'Text')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop_search(self, 'property0_', bpy.data, 'texts', icon='NONE', text='')
|
||||
|
||||
def register():
|
||||
add_category('HTML', icon='SEQ_STRIP_META')
|
||||
TextBlockNode.on_register()
|
30
leenkx/blender/lnx/logicnode/custom/LN_touch_pad.py
Normal file
30
leenkx/blender/lnx/logicnode/custom/LN_touch_pad.py
Normal file
@ -0,0 +1,30 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class TouchPadNode(LnxLogicTreeNode):
|
||||
"""Virtual Touch Pad Controller"""
|
||||
bl_idname = 'LNTouchPadNode'
|
||||
bl_label = 'Touch Pad Controller'
|
||||
bl_description = 'Virtual Touch Pad Controller'
|
||||
lnx_category = 'Leenkx'
|
||||
lnx_version = 1
|
||||
|
||||
def __init__(self):
|
||||
array_nodes[str(id(self))] = self
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxDynamicSocket', 'Connection')
|
||||
self.add_input('LnxIntSocket', 'Touchpad')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxDynamicSocket', 'Lx')
|
||||
self.add_output('LnxDynamicSocket', 'Ly')
|
||||
self.add_output('LnxDynamicSocket', 'Rx')
|
||||
self.add_output('LnxDynamicSocket', 'Ry')
|
||||
|
||||
|
||||
def register():
|
||||
add_category('Leenkx', icon='ORIENTATION_CURSOR')
|
||||
TouchPadNode.on_register()
|
0
leenkx/blender/lnx/logicnode/custom/__init__.py
Normal file
0
leenkx/blender/lnx/logicnode/custom/__init__.py
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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