I'm a unity tool developper and I want to use the RecorderControllerSettingsPreset (The scriptable object of the settings when you export it in the recorder windows) and convert it into a RecorderControllerSettings.

In the documentation in need to use RecorderControllerSettingsPresets.ApplyTo(RecorderControllerSettings); on an new instance of controllerSettings (but saved on the disk, if I understood)

the error :

Could not udpate a managed instance value at property path '_accumulationSettings', with value '1'
UnityEditor.Recorder.RecorderControllerSettingsPreset:ApplyTo(RecorderControllerSettings)
CinemachineTimelineToolsWindow:CreateRecordersIntoTheTimeline() (at Assets/Editor/CinemachineTimelineToolsWindow.cs:529)
CinemachineTimelineToolsWindow:OnGUI() (at Assets/Editor/CinemachineTimelineToolsWindow.cs:171)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

my code :

//Get the RecorderControllerSettingsPreset scriptable object
var controllerSettingsPresets = AssetDatabase.LoadAssetAtPath<RecorderControllerSettingsPreset>(pathTemplate);
Assert.IsNotNull(controllerSettingsPresets, "You need to put an preset asset at : " + pathTemplate);

//Check if my instance already exist and delete it if is it
if (AssetDatabase.LoadAssetAtPath<RecorderControllerSettings>(path) != null)
    AssetDatabase.DeleteAsset(path);

//Create Instance and save it on the disk
var controllerSettings = CreateInstance<RecorderControllerSettings>();
AssetDatabase.CreateAsset(controllerSettings, path);

//Convert my scriptable object RecorderControllerSettingsPresets into RecorderControllerSettings
controllerSettingsPresets.ApplyTo(controllerSettings); // ERROR HERE

//get value from list and apply to my recorder clip
myRecorderClip.settings = controllerSettings.RecorderSettings.ElementAt(defaultTypesRecorderInt);

0

There are 0 best solutions below