LNXSDK/leenkx/blender/lnx/logicnode/object/LN_raycast_closest_object.py

22 lines
1001 B
Python
Raw Normal View History

2025-01-22 16:18:30 +01:00
from lnx.logicnode.lnx_nodes import *
class RaycastClosestObjectNode(LnxLogicTreeNode):
"""it takes an objects array and returns true of false if at least one of those objects is touched at screen (x, y), the object that is touched and the (x,y, z) position of that touch if returned"""
bl_idname = 'LNRaycastClosestObjectNode'
bl_label = 'Raycast Closest Object'
lnx_section = 'props'
lnx_version = 1
def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketArray', 'Obj Array')
self.add_input('LnxFloatSocket', 'X')
self.add_input('LnxFloatSocket', 'Y')
self.add_input('LnxNodeSocketObject', 'Camera')
self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxNodeSocketAction', 'True')
self.add_output('LnxNodeSocketAction', 'False')
self.add_output('LnxNodeSocketObject', 'Object')
self.add_output('LnxVectorSocket', 'Location')