[Bf-blender-cvs] [19c7ef3067b] master: UV: minor adjustments to opacity adjustment
Campbell Barton
noreply at git.blender.org
Fri Apr 17 05:56:07 CEST 2020
Commit: 19c7ef3067b7907101bbaa79d6a671052a4551ed
Author: Campbell Barton
Date: Fri Apr 17 13:53:15 2020 +1000
Branches: master
https://developer.blender.org/rB19c7ef3067b7907101bbaa79d6a671052a4551ed
UV: minor adjustments to opacity adjustment
- Allow 0.0..1.0 range, as even at 0.0 the selection is still visible.
- Correct versioning code, not to overwrite the value for new files.
===================================================================
M source/blender/blenloader/intern/versioning_290.c
M source/blender/makesrna/intern/rna_space.c
===================================================================
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c
index c6adbb5c7d2..0ce3cf405cd 100644
--- a/source/blender/blenloader/intern/versioning_290.c
+++ b/source/blender/blenloader/intern/versioning_290.c
@@ -23,6 +23,7 @@
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
+#include "DNA_genfile.h"
#include "DNA_screen_types.h"
#include "BKE_collection.h"
@@ -49,12 +50,14 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
/* Keep this block, even when empty. */
- for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
- LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
- LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
- if (sl->spacetype == SPACE_IMAGE) {
- SpaceImage *sima = (SpaceImage *)sl;
- sima->uv_opacity = 1.0f;
+ if (!DNA_struct_elem_find(fd->filesdna, "SpaceImage", "float", "uv_opacity")) {
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+ if (sl->spacetype == SPACE_IMAGE) {
+ SpaceImage *sima = (SpaceImage *)sl;
+ sima->uv_opacity = 1.0f;
+ }
}
}
}
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index f6a7c74484a..c6a94aae450 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2937,7 +2937,7 @@ static void rna_def_space_image_uv(BlenderRNA *brna)
prop = RNA_def_property(srna, "uv_opacity", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "uv_opacity");
- RNA_def_property_range(prop, 0.2f, 1.0f);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "UV Opacity", "Opacity of UV overlays");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_IMAGE, NULL);
More information about the Bf-blender-cvs
mailing list