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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-08-10 14:42:14 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-08-13 17:13:19 +0300
commitaef08fda3ade2d0223b77d4c9c0dd5e9fcabe7b2 (patch)
treeddde62d4cdf7d9896f0c8ac8fe694cf197c3ce7b /source/blender/editors/interface/interface_layout.c
parent6e7ea807e1e8aa0791a3c1d8875e74d64481973c (diff)
Custom Properties: officially support int and float arrays in the UI.
In some rare cases it is convenient to store a short array value as a custom property, e.g. a vector or color. For example, it may be helpful when importing/exporting certain formats that support custom or nonstandard attributes on objects. The custom property storage already can handle arrays in order to support properties defined via python. The only thing missing is UI support (and some bugs), and this patch fixes that: - Allow editing short array properties via Custom Properties panel. - Fix a UI layout sizing bug triggered by the previous item. - Fix a dependency graph bug with drivers using such properties. - Make RNA_*_get_default_array code robust in case of size mismatch. - Support custom default values for array properties, allowing both an array and a scalar value. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D5457
Diffstat (limited to 'source/blender/editors/interface/interface_layout.c')
-rw-r--r--source/blender/editors/interface/interface_layout.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 25fedf8519a..530689f2d27 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1832,7 +1832,9 @@ static void ui_item_rna_size(uiLayout *layout,
h += len * UI_UNIT_Y;
}
}
- else if (ui_layout_variable_size(layout)) {
+
+ /* Increase width requirement if in a variable size layout. */
+ if (ui_layout_variable_size(layout)) {
if (type == PROP_BOOLEAN && name[0]) {
w += UI_UNIT_X / 5;
}