Hello!
With the latest (and perhaps earlier?) Unity-approved fmod integration, adding an fmod track & clip to a unity timeline works fine, but editing the clip at all (changing length, or switching events) causes it to spit out the following error:
[FMOD] RuntimeManager accessed outside of runtime. Do not use RuntimeManager for Editor-only functionality, create your own System objects instead.
since the error happens in CreatePlayable
, the result is a null playable, rendering the entire timeline useless for in-editor previewing and editing.
The source issue seems to be the RuntimeManager.GetEventDescription(EventReference);
call, which should only happen at runtime, but is used here at edit-time and runtime.
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
{
#if UNITY_EDITOR
if (!EventReference.IsNull)
#else
if (!CachedParameters && !EventReference.IsNull)
#endif
{
FMOD.Studio.EventDescription eventDescription = RuntimeManager.GetEventDescription(EventReference);
for (int i = 0; i < Parameters.Length; i++)
{
FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription;
eventDescription.getParameterDescriptionByName(Parameters[i].Name, out parameterDescription);
Parameters[i].ID = parameterDescription.id;
}
List<ParameterAutomationLink> parameterLinks = Template.ParameterLinks;
for (int i = 0; i < parameterLinks.Count; i++)
{
FMOD.Studio.PARAMETER_DESCRIPTION parameterDescription;
eventDescription.getParameterDescriptionByName(parameterLinks[i].Name, out parameterDescription);
parameterLinks[i].ID = parameterDescription.id;
}
CachedParameters = true;
}