@ -39,16 +39,8 @@ class PlasmaSfxFade(bpy.types.PropertyGroup):
class PlasmaSound ( idprops . IDPropMixin , bpy . types . PropertyGroup ) :
class PlasmaSound ( idprops . IDPropMixin , bpy . types . PropertyGroup ) :
def _get_name_proxy ( self ) :
def _update_sound ( self , value ) :
if self . sound is not None :
if not value :
return self . sound . name
return " "
def _set_name_proxy ( self , value ) :
self . sound = bpy . data . sounds . get ( value , None )
# This is the actual pointer update callback
if not self . sound :
self . name = " [Empty] "
self . name = " [Empty] "
return
return
@ -73,14 +65,8 @@ class PlasmaSound(idprops.IDPropMixin, bpy.types.PropertyGroup):
enabled = BoolProperty ( name = " Enabled " , default = True , options = set ( ) )
enabled = BoolProperty ( name = " Enabled " , default = True , options = set ( ) )
sound = PointerProperty ( name = " Sound " ,
sound = PointerProperty ( name = " Sound " ,
description = " Sound Datablock " ,
description = " Sound Datablock " ,
type = bpy . types . Sound )
type = bpy . types . Sound ,
update = _update_sound )
# This is needed because pointer properties do not seem to allow update CBs... Bug?
sound_data_proxy = StringProperty ( name = " Sound " ,
description = " Name of sound datablock " ,
get = _get_name_proxy ,
set = _set_name_proxy ,
options = set ( ) )
is_stereo = BoolProperty ( default = True , options = { " HIDDEN " } )
is_stereo = BoolProperty ( default = True , options = { " HIDDEN " } )
is_valid = BoolProperty ( default = False , options = { " HIDDEN " } )
is_valid = BoolProperty ( default = False , options = { " HIDDEN " } )