Repe [T3DU] Update - 31f26d171bba0355ce2a77031e3aad4c64dbc7e9

This commit is contained in:
2026-09-04 10:46:13 -07:00
parent c915312901
commit 0460b9d587
482 changed files with 27797 additions and 3226 deletions

View File

@ -12,7 +12,7 @@ class PlaySoundNode(LnxLogicTreeNode):
nothing happens.
@input Stop: Stops the playing sound. If the playback is paused,
this will reset the playback position to the start of the sound.
@input Update Volume: Updates the volume of the current playback.
@input Set Volume: Updates the volume of the current playback.
@input Volume: Volume of the playback. Typically ranges from 0 to 1.
@output Out: activated once when Play is activated.
@ -27,18 +27,18 @@ class PlaySoundNode(LnxLogicTreeNode):
@option Retrigger: If true, the playback position will be reset to
the beginning on each activation of Play. If false, the playback
will continue at the current position.
@option Sample Rate: Manually override the sample rate of the sound
(this controls the pitch and the playback speed).
@option Pitch: this controls the pitch and the playback speed.
"""
bl_idname = 'LNPlaySoundRawNode'
bl_label = 'Play Sound'
bl_width_default = 200
lnx_version = 3
lnx_section = 'raw'
lnx_version = 5
def remove_extra_inputs(self, context):
while len(self.inputs) > 5:
while len(self.inputs) > 6:
self.inputs.remove(self.inputs[-1])
if self.property6 == 'Sound Name':
if self.property4 == 'Sound Name':
self.add_input('LnxStringSocket', 'Sound Name')
property0: HaxePointerProperty('property0', name='', type=bpy.types.Sound)
@ -55,24 +55,12 @@ class PlaySoundNode(LnxLogicTreeNode):
default=False)
property3: HaxeBoolProperty(
'property3',
name='Use Custom Sample Rate',
description='If enabled, override the default sample rate',
default=False)
property4: HaxeIntProperty(
'property4',
name='Sample Rate',
description='Set the sample rate used to play this sound',
default=44100,
min=0)
property5: HaxeBoolProperty(
'property5',
name='Stream',
description='Stream the sound from disk',
default=False
)
default=False)
property6: HaxeEnumProperty(
'property6',
property4: HaxeEnumProperty(
'property4',
items = [('Sound', 'Sound', 'Sound'),
('Sound Name', 'Sound Name', 'Sound Name')],
name='', default='Sound', update=remove_extra_inputs)
@ -81,36 +69,27 @@ class PlaySoundNode(LnxLogicTreeNode):
self.add_input('LnxNodeSocketAction', 'Play')
self.add_input('LnxNodeSocketAction', 'Pause')
self.add_input('LnxNodeSocketAction', 'Stop')
self.add_input('LnxNodeSocketAction', 'Update Volume')
self.add_input('LnxNodeSocketAction', 'Set Volume')
self.add_input('LnxFloatSocket', 'Volume', default_value=1.0)
self.add_input('LnxFloatSocket', 'Pitch', default_value=1.0)
self.add_output('LnxNodeSocketAction', 'Out')
self.add_output('LnxNodeSocketAction', 'Is Running')
self.add_output('LnxNodeSocketAction', 'Done')
self.add_output('LnxFloatSocket', 'Length')
self.add_output('LnxFloatSocket', 'Position')
def draw_buttons(self, context, layout):
layout.prop(self, 'property6')
layout.prop(self, 'property4')
col = layout.column(align=True)
if self.property6 == 'Sound':
if self.property4 == 'Sound':
col.prop_search(self, 'property0', bpy.data, 'sounds', icon='NONE', text='')
col.prop(self, 'property5')
col.prop(self, 'property3')
col.prop(self, 'property1')
col.prop(self, 'property2')
layout.label(text="Overrides:")
# Sample rate
split = layout.split(factor=0.15, align=False)
split.prop(self, 'property3', text="")
row = split.row()
if not self.property3:
row.enabled = False
row.prop(self, 'property4')
def get_replacement_node(self, node_tree: bpy.types.NodeTree):
if 0 <= self.lnx_version <= 2:
return NodeReplacement.Identity(self)
raise LookupError()
return NodeReplacement.Identity(self)