forked from LeenkxTeam/LNXSDK
20 lines
650 B
Python
20 lines
650 B
Python
from lnx.logicnode.lnx_nodes import *
|
|
|
|
class MapRangeNode(LnxLogicTreeNode):
|
|
"""Converts the given value from a range to another range.
|
|
|
|
@seeNode Clamp
|
|
"""
|
|
bl_idname = 'LNMapRangeNode'
|
|
bl_label = 'Map Range'
|
|
lnx_version = 1
|
|
|
|
def lnx_init(self, context):
|
|
self.add_input('LnxFloatSocket', 'Value', default_value=1.0)
|
|
self.add_input('LnxFloatSocket', 'From Min')
|
|
self.add_input('LnxFloatSocket', 'From Max', default_value=1.0)
|
|
self.add_input('LnxFloatSocket', 'To Min')
|
|
self.add_input('LnxFloatSocket', 'To Max', default_value=1.0)
|
|
|
|
self.add_output('LnxFloatSocket', 'Result')
|