38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
from lnx.logicnode.lnx_nodes import *
|
|
|
|
|
|
class AudioStereoPannerNode(LnxLogicTreeNode):
|
|
"""Stereo Panner"""
|
|
bl_idname = 'LNAudioStereoPannerNode'
|
|
bl_label = 'Stereo Panner'
|
|
bl_description = 'Create 2D audio Stereo Panner'
|
|
lnx_category = '3D_Audio'
|
|
lnx_version = 1
|
|
|
|
def update_input(self, context):
|
|
while len(self.inputs) > 2:
|
|
self.inputs.remove(self.inputs[-1])
|
|
if self.property0 == 'Degrees':
|
|
self.add_input('LnxIntSocket', 'Degrees', default_value=0)
|
|
|
|
property0: HaxeEnumProperty(
|
|
'property0',
|
|
items = [('Center', 'Center', 'Center'),
|
|
('Left', 'Left', 'Left'),
|
|
('Right', 'Right', 'Right'),
|
|
('Degrees', 'Degrees', 'Degrees')],
|
|
name='', default='Center', update=update_input)
|
|
|
|
def lnx_init(self, context):
|
|
self.add_input('LnxNodeSocketAction', 'In')
|
|
self.add_input('LnxDynamicSocket', 'Audio')
|
|
|
|
self.add_output('LnxNodeSocketAction', 'Out')
|
|
self.add_output('LnxDynamicSocket', 'Audio')
|
|
|
|
def draw_buttons(self, context, layout):
|
|
layout.prop(self, 'property0')
|
|
|
|
def register():
|
|
add_category('3D_Audio', icon='SOUND')
|
|
AudioStereoPannerNode.on_register() |