removeTrajectory showing console.error message
Hi,
I have a StructureComponent, to which I've loaded a trajectory. I wanted to remove the trajectory and replace it with an other one.
When I use component.removeTrajectory(trajectoryElement) it does work, and I'm still able to add a new trajectory afterwards and have it working. But somehow I get the message "'updateStructure: traj disposed'" (coming from here) through a console.error.
I'm a bit confused because, yes, it is supposed to be disposed of, that's what I'm asking the library to do, so why print it as an error of some sort? :thinking:
Thanks for your input on that
(using version 2.0.0-dev.36)
There might very well be some bug in the update logic. Could you have a go at finding out where?
I've got the same error message every time I run stage.removeAllComponents(); which I needed when I load new molecule to the stage.
@radifar just to make sure, in order to prioritize development efforts, is the issue "only" having an error message displayed in the console? Or is it that you are unable to remove a trajectory from the stage?
It is removed correctly. Everything is working just fine as expected, which is weird that I got such error message.
Nothing bad is happening: there is a render cycle that is occurring and a check to see whether the coordinates are still available. That's the normal flow of the code. I guess we should better assess whether this branch of the code is taken for the right reasons or due to a genuine error and only report in that case. For now, maybe we can just relegate this to a debug statement.
For now, maybe we can just relegate this to a debug statement.
I agree