Playground not updating with greasedlines

Hi,

When using greasedlines in the playground, I comment out a section out to see the effect it has which updates the playground when hitting “play”. Then, I uncomment said section so that it is the same as originally, however, the playground doesn’t update. It will only work under a page refresh. Am I making a wrong assumption?


You may also notice it took 2 clicks on “play” so that the playground updates initially.

Thanks

This happens on Firefox, Linux. On Chrome it seems to happen less often, but does happen.

FYI you shared a snapshot version, but anyway, it does not seem to be related.


I admit there is an update issue (Linux + Chrome on my side), but to me it’s not even about the code itself.
When arriving on the page, the state is in a way (even sides), and hitting play again won’t change anything. Then interacting with the canvas and hitting play again, will indeed update (changing orientation)

Yes, I thought it might be the snapshot but also tried with regular playgrounds, same issue.

I was losing my sanity yesterday as changes wouldn’t reflect on the playground (thinking I was doing logic errors).

Maybe the GreasedLines wizard can help? @roland

1 Like

I didn’t dig deep but this solves the problem:

Use:

directions: BABYLON.Vector3.Up(),

instead of UpReadOnly.

I use BABYLON.TmpVectors (which are “static”) in GreasedLine and it seems somewhere the Vector3 object referenced byt the temp vector gets lost/reinitialized/whatever when starting the PG again.

1 Like

It indeed solves it, thanks Roland.

1 Like