Fix: Add missing default versioning for retopology overlay color #105539

Merged
Jeroen Bakker merged 6 commits from bonj/blender:retopology-overlay-color-fix into main 2023-03-12 09:34:05 +01:00
Contributor

This is something we missed in #104599.
Without it, the default color isn't always set.
Thanks to user roman-13 for pointing out the problem,
and thanks to Hans Goudey for telling me the solution.

This is something we missed in #104599. Without it, the default color isn't always set. Thanks to user roman-13 for pointing out the problem, and thanks to Hans Goudey for telling me the solution.
Jorijn de Graaf added 1 commit 2023-03-07 18:24:03 +01:00
61116ee936 Add face_retopology to do_versions_theme
This is something we missed in #104599. Without it, the default color isn't always set.
Thanks to user roman-13 for pointing out the problem, and thanks to Hans Goudey for telling me the solution.
Jorijn de Graaf requested review from Jeroen Bakker 2023-03-07 18:24:18 +01:00
Jorijn de Graaf changed title from Add face_retopology to do_versions_theme to WIP: Add face_retopology to do_versions_theme 2023-03-07 18:30:16 +01:00
Author
Contributor

Putting in a userpref.blend from Blender 3.4 still results in the default color not being set correctly, so I guess I need to do some more testing.
It doesn't appear that do_versions_theme is called at all.

Okay it seems those issues were on my end, my computer was haunted.
Everything works as expected now, so this is ready to merge.

If you're curious, the issue was that Visual Studio has separate folders for build and install, and I only did the install procedure the first time.
I've since reconfigured it to install in build/bin, so I don't need to install after every build.

~~Putting in a userpref.blend from Blender 3.4 still results in the default color not being set correctly, so I guess I need to do some more testing. It doesn't appear that `do_versions_theme` is called at all.~~ Okay it seems those issues were on my end, my computer was haunted. Everything works as expected now, so this is ready to merge. If you're curious, the issue was that Visual Studio has separate folders for build and install, and I only did the install procedure the first time. I've since reconfigured it to install in build/bin, so I don't need to install after every build.
Jorijn de Graaf changed title from WIP: Add face_retopology to do_versions_theme to WIP: Fix: Add missing default versioning for retopology overlay color 2023-03-07 18:44:56 +01:00
Jorijn de Graaf changed title from WIP: Fix: Add missing default versioning for retopology overlay color to Fix: Add missing default versioning for retopology overlay color 2023-03-07 22:59:41 +01:00
Jeroen Bakker requested changes 2023-03-08 11:29:41 +01:00
@ -99,6 +99,8 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
* \note Keep this message at the bottom of the function.
*/
{
FROM_DEFAULT_V4_UCHAR(space_view3d.face_retopology);
Member

This will reset the value each time blender starts. It is better to add a new subversion bump.

This will reset the value each time blender starts. It is better to add a new subversion bump.
Author
Contributor

So should I check that the version is older than whatever version it was when retopology overlay was merged?

So should I check that the version is older than whatever version it was when retopology overlay was merged?
Author
Contributor

Note that retopology_offset is also set in a similar "versioning code until next subversion" block.
Should that be changed too?

Note that retopology_offset is also set in a similar "versioning code until next subversion" block. Should that be changed too?
Author
Contributor

Okay I think I understand, and will go with version 306 subversion 0.
The reason why this needs such a check while retopology_offset doesn't, is because this code doesn't check whether the property already exists in the DNA.
Instead it reads the userpref file, and if it's older than the version that added the theme color, it sets it to default.

Okay I think I understand, and will go with version 306 subversion 0. The reason why this needs such a check while retopology_offset doesn't, is because this code doesn't check whether the property already exists in the DNA. Instead it reads the userpref file, and if it's older than the version that added the theme color, it sets it to default.
bonj marked this conversation as resolved
Hans Goudey added this to the EEVEE & Viewport project 2023-03-08 14:44:15 +01:00
Jorijn de Graaf added 1 commit 2023-03-09 00:18:26 +01:00
Jorijn de Graaf added 1 commit 2023-03-09 00:25:59 +01:00
b85c1d9d7a Move default retopology color into version block
We don't want it to reset the color every time, just if the preferences file is older than the version that added the color.
Jorijn de Graaf requested review from Jeroen Bakker 2023-03-09 00:26:36 +01:00
Jeroen Bakker reviewed 2023-03-09 08:04:09 +01:00
@ -89,6 +89,10 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
btheme->tui.wcol_view_item = U_theme_default.tui.wcol_view_item;
}
if (!USER_VERSION_ATLEAST(306, 0)) {
Member

You also need to bump the sub version:

  • Increase BLENDER_FILE_SUBVERSION
  • Use the same number in this if statement.
  • Ensure that all Versioning code until next subversion bump goes here. are guarded by a similar if statement in their respective files. Check ae84a2956e as an example.
You also need to bump the sub version: - Increase `BLENDER_FILE_SUBVERSION` - Use the same number in this if statement. - Ensure that all `Versioning code until next subversion bump goes here.` are guarded by a similar if statement in their respective files. Check ae84a2956ec61bc182f23c7a914fca3f37a5c83f as an example.
Author
Contributor

If I move retopology_offset in the versioning 300 file into a version check block, does it still need to check if it exists in the DNA, or is the version check alone enough?
I'm going to assume the DNA check stays, but asking just to be sure.
There's also other people's code in the "Versioning code until next subversion bump goes here." block that has retopology_offset, so I'll move that into the 306.1 version check as well.

If I move retopology_offset in the versioning 300 file into a version check block, does it still need to check if it exists in the DNA, or is the version check alone enough? I'm going to assume the DNA check stays, but asking just to be sure. There's also other people's code in the "Versioning code until next subversion bump goes here." block that has retopology_offset, so I'll move that into the 306.1 version check as well.
bonj marked this conversation as resolved
Jorijn de Graaf added 1 commit 2023-03-09 13:39:44 +01:00
b3b930bbbf Bump subversion and adjust versioning accordingly
Jeroen Bakker told me to bump the subversion.
I moved all the "Versioning code until next subversion bump goes here." code into a version check block in versioning_300.cc, and adjusted my if block in versioning_userdef.c.
Jorijn de Graaf added 1 commit 2023-03-09 13:42:33 +01:00
Jeroen Bakker approved these changes 2023-03-09 14:56:53 +01:00
Jorijn de Graaf added 1 commit 2023-03-09 23:05:14 +01:00
Jeroen Bakker merged commit e2030fbc33 into main 2023-03-12 09:34:05 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#105539
No description provided.