forked from LeenkxTeam/LNXSDK
Repe [T3DU] Update - 31f26d171bba0355ce2a77031e3aad4c64dbc7e9
This commit is contained in:
38
leenkx/blender/lnx/logicnode/curve/LN_set_curve_data.py
Normal file
38
leenkx/blender/lnx/logicnode/curve/LN_set_curve_data.py
Normal file
@ -0,0 +1,38 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class SetCurveDataNode(LnxLogicTreeNode):
|
||||
"""Sets curve data."""
|
||||
bl_idname = 'LNSetCurveDataNode'
|
||||
bl_label = 'Set Curve Data'
|
||||
lnx_section = 'set'
|
||||
lnx_version = 1
|
||||
|
||||
def update_sockets(self, context):
|
||||
while len(self.inputs) > 2:
|
||||
self.inputs.remove(self.inputs[-1])
|
||||
if self.property0 == 'Equidistant Samples':
|
||||
self.add_input('LnxIntSocket', 'Equidistant Samples')
|
||||
elif self.property0 == 'Strength':
|
||||
self.add_input('LnxFloatSocket', 'Strength')
|
||||
elif self.property0 == 'Color':
|
||||
self.add_input('LnxColorSocket', 'Color')
|
||||
else:
|
||||
self.add_input('LnxIntSocket', 'Resolution', default_value = 12)
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('Equidistant Samples', 'Equidistant Samples', 'Equidistant Samples'),
|
||||
('Resolution', 'Resolution', 'Resolution'),
|
||||
('Strength', 'Strength', 'Strength'),
|
||||
('Color', 'Color', 'Color')],
|
||||
name='', default='Equidistant Samples', update=update_sockets)
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxNodeSocketObject', 'Curve')
|
||||
self.add_input('LnxIntSocket', 'Equidistant Samples')
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
Reference in New Issue
Block a user