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
777 stars 166 forks source link

Build error with CHRFont.cs at line 66 "FormatException: Input string was not in a correct format." #661

Open TheBricktop opened 3 months ago

TheBricktop commented 3 months ago

Hello im trying to build the openbrush to oculus quest 3 but im getting wierd error with string not being parsed due to incorrect format of the string and im trying to fix it. Is there any pointer on why it is happening ?

edit : I used ol' reliable tryparse and it started to build. `

                foreach (var point in pointsString)
                {
                    var coordsString = point.Trim().Split(',');
                    if (coordsString.Length < 1) continue;
                    /*
                    float xCoord = float.Parse(coordsString[0]);

                    float yCoord = float.Parse(coordsString[1]);
                    */
                    float xCoord = 0, yCoord = 0;
                    float.TryParse(coordsString[0], out xCoord);
                    float.TryParse(coordsString[1], out yCoord);
                    var coord = new Vector2(xCoord / 20f, yCoord / 20f);
                    Height = Mathf.Max(Height, coord.y);
                    points.Add(coord);
                }

`

andybak commented 3 months ago

If this is the error I think it is, then it only happens first time you load the project. I never got around to fixing it for that reason.

If it's something else then can you provide more info? Full stack trace, what you're doing when it happens etc.

EDIT - no. this is the error I was thinking of:

NullReferenceException: Object reference not set to an instance of an object
TiltBrush.CHRFont.OnEnable () (at Assets/Scripts/TextToStrokes/CHRFont.cs:39)

I'd still like to see the stack trace. But in general I don't build in Unity - I use the CI build. If push any commit to a branch with [CI BUILD] somewhere in the message, it should kick of a build on Github. (assuming you've turned on Github Actions for your fork)