icosa-foundation / open-brush

Open Brush is the open source, community led evolution of Tilt Brush! Forked from https://github.com/googlevr/tilt-brush
https://openbrush.app
Apache License 2.0
848 stars 175 forks source link

Sketches using the new "Plane" guide won't open in earlier versions #229

Open andybak opened 2 years ago

andybak commented 2 years ago

ArgumentException: Plane TiltBrush.WidgetManager.GetStencilPrefab (TiltBrush.StencilType type) (at Assets/Scripts/WidgetManager.cs:993)

The problem is here:

       public StencilWidget GetStencilPrefab(StencilType type)
        {
            for (int i = 0; i < m_StencilMap.Length; ++i)
            {
                if (m_StencilMap[i].m_Type == type)
                {
                    return m_StencilMap[i].m_StencilPrefab;
                }
            }
            throw new ArgumentException(type.ToString());
        }

m_StencilMap is serialized in the main scene as part of WidgetManager on the SketchControls gameobject. Even though older versions contain an enum entry for "Plane", it's not one of the serialized values on WidgetManager and therefore fails the check in GetStencilPrefab. And rather than failing gracefully - the loading of the sketch halts at this point.

andybak commented 2 years ago

The best solution I can think of would be to keep the legacy data structure for guides in the saved tilt file but add a new more future proof one that can handle new guide types without choking. Older versions of the app would use the legacy data.

andybak commented 2 years ago

There is a simple workaround (remove the plane guide and resave)

And not many people are opening sketches in older versions of the app.

Therefore I think this is probably low priority.

One user reported their reasons for wanting to open sketches in older versions and it's quite interesting:

Some authors consider the movie to be the finished product, while others aim to create a field such as Cluster. I am very particular about having my work viewed in VR. Not everyone who views my work uses OpenBrush, and I want TiltBrush users to be able to view my work as well, so I make sure it can be loaded either way.

https://discord.com/channels/783806589991780412/784197548918177842/950710620049780757