17 lines
566 B
Python
17 lines
566 B
Python
|
from lnx.logicnode.lnx_nodes import *
|
||
|
|
||
|
class GetDistanceNode(LnxLogicTreeNode):
|
||
|
"""Returns the euclidian distance between the two given objects.
|
||
|
|
||
|
@see For distance between two locations, use the `Distance` operator
|
||
|
in the *[`Vector Math`](#vector-math)* node."""
|
||
|
bl_idname = 'LNGetDistanceNode'
|
||
|
bl_label = 'Get Distance'
|
||
|
lnx_version = 1
|
||
|
|
||
|
def lnx_init(self, context):
|
||
|
self.add_input('LnxNodeSocketObject', 'Object')
|
||
|
self.add_input('LnxNodeSocketObject', 'Object')
|
||
|
|
||
|
self.add_output('LnxFloatSocket', 'Distance')
|