Hello, I think it's time to dive into scripting!
you can edit the .scntoc associated with your .scn files
Code: Select all
import xml.etree.ElementTree as ET
to_replace = "pattern_to_replace"
replace_by = "new_pattern"
scenetoc = "E:\\Projects\\Softimage\\Procedural\\Scenes\\AudioTest\\AudioTest.scntoc"
# load and parse scenetoc
tree = ET.parse(scenetoc)
root = tree.getroot()
# find audio sources and update content
for src in root.findall('Sources'):
for audio in src.findall('Audio'):
old_value = audio.text
new_value = old_value.replace(to_replace, replace_by)
audio.text = new_value
# save scene toc
tree.write(scenetoc)
or you can open your scenes in batch mode also using a script
see here :
http://download.autodesk.com/global/doc ... =d30e87012
here is some python code to find and update audio source filename
Code: Select all
# we assume that there is a pattern in your re-organisation
# for exemple you renamed the project or moved it to a new disk
to_replace = "pattern_to_replace"
replace_by = "new_pattern"
def FindAudioClipsUnderModel( in_model ) :
if in_model.HasMixer()== 0 :
return []
mixer = in_model.Mixer
audioclips = []
if mixer.Clips.Count > 0 :
for clip in mixer.Clips :
if clip.Type == "mixeraudioclip":
audioclips.append(clip)
return audioclips
audioclips = FindAudioClipsUnderModel( Application.ActiveSceneRoot )
for clip in audioclips:
source = clip.Source
old_value = source.FileName.Value
new_value = old_value.replace(to_replace, replace_by)
# source.FileName.Value = new_value
# object model not working here
# use command instead
Application.SetValue(source.FileName, new_value, "")
Application.SaveScene()