2017-04-08 00:34:45 +02:00
|
|
|
import bpy
|
|
|
|
from bpy.props import *
|
|
|
|
from bpy.types import Node, NodeSocket
|
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
|
|
|
class PlaySoundNode(Node, ArmLogicTreeNode):
|
|
|
|
'''Play sound node'''
|
2018-02-21 23:23:23 +01:00
|
|
|
bl_idname = 'LNPlaySoundRawNode'
|
2017-04-08 00:34:45 +02:00
|
|
|
bl_label = 'Play Sound'
|
|
|
|
bl_icon = 'GAME'
|
|
|
|
|
2018-02-21 23:23:23 +01:00
|
|
|
property0 = StringProperty(name='', default='')
|
|
|
|
|
2017-04-08 00:34:45 +02:00
|
|
|
def init(self, context):
|
2017-04-08 20:05:35 +02:00
|
|
|
self.inputs.new('ArmNodeSocketAction', 'In')
|
|
|
|
self.outputs.new('ArmNodeSocketAction', 'Out')
|
2017-04-08 00:34:45 +02:00
|
|
|
|
2018-02-21 23:23:23 +01:00
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop_search(self, 'property0', bpy.data, 'sounds', icon='NONE', text='')
|
|
|
|
|
2017-04-08 00:34:45 +02:00
|
|
|
add_node(PlaySoundNode, category='Sound')
|