t3du - Particle nodes Update

This commit is contained in:
2025-06-02 18:01:58 +00:00
parent 0c5d71ecd2
commit 03106eff02

View File

@ -1,58 +1,67 @@
from lnx.logicnode.lnx_nodes import * from lnx.logicnode.lnx_nodes import *
class SetParticleDataNode(LnxLogicTreeNode): class SetParticleDataNode(LnxLogicTreeNode):
"""Sets the parameters of the given particle system.""" """Sets the parameters of the given particle system."""
bl_idname = 'LNSetParticleDataNode' bl_idname = 'LNSetParticleDataNode'
bl_label = 'Set Particle Data' bl_label = 'Set Particle Data'
lnx_version = 1 lnx_version = 1
def remove_extra_inputs(self, context): def remove_extra_inputs(self, context):
while len(self.inputs) > 3: while len(self.inputs) > 3:
self.inputs.remove(self.inputs[-1]) self.inputs.remove(self.inputs[-1])
if self.property0 == 'Particle Size': if self.property0 == 'Particle Size':
self.add_input('LnxFloatSocket', 'Particle Size') self.add_input('LnxFloatSocket', 'Particle Size')
if self.property0 == 'Frame End': if self.property0 == 'Frame End':
self.add_input('LnxIntSocket', 'Frame End') self.add_input('LnxIntSocket', 'Frame End')
if self.property0 == 'Frame Start': if self.property0 == 'Frame Start':
self.add_input('LnxIntSocket', 'Frame Start') self.add_input('LnxIntSocket', 'Frame Start')
if self.property0 == 'Lifetime': if self.property0 == 'Lifetime':
self.add_input('LnxIntSocket', 'Lifetime') self.add_input('LnxIntSocket', 'Lifetime')
if self.property0 == 'Lifetime Random': if self.property0 == 'Lifetime Random':
self.add_input('LnxFloatSocket', 'Lifetime Random') self.add_input('LnxFloatSocket', 'Lifetime Random')
if self.property0 == 'Emit From': if self.property0 == 'Emit From':
self.add_input('LnxIntSocket', 'Emit From') self.add_input('LnxIntSocket', 'Emit From')
if self.property0 == 'Velocity': if self.property0 == 'Auto Start':
self.add_input('LnxVectorSocket', 'Velocity') self.add_input('LnxBoolSocket', 'Auto Start')
if self.property0 == 'Velocity Random': if self.property0 == 'Is Unique':
self.add_input('LnxFloatSocket', 'Velocity Random') self.add_input('LnxBoolSocket', 'Is Unique')
if self.property0 == 'Weight Gravity': if self.property0 == 'Loop':
self.add_input('LnxFloatSocket', 'Weight Gravity') self.add_input('LnxBoolSocket', 'Loop')
if self.property0 == 'Speed': if self.property0 == 'Velocity':
self.add_input('LnxFloatSocket', 'Speed') self.add_input('LnxVectorSocket', 'Velocity')
if self.property0 == 'Velocity Random':
self.add_input('LnxFloatSocket', 'Velocity Random')
property0: HaxeEnumProperty( if self.property0 == 'Weight Gravity':
'property0', self.add_input('LnxFloatSocket', 'Weight Gravity')
items = [('Particle Size', 'Particle Size', 'for the system'), if self.property0 == 'Speed':
('Frame Start', 'Frame Start', 'for the system'), self.add_input('LnxFloatSocket', 'Speed')
('Frame End', 'Frame End', 'for the system'),
('Lifetime', 'Lifetime', 'for the instance'),
('Lifetime Random', 'Lifetime Random', 'for the system'), property0: HaxeEnumProperty(
('Emit From', 'Emit From', 'for the system (Vertices:0 Faces:1 Volume: 2)'), 'property0',
('Velocity', 'Velocity', 'for the instance'), items = [('Particle Size', 'Particle Size', 'for the system'),
('Velocity Random', 'Velocity Random', 'for the system'), ('Frame Start', 'Frame Start', 'for the system'),
('Weight Gravity', 'Weight Gravity', 'for the instance'), ('Frame End', 'Frame End', 'for the system'),
('Speed', 'Speed', 'for the instance')], ('Lifetime', 'Lifetime', 'for the instance'),
name='', default='Speed', update=remove_extra_inputs) ('Lifetime Random', 'Lifetime Random', 'for the system'),
('Emit From', 'Emit From', 'for the system (Vertices:0 Faces:1 Volume: 2)'),
('Auto Start', 'Auto Start', 'for the system'),
def lnx_init(self, context): ('Is Unique', 'Is Unique', 'for the system'),
self.add_input('LnxNodeSocketAction', 'In') ('Loop', 'Loop', 'for the system'),
self.add_input('LnxNodeSocketObject', 'Object') ('Velocity', 'Velocity', 'for the instance'),
self.add_input('LnxIntSocket', 'Slot') ('Velocity Random', 'Velocity Random', 'for the system'),
self.add_input('LnxFloatSocket', 'Speed', default_value=1.0) ('Weight Gravity', 'Weight Gravity', 'for the instance'),
('Speed', 'Speed', 'for the instance')],
self.add_output('LnxNodeSocketAction', 'Out') name='', default='Speed', update=remove_extra_inputs)
def draw_buttons(self, context, layout):
layout.prop(self, 'property0') def lnx_init(self, context):
self.add_input('LnxNodeSocketAction', 'In')
self.add_input('LnxNodeSocketObject', 'Object')
self.add_input('LnxIntSocket', 'Slot')
self.add_input('LnxFloatSocket', 'Speed', default_value=1.0)
self.add_output('LnxNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')