forked from LeenkxTeam/LNXSDK
Repe [T3DU] Update - 31f26d171bba0355ce2a77031e3aad4c64dbc7e9
This commit is contained in:
@ -5,7 +5,88 @@ class RandomColorNode(LnxLogicTreeNode):
|
||||
"""Generates a random color."""
|
||||
bl_idname = 'LNRandomColorNode'
|
||||
bl_label = 'Random Color'
|
||||
lnx_version = 1
|
||||
lnx_version = 2
|
||||
|
||||
property0: HaxeBoolProperty(
|
||||
'property0',
|
||||
name='R',
|
||||
default=True
|
||||
)
|
||||
|
||||
property1: HaxeBoolProperty(
|
||||
'property1',
|
||||
name='G',
|
||||
default=True
|
||||
)
|
||||
|
||||
property2: HaxeBoolProperty(
|
||||
'property2',
|
||||
name='B',
|
||||
default=True
|
||||
)
|
||||
|
||||
property3: HaxeBoolProperty(
|
||||
'property3',
|
||||
name='A',
|
||||
default=False
|
||||
)
|
||||
|
||||
property4: HaxeFloatProperty(
|
||||
'property4',
|
||||
name='R Value',
|
||||
default=0.0,
|
||||
min=0.0,
|
||||
max=1.0
|
||||
)
|
||||
|
||||
property5: HaxeFloatProperty(
|
||||
'property5',
|
||||
name='G Value',
|
||||
default=0.0,
|
||||
min=0.0,
|
||||
max=1.0
|
||||
)
|
||||
|
||||
property6: HaxeFloatProperty(
|
||||
'property6',
|
||||
name='B Value',
|
||||
default=0.0,
|
||||
min=0.0,
|
||||
max=1.0
|
||||
)
|
||||
|
||||
property7: HaxeFloatProperty(
|
||||
'property7',
|
||||
name='A Value',
|
||||
default=1.0,
|
||||
min=0.0,
|
||||
max=1.0
|
||||
)
|
||||
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_output('LnxColorSocket', 'Color')
|
||||
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
|
||||
for flag, value, label in [
|
||||
('property0', 'property4', 'R'),
|
||||
('property1', 'property5', 'G'),
|
||||
('property2', 'property6', 'B'),
|
||||
('property3', 'property7', 'A'),
|
||||
]:
|
||||
row = layout.row(align=True)
|
||||
|
||||
row.prop(self, flag, text=label)
|
||||
|
||||
value_row = row.row(align=True)
|
||||
value_row.enabled = not getattr(self, flag)
|
||||
value_row.prop(self, value, text='')
|
||||
|
||||
|
||||
def get_replacement_node(self, node_tree):
|
||||
if self.lnx_version not in (0, 1):
|
||||
raise LookupError()
|
||||
|
||||
return NodeReplacement.Identity(self)
|
||||
|
||||
25
leenkx/blender/lnx/logicnode/random/LN_random_object.py
Normal file
25
leenkx/blender/lnx/logicnode/random/LN_random_object.py
Normal file
@ -0,0 +1,25 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class RandomObjectNode(LnxLogicTreeNode):
|
||||
"""Spawns a random object."""
|
||||
|
||||
bl_idname = 'LNRandomObjectNode'
|
||||
bl_label = 'Random Object'
|
||||
lnx_section = 'logic'
|
||||
lnx_version = 1
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_input('LnxNodeSocketAction', 'In')
|
||||
self.add_input('LnxStringSocket', 'Name')
|
||||
self.add_input('LnxDynamicSocket', 'Transform')
|
||||
self.add_input('LnxDynamicSocket', 'Material')
|
||||
self.add_input('LnxIntSocket', 'NumPoints', default_value = 4)
|
||||
self.add_input('LnxBoolSocket', 'Mirror X')
|
||||
self.add_input('LnxBoolSocket', 'Mirror Y')
|
||||
self.add_input('LnxBoolSocket', 'Mirror Z')
|
||||
self.add_input('LnxFloatSocket', 'Scale UV', default_value = 0.3)
|
||||
self.add_input('LnxBoolSocket', 'Flat Shading', default_value = True)
|
||||
|
||||
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxNodeSocketObject', 'Object')
|
||||
Reference in New Issue
Block a user