Closed zepumph closed 6 years ago
By the looks of it TNode only got a toStateObject
a month ago, so it wouldn't be surprising to me to hear CAF has been broken for that long.
Is TNode.toStateObject destined to be the foundation for customizing visibility/pickability of nodes? If so, we may need to leave phetioState
on by default.
That's true, should we instead investigate why the Node is not able to find itself in the downstream sim, similar to https://github.com/phetsims/charges-and-fields/issues/141 and the ESPB work we did this morning?
Yes, we should look for an explanation like that.
Sounds good.
Proposed fix is above, @zepumph please review.
That looks good to me. I like that we are linking the tandems from the view and the model. We will need to do the same thing for the sensors.
I applied the same strategy for the sensors, @zepumph please review.
Looks good, I just found this problem again in https://github.com/phetsims/energy-skate-park-basics/issues/395, but looks like it could be as simple of a fix. Closing this one though!
@samreid commented in https://github.com/phetsims/charges-and-fields/issues/141#issuecomment-338531366:
I poked around and realized the problem is that we are now instrumenting the Node's of the ModelElements as well as the model side. This isn't how the save and load was set up for CAF, so it is breaking it. We only added
toStateObject
on TNode recently, and I think that it is best to remove it from the state by default and opt into including certain Node instances if deemed necessary. I applied this strategy for CAF and it worked. @samreid please review.