Page MenuHome

Theming colors and size of background (transparency) checkerboard pattern
ClosedPublic

Authored by Michael Soluyanov (crantisz) on Feb 8 2020, 9:51 PM.
Tokens
"Like" token, awarded by Debuk."Love" token, awarded by Thirio."Love" token, awarded by HooglyBoogly."Like" token, awarded by Fracture128."Love" token, awarded by Alumx."Love" token, awarded by amonpaike."Like" token, awarded by 1D_Inc."Like" token, awarded by blackward.

Details

Summary

This patch adds ability to set up colors and size of background (transparency) checkerboard pattern in viewport and 2d editors. No new backgrounds, only changing colors in existing ones.

This is not the background of the viewport, it is a transparency checkerboard that is turned on only in render mode, when the transparency mode is on. And also in 2D-editors, (image, sequencer, ets)

Some examples:

How it works:

Useful for bright themes:

Same in Krita:

Diff Detail

Repository
rB Blender

Event Timeline

Setting Pablo as reviewer since he is in charge of theme.

Hey @Michael Soluyanov (crantisz), I tried to contact you but it seems there is no direct message here, someone told me you're working on this patch so maybe you could merge this proposal which has already the code for it, it's just needs an update.
https://blender.community/c/rightclickselect/ymfbbc/

Hey @Michael Soluyanov (crantisz), I tried to contact you but it seems there is no direct message here, someone told me you're working on this patch so maybe you could merge this proposal which has already the code for it, it's just needs an update.
https://blender.community/c/rightclickselect/ymfbbc/

Hello, you do not understand a bit. This is not the background of the viewport, it is a transparency checkerboard that is turned on only in render mode, when the transparency mode is on. And also in 2D-editors, (image, sequencer, ets)

Brecht Van Lommel (brecht) requested changes to this revision.Feb 11 2020, 12:20 PM

Avoid using different names and abbreviations in the user interface and implementation. Use either "transparent" or "alpha" for both.

release/scripts/startup/bl_ui/space_userpref.py
872

Capitalize checkerboard.

source/blender/blenloader/intern/versioning_userdef.c
187

When this is committed, it's best to bump the subversion immediately, since otherwise changes to this will be lost.

source/blender/draw/intern/shaders/common_globals_lib.glsl
73–74

I don't think this needs to be in GLSL, it doesn't seem to be read by any GLSL shader.

Is there somewhere else this can be stored?

source/blender/makesdna/DNA_userdef_types.h
179

Capitalize, remove empty line after comment.

182

Just use an int, no need to save space here.

source/blender/makesrna/intern/rna_userdef.c
1506

Capitalize color

1518

Capitalize size

This revision now requires changes to proceed.Feb 11 2020, 12:20 PM

While this patch was on review, Checkerboard was moved from EEVEE to Overlays, so I keep it in GlobalsUboStorage: colors are already here, added size only. Text formatting fixed.

When this is committed, it's best to bump the subversion immediately, since otherwise changes to this will be lost.

So what is needed to do in this case? Make this in different way?

Avoid using different names and abbreviations in the user interface and implementation. Use either "transparent" or "alpha" for both.

Looks like "alpha" is already used in code... But for UX, better "transparent". For example, Krita uses "transparent" and "Transparency settings" in Photoshop

Michael Soluyanov (crantisz) marked 5 inline comments as done.Feb 11 2020, 10:35 PM

Changed "alpha" to "transp"

Brecht Van Lommel (brecht) requested changes to this revision.Feb 14 2020, 3:24 PM

When this is committed, it's best to bump the subversion immediately, since otherwise changes to this will be lost.

So what is needed to do in this case? Make this in different way?

Whoever commits this can do the subversion bump, nothing needed from your side.

source/blender/makesrna/intern/rna_userdef.c
1502

Don't use abbreviations, use transparent instead of transp.

This revision now requires changes to proceed.Feb 14 2020, 3:24 PM

changed transp to transparent

Accepting for the code side.
Don't have a strong opinion about if these options are worth having, will leave that up to @Pablo Vazquez (pablovazquez) too.

We can commit this if he gives green light.

source/blender/makesdna/DNA_userdef_types.h
178

Note for whoever commits this: Missing space.

Since @Julian Eisel (Severin) reviewed assuming this is fine from the code side.

This revision is now accepted and ready to land.Mar 3 2020, 7:33 PM
Pablo Vazquez (pablovazquez) requested changes to this revision.Mar 5 2020, 6:20 PM

Pretty handy to have a setting like this!

I would suggest changing the name of the properties. Calling color properties as "light" or "dark", when they can be altered to be the opposite (dark to be a light color and the other way around), can be confusing. I suggest calling such properties "primary" and "secondary", then you're not assuming what would be the color used for.

Something like transparent_checker_primary, transparent_checker_secondary.

This revision now requires changes to proceed.Mar 5 2020, 6:20 PM

Change Light/Dark to Primary/Secondary

This revision is now accepted and ready to land.Mar 6 2020, 11:34 AM

Thanks for making the changes @Michael Soluyanov (crantisz)!

Looks good for me now from the UI side, whenever you have the time to commit @Julian Eisel (Severin) :D

@Julian Eisel (Severin) can you commit this? I have no rights to commit