Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scene not updated when changing an effect's input #69

Open
benbovy opened this issue Sep 28, 2020 · 7 comments
Open

Scene not updated when changing an effect's input #69

benbovy opened this issue Sep 28, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@benbovy
Copy link

benbovy commented Sep 28, 2020

(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.

@martinRenou
Copy link
Collaborator

It looks like a bug indeed, thanks for reporting

@martinRenou martinRenou added the bug Something isn't working label Sep 28, 2020
@benbovy
Copy link
Author

benbovy commented Sep 30, 2020

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.

@martinRenou
Copy link
Collaborator

Thanks for tracking it down. I fear this is due to the ThreeJS update. I'll try to find time to fix this.

@Krande
Copy link

Krande commented Aug 12, 2021

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 :)

@benbovy
Copy link
Author

benbovy commented Aug 12, 2021

@Krande my workaround is the same than yours 🙂

@martinRenou
Copy link
Collaborator

😕 I need to find time to work on this

@benbovy
Copy link
Author

benbovy commented Aug 12, 2021

No rush @martinRenou! That workaround is not ideal but it's only minor annoyance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants