Jump to content

SplineExtension data not persisting between sessions


CitrioN
Go to solution Solved by Manny,

Recommended Posts

Hello,

I noticed that the spline extension scriptable objects do not persist their data between sessions meaning any modified data will be lost when restarting Unity.

I tested this in a fresh project with Unity 2020.3.30f1 (latest 2020 LTS at the time of this writing) and nothing else imported to ensure nothing else is interfering or causing this behaviour. I am using GeNa Pro v3.3.16 (from Feb. 9th).

 

Additionally 2 errors will be thrown when selecting the road or river extension asset:

 

Layer index out of bounds
UnityEditor.EditorGUILayout:LayerField (int,UnityEngine.GUILayoutOption[])
GeNa.Core.GeNaRoadExtensionEditor:GlobalPanel () (at Assets/Procedural Worlds/GeNa/Scripts/Editor/Extensions/GeNaRoadExtensionEditor.cs:57)
GeNa.Core.GeNaRoadExtensionEditor:OnInspectorGUI () (at Assets/Procedural Worlds/GeNa/Scripts/Editor/Extensions/GeNaRoadExtensionEditor.cs:31)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

I haven't seen anything in the documentation that requires me to setup a specific layer in the project.

Both the road and river extension have a layer dropdown in the inspector, both of which are blank (no layer value assigned) in my case.

Assigning a layer does resolve this error. Is this intended behaviour or should a layer that always exists (Default) be assigned automatically to avoid this error being thrown in the first place?

 

NullReferenceException: Object reference not set to an instance of an object
GeNa.Core.GeNaRoadExtensionEditor.GlobalPanel () (at Assets/Procedural Worlds/GeNa/Scripts/Editor/Extensions/GeNaRoadExtensionEditor.cs:109)
GeNa.Core.GeNaRoadExtensionEditor.OnInspectorGUI () (at Assets/Procedural Worlds/GeNa/Scripts/Editor/Extensions/GeNaRoadExtensionEditor.cs:31)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <d4fb0f5bc2524ac39bb755624e6a18e7>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

 

Thanks,

CitrioN

Link to comment
Share on other sites

Hello,

since it has been a week without a reply I would like to bring this up again.

When working with the GeNa Spline Extension scriptable objects their data is not properly serialized/deserialized.

I am still using the same GeNa Pro and Unity versions as listed above.

I also went ahead and created a ScriptableObject script myself to see if there is a general issue with the serialization.

My own does work as expected.

 

How to reproduce:

  1. Modify the width parameter either in the default one or create a new one from the create asset menu
  2. Save the project
  3. Close the project
  4. Open the project
  5. Check the width value in the previously modified carve extension

 

In my case it did not serialize the modified value to disk.

I verified this by inspecting the asset file itself too.

If I modify the asset file itself in a text editor the modified value will be properly deserialized.

I assume something in the serialization process fails to properly save the modified data.

 

Thanks,

CitrioN

 

 

Link to comment
Share on other sites

On 3/4/2022 at 4:08 AM, CitrioN said:

Hello,

since it has been a week without a reply I would like to bring this up again.

When working with the GeNa Spline Extension scriptable objects their data is not properly serialized/deserialized.

I am still using the same GeNa Pro and Unity versions as listed above.

I also went ahead and created a ScriptableObject script myself to see if there is a general issue with the serialization.

My own does work as expected.

 

How to reproduce:

  1. Modify the width parameter either in the default one or create a new one from the create asset menu
  2. Save the project
  3. Close the project
  4. Open the project
  5. Check the width value in the previously modified carve extension

 

In my case it did not serialize the modified value to disk.

I verified this by inspecting the asset file itself too.

If I modify the asset file itself in a text editor the modified value will be properly deserialized.

I assume something in the serialization process fails to properly save the modified data.

 

Thanks,

CitrioN

 

 

Sorry about that, we are investigating this issue! 
We should have something for you soon!

  • Thanks 1
Link to comment
Share on other sites

On 3/4/2022 at 9:08 PM, CitrioN said:

Hello,

since it has been a week without a reply I would like to bring this up again.

When working with the GeNa Spline Extension scriptable objects their data is not properly serialized/deserialized.

I am still using the same GeNa Pro and Unity versions as listed above.

I also went ahead and created a ScriptableObject script myself to see if there is a general issue with the serialization.

My own does work as expected.

 

How to reproduce:

  1. Modify the width parameter either in the default one or create a new one from the create asset menu
  2. Save the project
  3. Close the project
  4. Open the project
  5. Check the width value in the previously modified carve extension

 

In my case it did not serialize the modified value to disk.

I verified this by inspecting the asset file itself too.

If I modify the asset file itself in a text editor the modified value will be properly deserialized.

I assume something in the serialization process fails to properly save the modified data.

 

Thanks,

CitrioN

 

 

Hi @CitrioN,

Just to let you know, I have been looking more closely at this issue this week and I think I can provide you with a fix in the next version of GeNa (3.3.17). I've noticed that in some newer versions of Unity, it shows more prominently. I'll keep you posted on what I find!

Kind regards,
Manny 

  • Thanks 1
Link to comment
Share on other sites

  • 3 months later...

Hey @Manny,
I'd like to bring to your attention that a fix for this bug has not been included in 3.3.17 or 3.3.18. This issue has been around for several months now and it would be great to know when a fix for it will be in place.

Thanks,

CitrioN

Link to comment
Share on other sites

Hey @CitrioN,
I can confirm that we did indeed push a fix for this in 3.3.18 so I'm uncertain what is causing this issue on your side. 
The problem originally was due to the fact that whenever you edited the ScriptableObject and it was in the scene, it wasn't serializing to the Scene. I just tested the one on the Asset Store with the base LTS version of Unity (2020.3) and it works as expected.

So that I can better investigate this issue, could you assist me in providing the following:

  1. What version of Unity you're experiencing this in?
  2. Are you having trouble with using it in a Prefab context? (note: we are having issues with certain versions of Unity serializing these to disk).

Thank you for your patience.

Link to comment
Share on other sites

11 hours ago, Manny said:
  1. What version of Unity you're experiencing this in?
  2. Are you having trouble with using it in a Prefab context? (note: we are having issues with certain versions of Unity serializing these to disk).

Hey @Manny,

Thanks for the fast reply.

1. I'm now on Unity 2021.3.4f1
2. I'm experiencing this regardless of using it in a prefab or not. If I create a Carve extension scriptable object via the create asset menu and modify the values for width, shoulder etc. and save the project it will be reset to it's default values upon editor restart.

I've also just tested this in a fresh project with nothing but GeNa Pro imported in both Unity 2021.3.4f1 and 2020.3.36f1. To be sure it's not related to my computer I also went ahead and tested it on my laptop with the same issue occurring in 100% of the cases. All tests have been conducted on GeNa version 3.3.18. To avoid potential updating issues with the package manager I also went ahead to first delete the previous downloaded version of GeNa on my hard drive to guarantee a fully fresh download.

Link to comment
Share on other sites

  • Solution
16 hours ago, CitrioN said:

Hey @Manny,

Thanks for the fast reply.

1. I'm now on Unity 2021.3.4f1
2. I'm experiencing this regardless of using it in a prefab or not. If I create a Carve extension scriptable object via the create asset menu and modify the values for width, shoulder etc. and save the project it will be reset to it's default values upon editor restart.

I've also just tested this in a fresh project with nothing but GeNa Pro imported in both Unity 2021.3.4f1 and 2020.3.36f1. To be sure it's not related to my computer I also went ahead and tested it on my laptop with the same issue occurring in 100% of the cases. All tests have been conducted on GeNa version 3.3.18. To avoid potential updating issues with the package manager I also went ahead to first delete the previous downloaded version of GeNa on my hard drive to guarantee a fully fresh download.

Ah ha! I think I finally found what the issue was. Our Custom Editors for the Extensions weren't marking the ScriptableObjects as dirty when changed. 

Try importing this patch and see if this fixed it:
 GeNaPro-v3.3.18-EditorPatch.zip

Link to comment
Share on other sites

Hey @Manny,

The provided patch does indeed fix the issue. Very glad it's finally sorted out and I don't have to update my extensions every time 😊

Thanks,

CitrioN

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...