Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-04-17 06:53:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-04-17 06:53:15 +0300
commit19c7ef3067b7907101bbaa79d6a671052a4551ed (patch)
tree5f892326f7b507680357b70d09f6be976ac6c303
parentcbd6c5735da1f49a7293e4c2aa68f8ccd0812f7e (diff)
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.
-rw-r--r--source/blender/blenloader/intern/versioning_290.c15
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
2 files changed, 10 insertions, 7 deletions
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);