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

fix manual preview button #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ZigZagT
Copy link

@ZigZagT ZigZagT commented Nov 14, 2024

This fixes a issue where the addon keeps generating previews on every change as soon as the "update preview once" button is tapped at least once

I believe this also fixes #121 although the issue did not include sufficient detail to pin point the root cause.

reproduce steps:

  • open "generate bin" command
  • make sure "show preview" option is off
  • click "update preview once" button once
  • make a change to other parameters (i.e. bin length)
  • the preview now refreshes, which is unexpected

root cause analysys

I think this is because showPreviewManual.value = False did not work as intended. Although it's counter intuitive, it actually makes sense if you think about it. A change made in event handler would trigger another event and resulting in infinite loop. I think Fusion is smart enough to ignore such changes to avoid hanging up.

The fix

I implemented this fix with a global variable because I can't think of a better way. It works during my testing but I honestly don't know if this fix will introduce unexpected side effects. Suggestions are very welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Model regenerates after every change
1 participant