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

[Lightfield Viewport] Rework the UI for the live view settings #72

Open
TheDuckCow opened this issue Dec 16, 2021 · 7 comments
Open

[Lightfield Viewport] Rework the UI for the live view settings #72

TheDuckCow opened this issue Dec 16, 2021 · 7 comments
Labels
enhancement Request an improvement of an existing feature

Comments

@TheDuckCow
Copy link
Contributor

This is a feature request idea for another mode on how to update the viewport. As it stands right now, playing an animation in the viewport with updates to the looking glass yield about an 8fps playback, which is not that useful. It also makes any operations within blender quite slow. Conversely, purely manual refresh mode means I have to click a button whenever I want to update a preview. I would be nice if there was another mode in which the addon detects whether "changes are being made", and it waits to attempt a re-render on the looking glass window until after changes are no longer being made.

The most simple way this coudl be implemented would be with the bpy.data.handlers' depsgraph pre/post, which itself could then set off a timer handler. Presume the timer is triggered after 0.5s (maybe a setting in user preferences), the timer handler then checks a global/cached var to see if the depsgraph has been called/updated since the timer was first set. If it has, it'll skip re-rendering. But if there hasn't been a despgraph callback since, it'll do the re render. Having this more intelligent refresh would make it loads more convenient working with the the addon in a more practical fashion, as you no longer have to think about when to refresh (manual button refresh), nor deciding whether you want to turn on the live display at the cost of playback fps.

The low resolution viewer seems to have some similar capability, in that it auto renders a higher resolution after you stay on the same frame for a moment (which works wonderfully).

@TheDuckCow
Copy link
Contributor Author

If you agree with this proposal, I'm happy to take a stab at it via a pull request.

@regcs
Copy link
Owner

regcs commented Dec 16, 2021

Thanks for your suggestion and being willing to contribute, which is always welcome.

However, the exact same thing you are describing was already implemented in version 2.0.2 of the add-on and is the default behavior (Refresh Mode: Automatic, No Preview, toggle the preview mode button). Does this not work for you or am I missing the point in your request?

Bildschirmfoto 2021-12-16 um 08 45 26

@TheDuckCow
Copy link
Contributor Author

Amazing - it works pretty much exactly as I envisioned! I also love that it's the default setting - I think I was thrown off by the "No Preview" text, thinking it wasn't going to render anything, so I immediately was changing it to one of the other settings. Hovering over the dropdown and reading the 'alt text' definitely gives the description I'd expect.

I guess I'm also a little confused about the relationship of the two dropdowns. It almost seems like this "No Preview" mode should be part of the top dropdown, since it specifies when rerenders happen, while the second dropdown could more describe how it's rerendered (e.g. resolution, viewe cone). I could definitely imaging wanting to "skip every 2nd or 3rd view" while wanting to also have this "smart re-render" ("No Preview") mode enabled. Likewise with the restricted view cone. I like the simplicity of having dropdown, and so I kinda hate to suggest this, but I almost wonder if check boxes for each of those optimizations could be suitable. It could also be shoved into another advanced (initially collapsed) subpanel.

Maybe I'm also just asking for an "ultimate ligthweight performance" option, where it restricts view cone, renders low resolution, skips every 1-2 frames, AND does low resolution (but then re-renders full once I've stopped interacting after a moment).

@regcs
Copy link
Owner

regcs commented Dec 16, 2021

Yeah, I understand that it can be a bit confusing. And your suggestion with being able to combine preview modes is also a good one. However, adding a lot of check boxes is something that I'd rather not do because it would add to the UI overload. I actually want to keep it as clean as possible. But maybe the following would be a reasonable scheme:

  1. Remove the "Use Preview Mode" toggle button and have three drop down menus.
  2. First dropdown: "Automatic Refresh" or "Manual Refresh"
  3. Second dropdown: Choose the exact refresh mode "No Preview" (render only after depsgraph changes are finished), "Low-Resolution Preview" (render at low resolution during depsgraph changes), or "Full-resolution preview" (render at full resolution during depsgraph changes)
  4. Third dropdown: Choose the preview mode between "Skipped View", "Restricted Viewcone", "Skipped View + Restricted Viewcone"

That way it might be clearer what happens and would also enable to combine the modes as you suggested. Would that sound more reasonable than the current UI for you?

@regcs regcs added the enhancement Request an improvement of an existing feature label Dec 19, 2021
@TheDuckCow
Copy link
Contributor Author

TheDuckCow commented Dec 20, 2021

Thanks for thinking it through! I think this will come through more clearly. Couple thoughts:

First, I'd make sure there's a label drawn next to the dropdowns. The dropdowns won't take the full width of the toolbar, and their text will be truncated, but it'll be more intuitive what they are doing. I'd assume the labels would be:

  • [automatic/preview doesn't need a label imo; it could also be an embossed bool, so it'd be enable or disable a button called "Automatic"]
  • Refresh, which implies it has to do with responding to scene changes.
  • Preview (or Render, or Optimize), which helps demonstrate it includes ways to improve performance by changing the way it renders.

Then, as part of that Refresh dropdown, I'd consider these terms:

  • "Delayed" or "Wait": No previews renders while scene is changing or being updated. I'd put in the description something about it being the best performance. I'm mentioning this over the term "No Preview", since it still makes me think "oh that'll turn off any rendering on the looking glass, I do want something to render") but it's maybe "No preview" is intuitive enough if the refresh label is there.
  • "Small realtime render", description: Continually render a half resolution preview even as the scene updates. The word "realtime" helps clarify this; wrote "Small" instead of "low resolution" more for space, but either term would likely be truncated in the panel until the dropdown is clicked anyways. Notice I'm also dropping the "preview" term, and just calling it a render
  • "Full realtime render" similar to above.

The items under the Preview dropdown (ie "Skipped View", "Restricted Viewcone", "Skipped View + Restricted Viewcone") all sound good to me.

@regcs
Copy link
Owner

regcs commented Dec 22, 2021

Thanks for the further suggestions. I think, using an embossed bool might be the better option for the automatic/manual render modes.

For the labels I initially decided against the labels, because I didn't like the text in the boxes being truncated. But I understand your concerns here and will think about it again later.

However, I will definitely stick with the "low-resolution" and "full-resolution" wording, because a "small realtime render" looks more confusing to me. But I understand that the No Preview option can also be confusing and will rename it to something more descriptive.

@regcs regcs changed the title Smart automatic refresh with Depsgraph timers [Lightfield Viewport] Smart automatic refresh with Depsgraph timers Dec 22, 2021
@TheDuckCow
Copy link
Contributor Author

Sure thing! Thanks for considering the suggestions.

@regcs regcs changed the title [Lightfield Viewport] Smart automatic refresh with Depsgraph timers [Lightfield Viewport] Rework the UI for the live view settings Dec 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request an improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants