forked from LeenkxTeam/LNXSDK
Repe [T3DU] Update - 31f26d171bba0355ce2a77031e3aad4c64dbc7e9
This commit is contained in:
@ -4,6 +4,7 @@ class GetGamepadStartedNode(LnxLogicTreeNode):
|
||||
"""."""
|
||||
bl_idname = 'LNGetGamepadStartedNode'
|
||||
bl_label = 'Get Gamepad Started'
|
||||
lnx_section = 'gamepad'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
|
||||
45
leenkx/blender/lnx/logicnode/input/LN_get_image_color.py
Normal file
45
leenkx/blender/lnx/logicnode/input/LN_get_image_color.py
Normal file
@ -0,0 +1,45 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
|
||||
class GetImageColorNode(LnxLogicTreeNode):
|
||||
"""Gets Color of the pixel in X,Y position of: input Image, Render, Render2D and Render+Render2D.
|
||||
|
||||
@input X: pixel position regarding width.
|
||||
@input Y: pixel position regarding height.
|
||||
|
||||
@output Color: Color of the pixel in X,Y position.
|
||||
|
||||
WARNING: Calling getPixels() on a renderTarget with non-standard non-POT dimensions
|
||||
can cause a system crash. Ensure renderTarget resolution is a power of two
|
||||
(e.g., 256x256) or a common standard resolution (e.g., 1920x1080).
|
||||
|
||||
"""
|
||||
bl_idname = 'LNGetImageColorNode'
|
||||
bl_label = 'Get Image Color'
|
||||
lnx_section = 'image'
|
||||
lnx_version = 1
|
||||
|
||||
def remove_extra_inputs(self, context):
|
||||
while len(self.inputs) > 0:
|
||||
self.inputs.remove(self.inputs[-1])
|
||||
if self.property0 == 'Image':
|
||||
self.add_input('LnxStringSocket', 'Image')
|
||||
self.add_input('LnxIntSocket', 'X')
|
||||
self.add_input('LnxIntSocket', 'Y')
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('Image', 'Image', 'Image'),
|
||||
('Render2D', 'Render2D', 'Render2D'),
|
||||
('Render', 'Render', 'Render'),
|
||||
('Render&Render2D', 'Render&Render2D', 'Render&Render2D')],
|
||||
name='', default='Image', update=remove_extra_inputs)
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxStringSocket', 'Image')
|
||||
self.add_input('LnxIntSocket', 'X')
|
||||
self.add_input('LnxIntSocket', 'Y')
|
||||
self.add_output('LnxColorSocket', 'Color')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
30
leenkx/blender/lnx/logicnode/input/LN_get_keyboard.py
Normal file
30
leenkx/blender/lnx/logicnode/input/LN_get_keyboard.py
Normal file
@ -0,0 +1,30 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class GetKeyboardNode(LnxLogicTreeNode):
|
||||
bl_idname = 'LNGetKeyboardNode'
|
||||
bl_label = 'Get Keyboard'
|
||||
lnx_section = 'keyboard'
|
||||
lnx_version = 1
|
||||
|
||||
def update(self):
|
||||
self.label = f'{self.bl_label}: {self.property0}'
|
||||
|
||||
def upd(self, context):
|
||||
self.label = f'{self.bl_label}: {self.property0}'
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('started', 'Started', 'The keyboard button starts to be pressed'),
|
||||
('down', 'Down', 'The keyboard button is pressed'),
|
||||
('released', 'Released', 'The keyboard button stops being pressed')],
|
||||
name='', default='started', update=upd)
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxStringSocket', 'Key')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
def draw_label(self) -> str:
|
||||
return f'{self.bl_label}: {self.property0}'
|
||||
@ -4,6 +4,7 @@ class GetKeyboardStartedNode(LnxLogicTreeNode):
|
||||
"""."""
|
||||
bl_idname = 'LNGetKeyboardStartedNode'
|
||||
bl_label = 'Get Keyboard Started'
|
||||
lnx_section = 'keyboard'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
|
||||
@ -5,6 +5,7 @@ class GetMouseStartedNode(LnxLogicTreeNode):
|
||||
"""."""
|
||||
bl_idname = 'LNGetMouseStartedNode'
|
||||
bl_label = 'Get Mouse Started'
|
||||
lnx_section = 'mouse'
|
||||
lnx_version = 2
|
||||
|
||||
property0: HaxeBoolProperty(
|
||||
|
||||
@ -19,7 +19,7 @@ class KeyboardNode(LnxLogicTreeNode):
|
||||
items = [('started', 'Started', 'The keyboard button starts to be pressed'),
|
||||
('down', 'Down', 'The keyboard button is pressed'),
|
||||
('released', 'Released', 'The keyboard button stops being pressed')],
|
||||
name='', default='down', update=upd)
|
||||
name='', default='started', update=upd)
|
||||
|
||||
property1: HaxeEnumProperty(
|
||||
'property1',
|
||||
|
||||
@ -26,7 +26,7 @@ class MouseNode(LnxLogicTreeNode):
|
||||
('down', 'Down', 'The mouse button is pressed'),
|
||||
('released', 'Released', 'The mouse button stops being pressed'),
|
||||
('moved', 'Moved', 'Moved')],
|
||||
name='', default='down', update=upd)
|
||||
name='', default='started', update=upd)
|
||||
property1: HaxeEnumProperty(
|
||||
'property1',
|
||||
items = [('left', 'Left', 'Left mouse button'),
|
||||
|
||||
26
leenkx/blender/lnx/logicnode/input/LN_set_virtual_button.py
Normal file
26
leenkx/blender/lnx/logicnode/input/LN_set_virtual_button.py
Normal file
@ -0,0 +1,26 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class SetVirtualButtonNode(LnxLogicTreeNode):
|
||||
bl_idname = 'LNSetVirtualButtonNode'
|
||||
bl_label = 'Set Virtual Button'
|
||||
lnx_section = 'virtual'
|
||||
lnx_version = 1
|
||||
|
||||
property0: bpy.props.EnumProperty(
|
||||
items=[('Keyboard', 'Keyboard', 'Keyboard'),
|
||||
('Mouse', 'Mouse', 'Mouse'),
|
||||
('Gamepad', 'Gamepad', 'Gamepad')],
|
||||
name='Input',
|
||||
default='Keyboard'
|
||||
)
|
||||
property1: bpy.props.StringProperty(name='Virtual Button', default='')
|
||||
property2: bpy.props.StringProperty(name='Physical Button', default='')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
layout.prop(self, 'property1')
|
||||
layout.prop(self, 'property2')
|
||||
@ -13,7 +13,7 @@ class SurfaceNode(LnxLogicTreeNode):
|
||||
('down', 'Down', 'The screen surface is touched'),
|
||||
('released', 'Released', 'The screen surface stops being touched'),
|
||||
('moved', 'Moved', 'Moved')],
|
||||
name='', default='down')
|
||||
name='', default='started')
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
Reference in New Issue
Block a user