Scene not updated when changing an effect's input
(adapted from the notebook example in this repo):
In [2]: mesh2 = TetraMesh.from_vtk('piston.vtu')
...
... iso2 = IsoColor(mesh2, input=('RESU____DEPL', 'DX'), min=-1.3931281e-06, max=1.3929895e-06)
...
... scene2 = Scene([iso2])
In [3]: scene2
I'd like to change the isocolor input, e.g., from another notebook cell
In [4]: iso2.input = ('RESU____DEPL', 'DY')
But it has no effect on the scene that is already rendered in cell 3 output. To see the new input color I need to re-execute that cell.
Is it the normal behavior? I see that Effect.input is synchronized so I'd rather expect that changing it would update the scene(s) already shown in output cells.
It looks like a bug indeed, thanks for reporting
Hmm I've tracked the input change down to https://github.com/QuantStack/GanyJS/blob/ebfdea022ddf068b56d6d18b0707091d4d885809/src/NodeMesh.ts#L166 in GanyJS and everything seems to be updated properly. I don't know much three.js so I'm afraid I can't do more to tackle the issue here. In the meantime I've found a workaround for my use case.
Thanks for tracking it down. I fear this is due to the ThreeJS update. I'll try to find time to fix this.
Hi, I recently encountered this issue myself and was just curious about the workaround you (@benbovy) implemented?
For now I opted for clearing my output and re-creating it:
from IPython.display import clear_output, display
clear_output()
display(app)
Hopefully your workaround is slightly more elegant than mine :)
@Krande my workaround is the same than yours 🙂
😕 I need to find time to work on this
No rush @martinRenou! That workaround is not ideal but it's only minor annoyance.