Page MenuHome

Fix T89587: Don't Change Line Width For Previews
ClosedPublic

Authored by Harley Acheson (harley) on Jan 3 2022, 10:07 PM.

Details

Summary

Do not temporarily change U.pixelsize while creating object previews
in object_preview_render. It does nothing, but can affect UI drawing
since this is done in a thread.


The function that creates offscreen renders for object previews temporarily changes U.pixelsize to 2.0, creates the render, then sets it back to the previous value.

First, it is a bit odd to change this to a specific value that is not related to the current value. A user might have pixelsize set to 3.0 when this starts for accessibility issues. Best to use the current value.

Second it doesn't do anything. It would have visible effect if the render includes options like wireframe or cavity shaders. Those options do change with line width and we wouldn't want those features to become narrower than a pixel when these previews are resized and shown. But the renders do not include these features. Following compares the previews before and after this patch is applied:

Third these previews are done in a background thread. So if any UI drawing is done while rendering is occurring then it will draw fonts and widgets at the wrong size.

Diff Detail

Repository
rB Blender

Event Timeline

Harley Acheson (harley) requested review of this revision.Jan 3 2022, 10:07 PM
Harley Acheson (harley) created this revision.
Harley Acheson (harley) edited the summary of this revision. (Show Details)

Can you double-check you're on master here? The file was moved from render_preview.c to render_preview.cc last week.

@Jesse Yurkovich (deadpin) - Can you double-check you're on master here? The file was moved from render_preview.c to render_preview.cc last week.

Wow, I was way behind. Updated.

I think this is safe to do. I did want to remove this already anyway, just didn't have take the minute to think about possible issues. I don't see any.

Point was to ensure line-thickness is always enough in case the asset previews are displayed on a Retina screen, esp when sharing assets with others (so this wouldn't be related to one's personal preferences). However:

  1. This would only be used for the grid, outlines, lamps, etc, which we currently don't draw in the preview.
  2. The preview is upscaled on Retina/hi-DPI screens anyway so the line thickness increases.
This revision is now accepted and ready to land.Jan 4 2022, 8:06 PM