08-30-2024, 09:19 AM
Hi,
Thank you for reporting this bug. Indeed, the "Save Generator Outputs" options was not working on disabled generators. I wrote a fix. I will further test it and release it with the next update. Until then, you have two choices, depending on your preferences:
Modifying the code of Curvy Splines to include the fix:
Go to Extensions.cs, then the ObjectExt class. Add to it the following method:
Then go to CurvyGenerator.cs, then the OnSceneSaving method. Replace it with the following:
Workaround the issue:
You can avoid the issue by clicking on the "Clear Output" button on the generator's toolbar before disabling it.
Please let me know if you still encounter this issue.
Thank you for your bug report, and have a nice day.
Thank you for reporting this bug. Indeed, the "Save Generator Outputs" options was not working on disabled generators. I wrote a fix. I will further test it and release it with the next update. Until then, you have two choices, depending on your preferences:
Modifying the code of Curvy Splines to include the fix:
Go to Extensions.cs, then the ObjectExt class. Add to it the following method:
Code:
/// <summary>
/// A method compatible with all Unity version, that returns all objects of a given type, unsorted
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static T[] FindUnsortedObjectsOfType<T>(
bool includeInactive) where T : Object
{
#if UNITY_6000_0_OR_NEWER
return Object.FindObjectsByType<T>(
includeInactive
? FindObjectsInactive.Include
: FindObjectsInactive.Exclude,
FindObjectsSortMode.None
);
#else
return Object.FindObjectsOfType<T>(includeInactive);
#endif
}Then go to CurvyGenerator.cs, then the OnSceneSaving method. Replace it with the following:
Code:
private static void OnSceneSaving(
Scene scene,
string path)
{
if (CurvyGlobalManager.SaveGeneratorOutputs)
return;
//clear all output GOs to avoid saving them.
CurvyGenerator[] generators = ObjectExt.FindUnsortedObjectsOfType<CurvyGenerator>(true);
foreach (CurvyGenerator generator in generators)
//only if the generator is supposed to refresh automatically, otherwise the users might not expect their generator to update
if (generator.AutoRefresh)
foreach (CGModule module in generator.Modules)
if (module.DeleteAllOutputManagedResources())
module.Dirty = true; //to force update once saving is done
}Workaround the issue:
You can avoid the issue by clicking on the "Clear Output" button on the generator's toolbar before disabling it.
Please let me know if you still encounter this issue.
Thank you for your bug report, and have a nice day.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Please consider leaving a review for Curvy, this helps immensely. Thank you.

