From c3c89c320b7b37f0549090988fce55f9f70026aa Mon Sep 17 00:00:00 2001 From: Onek8 Date: Thu, 22 May 2025 21:36:22 +0000 Subject: [PATCH] Upload files to "leenkx/blender/lnx/logicnode/particle" --- .../particle/LN_add_particle_to_object.py | 41 +++++++++++++ .../lnx/logicnode/particle/LN_get_particle.py | 14 +++++ .../particle/LN_get_particle_data.py | 31 ++++++++++ .../LN_remove_particle_from_object.py | 33 +++++++++++ .../particle/LN_set_particle_data.py | 58 +++++++++++++++++++ 5 files changed, 177 insertions(+) create mode 100644 leenkx/blender/lnx/logicnode/particle/LN_add_particle_to_object.py create mode 100644 leenkx/blender/lnx/logicnode/particle/LN_get_particle.py create mode 100644 leenkx/blender/lnx/logicnode/particle/LN_get_particle_data.py create mode 100644 leenkx/blender/lnx/logicnode/particle/LN_remove_particle_from_object.py create mode 100644 leenkx/blender/lnx/logicnode/particle/LN_set_particle_data.py diff --git a/leenkx/blender/lnx/logicnode/particle/LN_add_particle_to_object.py b/leenkx/blender/lnx/logicnode/particle/LN_add_particle_to_object.py new file mode 100644 index 0000000..59431b3 --- /dev/null +++ b/leenkx/blender/lnx/logicnode/particle/LN_add_particle_to_object.py @@ -0,0 +1,41 @@ +from lnx.logicnode.lnx_nodes import * + +class AddParticleToObjectNode(LnxLogicTreeNode): + """Sets the speed of the given particle source.""" + bl_idname = 'LNAddParticleToObjectNode' + bl_label = 'Add Particle To Object' + lnx_version = 1 + + def remove_extra_inputs(self, context): + while len(self.inputs) > 1: + self.inputs.remove(self.inputs[-1]) + if self.property0 == 'Scene': + self.add_input('LnxStringSocket', 'Scene From Name') + self.add_input('LnxStringSocket', 'Object From Name') + else: + self.add_input('LnxNodeSocketObject', 'Object From') + self.add_input('LnxIntSocket', 'Slot') + self.add_input('LnxNodeSocketObject', 'Object To') + self.add_input('LnxBoolSocket', 'Render Emitter', default_value = True) + + + property0: HaxeEnumProperty( + 'property0', + items = [('Scene Active', 'Scene Active', 'Scene Active'), + ('Scene', 'Scene', 'Scene')], + name='', default='Scene Active', update=remove_extra_inputs) + + + def lnx_init(self, context): + self.add_input('LnxNodeSocketAction', 'In') + self.add_input('LnxNodeSocketObject', 'Object From') + self.add_input('LnxIntSocket', 'Slot') + self.add_input('LnxNodeSocketObject', 'Object To') + self.add_input('LnxBoolSocket', 'Render Emitter', default_value = True) + + self.add_output('LnxNodeSocketAction', 'Out') + + def draw_buttons(self, context, layout): + layout.prop(self, 'property0') + + diff --git a/leenkx/blender/lnx/logicnode/particle/LN_get_particle.py b/leenkx/blender/lnx/logicnode/particle/LN_get_particle.py new file mode 100644 index 0000000..d0de058 --- /dev/null +++ b/leenkx/blender/lnx/logicnode/particle/LN_get_particle.py @@ -0,0 +1,14 @@ +from lnx.logicnode.lnx_nodes import * + +class GetParticleNode(LnxLogicTreeNode): + """Returns the Particle Systems of an object.""" + bl_idname = 'LNGetParticleNode' + bl_label = 'Get Particle' + lnx_version = 1 + + def lnx_init(self, context): + self.inputs.new('LnxNodeSocketObject', 'Object') + + self.outputs.new('LnxNodeSocketArray', 'Names') + self.outputs.new('LnxIntSocket', 'Length') + self.outputs.new('LnxBoolSocket', 'Render Emitter') \ No newline at end of file diff --git a/leenkx/blender/lnx/logicnode/particle/LN_get_particle_data.py b/leenkx/blender/lnx/logicnode/particle/LN_get_particle_data.py new file mode 100644 index 0000000..01ef6d0 --- /dev/null +++ b/leenkx/blender/lnx/logicnode/particle/LN_get_particle_data.py @@ -0,0 +1,31 @@ +from lnx.logicnode.lnx_nodes import * + +class GetParticleDataNode(LnxLogicTreeNode): + """Returns the data of the given Particle System.""" + bl_idname = 'LNGetParticleDataNode' + bl_label = 'Get Particle Data' + lnx_version = 1 + + def lnx_init(self, context): + self.inputs.new('LnxNodeSocketObject', 'Object') + self.inputs.new('LnxIntSocket', 'Slot') + + self.outputs.new('LnxStringSocket', 'Name') + self.outputs.new('LnxFloatSocket', 'Particle Size') + self.outputs.new('LnxIntSocket', 'Frame Start') + self.outputs.new('LnxIntSocket', 'Frame End') + self.outputs.new('LnxIntSocket', 'Lifetime') + self.outputs.new('LnxFloatSocket', 'Lifetime Random') + self.outputs.new('LnxIntSocket', 'Emit From') + + self.outputs.new('LnxVectorSocket', 'Velocity') + self.outputs.new('LnxFloatSocket', 'Velocity Random') + self.outputs.new('LnxVectorSocket', 'Gravity') + self.outputs.new('LnxFloatSocket', 'Weight Gravity') + + self.outputs.new('LnxFloatSocket', 'Speed') + + self.outputs.new('LnxFloatSocket', 'Time') + self.outputs.new('LnxFloatSocket', 'Lap') + self.outputs.new('LnxFloatSocket', 'Lap Time') + self.outputs.new('LnxIntSocket', 'Count') diff --git a/leenkx/blender/lnx/logicnode/particle/LN_remove_particle_from_object.py b/leenkx/blender/lnx/logicnode/particle/LN_remove_particle_from_object.py new file mode 100644 index 0000000..8bdd0f4 --- /dev/null +++ b/leenkx/blender/lnx/logicnode/particle/LN_remove_particle_from_object.py @@ -0,0 +1,33 @@ +from lnx.logicnode.lnx_nodes import * + +class RemoveParticleFromObjectNode(LnxLogicTreeNode): + """Remove Particle From Object.""" + bl_idname = 'LNRemoveParticleFromObjectNode' + bl_label = 'Remove Particle From Object' + lnx_version = 1 + + def remove_extra_inputs(self, context): + while len(self.inputs) > 2: + self.inputs.remove(self.inputs[-1]) + if self.property0 == 'Slot': + self.add_input('LnxIntSocket', 'Slot') + if self.property0 == 'Name': + self.add_input('LnxStringSocket', 'Name') + + property0: HaxeEnumProperty( + 'property0', + items = [('Slot', 'Slot', 'Slot'), + ('Name', 'Name', 'Name'), + ('All', 'All', 'All')], + name='', default='Slot', update=remove_extra_inputs) + + + def lnx_init(self, context): + self.add_input('LnxNodeSocketAction', 'In') + self.add_input('LnxNodeSocketObject', 'Object') + self.add_input('LnxIntSocket', 'Slot') + + self.add_output('LnxNodeSocketAction', 'Out') + + def draw_buttons(self, context, layout): + layout.prop(self, 'property0') \ No newline at end of file diff --git a/leenkx/blender/lnx/logicnode/particle/LN_set_particle_data.py b/leenkx/blender/lnx/logicnode/particle/LN_set_particle_data.py new file mode 100644 index 0000000..805ac2b --- /dev/null +++ b/leenkx/blender/lnx/logicnode/particle/LN_set_particle_data.py @@ -0,0 +1,58 @@ +from lnx.logicnode.lnx_nodes import * + +class SetParticleDataNode(LnxLogicTreeNode): + """Sets the parameters of the given particle system.""" + bl_idname = 'LNSetParticleDataNode' + bl_label = 'Set Particle Data' + lnx_version = 1 + + def remove_extra_inputs(self, context): + while len(self.inputs) > 3: + self.inputs.remove(self.inputs[-1]) + if self.property0 == 'Particle Size': + self.add_input('LnxFloatSocket', 'Particle Size') + if self.property0 == 'Frame End': + self.add_input('LnxIntSocket', 'Frame End') + if self.property0 == 'Frame Start': + self.add_input('LnxIntSocket', 'Frame Start') + if self.property0 == 'Lifetime': + self.add_input('LnxIntSocket', 'Lifetime') + if self.property0 == 'Lifetime Random': + self.add_input('LnxFloatSocket', 'Lifetime Random') + if self.property0 == 'Emit From': + self.add_input('LnxIntSocket', 'Emit From') + if self.property0 == 'Velocity': + self.add_input('LnxVectorSocket', 'Velocity') + if self.property0 == 'Velocity Random': + self.add_input('LnxFloatSocket', 'Velocity Random') + if self.property0 == 'Weight Gravity': + self.add_input('LnxFloatSocket', 'Weight Gravity') + if self.property0 == 'Speed': + self.add_input('LnxFloatSocket', 'Speed') + + + property0: HaxeEnumProperty( + 'property0', + items = [('Particle Size', 'Particle Size', 'for the system'), + ('Frame Start', 'Frame Start', 'for the system'), + ('Frame End', 'Frame End', 'for the system'), + ('Lifetime', 'Lifetime', 'for the instance'), + ('Lifetime Random', 'Lifetime Random', 'for the system'), + ('Emit From', 'Emit From', 'for the system (Vertices:0 Faces:1 Volume: 2)'), + ('Velocity', 'Velocity', 'for the instance'), + ('Velocity Random', 'Velocity Random', 'for the system'), + ('Weight Gravity', 'Weight Gravity', 'for the instance'), + ('Speed', 'Speed', 'for the instance')], + name='', default='Speed', update=remove_extra_inputs) + + + 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')