parallyze
Posts: 353
Joined: Fri Jun 05, 2015 4:18 am

DIY Dark Theme / Mod (sort of)

A few days back I was looking for an option to disable the blue/white gradient inside the 3d viewport.

Looks like this is not an option (yet). Looking through the forum I came across the "Dark Theme"-Thread. So I tried to figure out if at least all the bright white spaces could be toned done a bit. And yes, they can be changed. Actually it's pretty easy:

S3D is a Qt application. So it supports some ways to modify the design of an already compiled application. There's environment variables and the possibility of simple plain text style sheets. They do follow the CSS syntax, so finding documentation out there is no problem...

Setting QT_STYLE_OVERRIDE didn't really work for me, the two styles provided ("Windows" or "Fusion") were both bright and looked almost identical (actually I can't remember if anything than the buttons was looking different). So I had a go at a style sheet:

http://www.aunix.de/tmp/s3d/S3D_412_Dark_1.JPG

Many of Qt's components can be styled using a QSS like this. But there's two or three things I didn't find out:

1. The 3D view is obviously some custom widget/thing. No matter what I tried I couldn't affect that part of S3D in any way. Maybe it's an OpenGL viewport drawing that gradient as a camera background, who knows.

Edit: Removed pictures/description of parts missing, fixed them...

Long story short: What I initially wanted to do (remove the blue/white gradient) didn't work. But maybe some of you would like to take a look at this or just use this "mostly dark theme".

Usage:
Here's the style sheet: http://www.aunix.de/tmp/s3d/S3D_DIY_Theme.qss

Simply add "-stylesheet path\and\name_of_stylesheet.qss" to your shortcut of simplify3d.exe.

Image: http://www.aunix.de/tmp/s3d/S3D_412_Dark_5.JPG

I put the file right inside the S3D directory. If you're going to change/edit it, make sure your user account does have proper permissions.

Notes:
Just in case you're having trouble with anything - make sure it's not caused by using the stylesheet before contacting s3d support!
I looked for obvious problems when using this theme, so far it seems to work. But I'm not using the Machine Control Panel, so there might be places where the changes don't apply or something may be hidden (like the colors in tools->options).
Oh... I'm not using Dark Mode Themes myself... I switched Windows to Dark Mode and tried to mimic that somewhat. And I didn't check if maybe the myriad of qt styles for download out there can somehow be adapted to compiled applications. Or some of them. Or if maybe using tools like Ressource Hacker might give access to the viewports background (if it's a bitmap).

By the way, this is a pretty easy method to seperate multiple instances of S3D running...

Edit: Depending on the angles you're usually looking at things on the print bed you can use the printer model feature (Tools -> Options -> Machine) to darken the viewport somewhat using two planes/thin boxes forming an "L":

Image: http://www.aunix.de/tmp/s3d/S3D_412_Dark_6.JPG


And another Edit:
Fixed the style sheet regarding color visibility in "tools -> options -> visualization" and grey areas left. Temperature plot still looks somewhat bright but that may be a custom thing like the 3d viewport...


Have fun,
Daniel
Last edited by parallyze on Thu Sep 17, 2020 4:51 pm, edited 1 time in total.
parallyze
Posts: 353
Joined: Fri Jun 05, 2015 4:18 am

Re: DIY Dark Theme / Mod (sort of)

The white checkboxes/radiobuttons can also be changed. But this requires a few image files,
QSS doesn't support putting base64 encoded images right in, sadly.

Image: http://www.aunix.de/tmp/s3d/S3D_412_Dark_3.JPG

Everything from the first post is left untouched. But if you want to, you can use the version attached
to this post. It includes 4 png images and the stylesheet. Move these files into your s3d folder and
add "-stylesheet S3D_Dark.qss" to its shortcut.

Of course you can put the images somewhere else, but that'd mean you have to change the stylesheet
accordingly. By default the application will look for images relative to its current working directory.
Attachments
S3D_Dark.zip
(4.66 KiB) Downloaded 259 times
Last edited by parallyze on Thu Sep 17, 2020 4:52 pm, edited 2 times in total.
Tartine
Posts: 3
Joined: Fri Sep 11, 2020 10:20 pm

Re: DIY Dark Theme / Mod (sort of)

Hello Parallyze,

Thank you for the tutorial and mod. Sadly I can't get past the background color change.
Edit: Removed pictures/description of parts missing, fixed this...
What do you mean exactly ?

I also tried to import a L box model ( in different scales ) but it doesn't render at all.
parallyze
Posts: 353
Joined: Fri Jun 05, 2015 4:18 am

Re: DIY Dark Theme / Mod (sort of)

Hi,
Tartine wrote: Tue Sep 15, 2020 11:52 pm Thank you for the tutorial and mod. Sadly I can't get past the background color change.
Edit: Removed pictures/description of parts missing, fixed this...
What do you mean exactly ?
There were some dialogs/tool windows missing when I uploaded the first version of the stylesheet. I had pictures of them inside the post and removed them after adding them to the stylesheet.
I also tried to import a L box model ( in different scales ) but it doesn't render at all.
I don't know how you imported the model and how big it is. But the viewports actual "range" is limited and connected to the
bed size. So you might have been using a way too big model which you won't see inside the viewport any longer. Another
way of getting a darker viewport background is using a sphere:

Short description:
- Import a sphere - http://aunix.de/tmp/s3d/s3d_sph1.jpg
- Scale it and keep it centered inside the views (front/center/side) - http://aunix.de/tmp/s3d/s3d_sph2.jpg
- Scale it as big as possible before clipping occurs - http://aunix.de/tmp/s3d/s3d_sph3.jpg
- Export the sphere as STL, delete it from the current models and use
"General Options" -> "Machine" -> "Printer Models" to load it - http://aunix.de/tmp/s3d/s3d_sph4.jpg
- At regular distances you should now have a dark background - http://aunix.de/tmp/s3d/s3d_sph5.jpg

Optional: Assign custom STL/spheres to each printer profile by editing the xml
(different bed sizes/origins need aligned spheres)

It's really a dirty workaround, I wouldn't really recommend this. I'd be wondered if S3D v5 wouldn't have a dark theme right out of the box....
Tartine
Posts: 3
Joined: Fri Sep 11, 2020 10:20 pm

Re: DIY Dark Theme / Mod (sort of)

Thank you Sir.
JamesFitts
Posts: 3
Joined: Fri Sep 11, 2020 5:55 am

Re: DIY Dark Theme / Mod (sort of)

Thank you so much.
jonroundy
Posts: 2
Joined: Sun Feb 14, 2021 12:38 am

Re: DIY Dark Theme / Mod (sort of)

Do you know how to do this on osx?
User avatar
razzle69
Posts: 1
Joined: Sat Mar 12, 2022 8:03 am

Re: DIY Dark Theme / Mod (sort of)

This worked great for me. Thank you.
Russ
Parker TX USA
Anet A8 Plus, Tronxy X1 Clone

Return to “General Discussion and Tips”