Community
from pyfbsdk import *
mySystem = FBSystem()
for myAudio in mySystem.Scene.AudioClips:
# What is the current Destination
print myAudio.Destination
#Here should be the declaration of the destination
print myAudio.Destination = FBAudioOut()
Hi guys,
has anyone of you ever tried to change the destination of an audioclip by script?
The python docs are not listing the properties of an newly created object of the class FBAudioOut.
We have multiple sound clips in our scenes which's destination are set to "none" when you open the fbx. I just want to set this destination to the next possible, e.g. Speaker(VIA High Definition Audio). Doing this by hand takes too much time. 😉
Does anyone have a solution for this or ever tried the same?
Script so far:
from pyfbsdk import *
mySystem = FBSystem()
for myAudio in mySystem.Scene.AudioClips:
# What is the current Destination
print myAudio.Destination
#Here should be the declaration of the destination
print myAudio.Destination = FBAudioOut()
Cheers,
Chris
from pyfbsdk import *
for ac in FBSystem().Scene.AudioClips:
# Destination return the actual object set as active ( pyfbsdk.FBAudioOut object or None )
print ac.Destination
# PropertyList.Find("Destination") It is an FBPropertyEnum
print ac.PropertyList.Find("Destination")
# this property have the .EnumList attribute who return None if the index it is wrong
# exemple:
print ac.PropertyList.Find("Destination").EnumList(0)
print ac.PropertyList.Find("Destination").EnumList(1)
print ac.PropertyList.Find("Destination").EnumList(2)
# actual EnumList index
print lprop.Data
#
# i do not find a way to iterate the EnumList
# this obligate to made a while loop
# usualy i do not like use a while loop
#
# anyway, this it is an possible solution for you guy's
lprop = ac.PropertyList.Find("Destination")
i = 0
while i is not None:
if "Speakers" in lprop.EnumList(i):
lprop.Data = i
i = None
else:
i += 1
from pyfbsdk import *
for ac in FBSystem().Scene.AudioClips:
lprop = ac.PropertyList.Find("Destination")
if lprop.Data == 0:
lprop.Data = 1
Can't find what you're looking for? Ask the community or share your knowledge.